Run runtime images as non-root for Kubernetes compatibility#111
Open
sammcgeown wants to merge 2 commits into
Open
Run runtime images as non-root for Kubernetes compatibility#111sammcgeown wants to merge 2 commits into
sammcgeown wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the container runtime configuration by running the dev and release-default Docker image stages as a non-root user (UID/GID 65532) to better align with Kubernetes runAsNonRoot policies.
Changes:
- Set
USER 65532:65532in thedev(scratch) runtime stage. - Set
USER 65532:65532in therelease-default(scratch) runtime stage. - Added a changelog entry describing the non-root runtime change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Dockerfile | Runs scratch-based runtime stages as UID/GID 65532 for Kubernetes non-root compatibility. |
| CHANGELOG.md | Notes the runtime image change (currently added at the top of the file). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
40
to
45
| COPY --from=devbuild /build/vault-mcp-server . | ||
| COPY --from=certbuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
| # Run as a non-root user for Kubernetes compatibility. | ||
| USER 65532:65532 | ||
| # Command to run the server | ||
| CMD ["./vault-mcp-server", "stdio"] |
Comment on lines
66
to
70
| COPY dist/$TARGETOS/$TARGETARCH/$BIN_NAME /bin/vault-mcp-server | ||
| COPY --from=certbuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
| # Run as a non-root user for Kubernetes compatibility. | ||
| USER 65532:65532 | ||
| CMD ["/bin/vault-mcp-server", "stdio"] |
| @@ -1,3 +1,6 @@ | |||
|
|
|||
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.
Problem: runtime images execute as root by default, which can conflict with Kubernetes best practice and runAsNonRoot policies
Change: set USER 65532:65532 in both runnable stages (dev and release-default) in [Dockerfile]
Impact: security hardening only; command behavior remains unchanged.
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.
If you have any questions, please contact your direct supervisor, GRC (#team-grc), or the PCI working group (#proj-pci-reboot). You can also find more information at PCI Compliance.