fix(vminitd): redact environment variable values from debug logs#575
Open
cluster2600 wants to merge 1 commit intoapple:mainfrom
Open
fix(vminitd): redact environment variable values from debug logs#575cluster2600 wants to merge 1 commit intoapple:mainfrom
cluster2600 wants to merge 1 commit intoapple:mainfrom
Conversation
Scrub environment variable values when logging OCI process specs to prevent secrets passed via --env from appearing in boot logs. Fixes apple#518 Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
Member
|
It was closed as I don't think we came to a consensus on how to handle it. The default logging level is no longer debug, so the envvars won't show up by default anyways anymore. Seemed like we were leaning towards only printing the oci spec at trace level, but we don't have anything exposed in |
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
<redacted>RedactedSpecandRedactedProcesswrapper types withCustomStringConvertibleconformance for clean log outputFixes #518
Context
This is a follow-up to #521 which was closed. The approach is the same: introduce redaction wrappers that replace env var values with
<redacted>before logging. This keeps boot logs useful for diagnostics (keys are still visible) while preventing secret values from leaking.Example output after this change:
Test plan
container run -d --name web --rm --env MY_SECRET=password python:slim python3 -m http.server --bind 0.0.0.0 8000container logs --boot web | grep SECRETMY_SECRETkey appears butpasswordvalue does notcontainer exec --env MY_OTHER_SECRET=abc123 web echo hello