Repository navigation
fix: Fix pipeline error by removing root privilege for client-registration - #100
Conversation
Signed-off-by: Mariusz Sabath <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR enhances security by configuring the client-registration container to run as a non-root user (UID/GID 1000), addressing pipeline errors related to pod security policies that enforce non-root execution. The changes implement defense-in-depth by modifying both the container image itself and the Kubernetes deployment configuration.
Changes:
- Added non-root user (UID 1000) to the client-registration Dockerfile with explicit USER directive
- Added SecurityContext to the injected client-registration container specifying RunAsUser, RunAsGroup, and RunAsNonRoot settings
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AuthBridge/client-registration/Dockerfile | Creates appuser (UID/GID 1000) and switches to non-root execution before running the Python application |
| kagenti-webhook/internal/webhook/injector/container_builder.go | Adds SecurityContext with non-root settings (UID 1000) to ensure Kubernetes enforces non-root execution policy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mariusz Sabath <[email protected]> Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mariusz Sabath <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mariusz Sabath <[email protected]> Co-authored-by: Copilot <[email protected]>
…ct description Signed-off-by: Mariusz Sabath <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nsions into switch-to-non-root
Description
Client-registration must have privilages lowered.
Fixes # (issue)
The Dockerfile fix is the proper security fix, while the webhook fix ensures compatibility regardless of image configuration.
Type of Change
Changes Made
Added a non-root user appuser with UID/GID 1000
Added USER 1000:1000 directive to run as non-root
Added SecurityContext to the client-registration container with:
RunAsUser: 1000
RunAsGroup: 1000
RunAsNonRoot: true
This provides defense-in-depth:
The Dockerfile fix ensures the image itself runs as non-root
The webhook fix ensures the injected container explicitly declares its security context, making it compatible with pods that have runAsNonRoot: true in their pod security context
How Has This Been Tested?
Test Configuration:
Checklist
Screenshots (if appropriate)
Additional Notes