Skip to content

fix: Fix pipeline error by removing root privilege for client-registration - #100

Merged
mrsabath merged 7 commits into
rossoctl:mainfrom
mrsabath:switch-to-non-root
Feb 6, 2026
Merged

mrsabath merged 7 commits into
rossoctl:mainfrom
mrsabath:switch-to-non-root

Conversation

@mrsabath

@mrsabath mrsabath commented Feb 6, 2026

Copy link
Copy Markdown
Member

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

  1. Dockerfile (AuthBridge/client-registration/Dockerfile)
    Added a non-root user appuser with UID/GID 1000
    Added USER 1000:1000 directive to run as non-root
  2. Webhook Injection (kagenti-webhook/internal/webhook/injector/container_builder.go)
    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
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test addition or update
  • CI/CD update

How Has This Been Tested?

  • Test A
  • Test B

Test Configuration:

  • Kubernetes version:
  • Toolhive webhook version:
  • OS:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if appropriate)

Additional Notes

@mrsabath
mrsabath marked this pull request as ready for review February 6, 2026 15:58
Copilot AI review requested due to automatic review settings February 6, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
Copilot AI review requested due to automatic review settings February 6, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 6, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copilot AI review requested due to automatic review settings February 6, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mrsabath
mrsabath merged commit c77cefc into rossoctl:main Feb 6, 2026
4 checks passed
@mrsabath
mrsabath deleted the switch-to-non-root branch February 6, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants