Enable log scrubbing by default - #2725
Merged
ryankeithster merged 5 commits intoMay 12, 2026
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
added 2 commits
May 6, 2026 17:17
Signed-off-by: Ryan Keith (from Dev Box) <ryankeith@microsoft.com>
Signed-off-by: Ryan Keith (from Dev Box) <ryankeith@microsoft.com>
ryankeithster
force-pushed
the
msrc107671-scrublogs-default
branch
from
May 7, 2026 00:18
c60931d to
7cd244c
Compare
helsaawy
reviewed
May 7, 2026
helsaawy
left a comment
Contributor
There was a problem hiding this comment.
nits with log package change, but lgtm overall
Signed-off-by: Ryan Keith (from Dev Box) <ryankeith@microsoft.com>
anmaxvl
reviewed
May 8, 2026
added 2 commits
May 8, 2026 13:25
Signed-off-by: Ryan Keith (from Dev Box) <ryankeith@microsoft.com>
Signed-off-by: Ryan Keith (from Dev Box) <ryankeith@microsoft.com>
anmaxvl
approved these changes
May 12, 2026
samuelkarp
added a commit
to samuelkarp/containerd
that referenced
this pull request
Jul 24, 2026
The io.containerd.runhcs.v1 shim can scrub sensitive information from logs it emits. Since v0.15.0-rc.2 this is done by default, but older branches still require the option to be explicitly enabled. Explicitly enable the scrubbing by default for the CRI configuration. See also: microsoft/hcsshim#2725 Google-Bug-Id: 481375460 Signed-off-by: Samuel Karp <samuelkarp@google.com>
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
Addresses security concerns related to the logging of environment variables, which could potentially contain sensitive information, in cleartext to ETW traces and log files by enabling scrubbing of this information from the logs by default.
Changes
Default scrubbing ON (
internal/log/scrub.go)init()that sets scrubbing enabled by default, eliminating the need for explicit opt-in via configScrubCreateOptions()to scrub the OCI spec (env vars + annotations) withinCreateOptionslogged during container creationProto: three-state
ScrubLogsfield (cmd/containerd-shim-runhcs-v1/options/runhcs.proto)bool scrub_logs = 20→optional bool scrub_logs = 20Shim consumers updated for
*boolsemanticscmd/containerd-shim-runhcs-v1/serve.go: Only disables scrubbing ifScrubLogsis explicitly*falsecmd/containerd-shim-lcow-v2/main.go: Same patterninternal/builder/vm/lcow/kernel_args.go: Passes-scrub-logs=falseto GCS only if explicitly disabled; otherwise always passes-scrub-logscmd/gcs/main.go: Changed--scrub-logsflag default fromfalsetotrueNew scrub coverage (
internal/hcsoci/create.go,internal/log/format.go)initializeCreateOptionsnow scrubs env vars and annotations before logging via newFormatScrubhelper