Repository navigation
Conversation
Signed-off-by: Hiroto Toyoda <hirototoyoda20020927@gmail.com>
This branch has not been deployed
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.
What this PR does
publishpushes localextendsparent files as layers of the OCI artifact, but the sensitive data check only scanned the top-level compose files, so a secret in an extends parent was published without the prompt. This makes the check scan the same filespublishpushes.Related issue
Addresses #14589
This covers the
extendspart of the issue. The YAML comments part is not addressed here: its fix needs a decision, so I'll follow up on it in the issue.Changes made
internal/publish/publish.go: move the walk thatcollectEnvCheckFindingsalready used (top-level files plus local extends parents, transitively, mirroringprocessExtends) intowalkPublishedComposeFiles, and use it incheckForSensitiveDatatoo. Each file is still scanned through the re-marshalled model rather than the raw bytes.composeFileAsByteReaderis removed because nothing uses it anymore.internal/publish/publish_test.go:Test_checkForSensitiveData_extendsParentscovers a secret in an extends parent and in a grandparent.internal/e2e/publish_test.goandtestdata/TestPublishDetectSensitiveDataInExtends/: an e2e scenario with the reproduction from the issue. Answeringnto the sensitive data prompt now exits with 130, and the prompt reportsservices.base.labels.ci.token.Testing done
make testmake e2e-composeormake e2e-compose-standalonemake lintmake fmtAI tool used (if applicable)
I used Claude Code to investigate edge cases and assist with code review.
I personally reviewed and verified all the code.
Additional context
(not mandatory) A picture of a cute animal, if possible in relation to what you did