Repository navigation
Fix Habitat authentication through sudo - #63
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Thomas Powell <104777878+tpowell-progress@users.noreply.github.com>
tpowell-progress
requested review from
brianLoomis and
sean-sype-simmons
as code owners
November 13, 2026 22:11
sean-sype-simmons
previously approved these changes
Nov 16, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Thomas Powell <104777878+tpowell-progress@users.noreply.github.com>
sean-sype-simmons
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pass
HAB_AUTH_TOKENandHAB_LICENSEexplicitly throughsudo envinstead of relying onsudo -E. This fixes the shared workflow used by chef/fauxhai#113, where the Linux Grype job reports that-Eis ignored, then Habitat returns 401 Unauthorized.Validation
python3 workflow-supporting-files/test_habitat_sudo_env.pypasses for five privileged installation paths with input, secret-fallback, and absent-token cases. The check simulates sudo stripping the environment, verifies token/license delivery and token-free logging, and checks Habitat failures propagate. It fails against unmodified main. Workflow YAML parses with Ruby Psych andgit diff --checkpasses.Live Builder token validity/package authorization is not yet verified; that requires a consuming CI run after merge. Preflight required no new credentials, scopes, keys, or policy changes. Organization-secret listing and repository Actions-policy access were forbidden; those settings remain unchanged.
Files changed
.github/workflows/grype-hab-package-scan.ymlworkflow-supporting-files/test_habitat_sudo_env.py