-
Notifications
You must be signed in to change notification settings - Fork 460
feat(sandbox): add kubectl and aws cli to sbx-templates image #4218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+6
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[medium/security] Mutable image tag used for kubectl COPY source — no digest pin
The
COPY --from=registry.k8s.io/kubectl:v1.37.0instruction references a mutable version tag. If this tag is ever overwritten on the registry, future builds will silently pull a different binary, which is a supply-chain integrity risk. Whileregistry.k8s.iois the official, well-governed Kubernetes registry and the realistic risk of tag mutation for a versioned release tag is low, pinning to an immutable digest fully eliminates the risk.To fix, pin the image to a specific digest alongside the version tag:
You can obtain the digest by running:
or by checking the image manifest on the registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid of the compatibility. K8s is still ensuring the compat with 2 minor versions up and down ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about Kubernetes version skew policy. You're right that digest pinning locks you to the exact binary, preventing even patch-level updates that might improve compatibility or fix bugs.
However, digest pinning doesn't prevent you from updating — it just makes updates explicit. When you need to bump kubectl (for compatibility, security, or features), you'd update both the tag and digest together. The trade-off is: mutable tags give silent updates (convenient but risky), while digest pins give explicit updates (safer but require active maintenance).
For a kubectl client used by Docker Agent, the skew policy means v1.37.0 works with clusters running 1.35–1.38. If you're comfortable with the supply-chain risk from mutable tags (especially since registry.k8s.io is well-governed), and you value the flexibility of automatic patch updates, keeping the tag-only reference is a reasonable choice. Just be aware that if the tag is ever republished, your builds will silently use the new artifact.