Skip to content

pss: Make compliant with restricted pss by default#1874

Open
marcofranssen wants to merge 1 commit into
kagent-dev:mainfrom
marcofranssen:fix-pss-compliant-restricted
Open

pss: Make compliant with restricted pss by default#1874
marcofranssen wants to merge 1 commit into
kagent-dev:mainfrom
marcofranssen:fix-pss-compliant-restricted

Conversation

@marcofranssen
Copy link
Copy Markdown
Contributor

To ensure security configured the securityContexts to be complianted with the restricted PSS.

This way a user can annotate the namespace as restricted without having to finetune the deployments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Helm chart’s default podSecurityContext/securityContext values so kagent deployments are compliant with Kubernetes Pod Security Standards (PSS) restricted by default, allowing users to label namespaces as restricted without additional tuning.

Changes:

  • Set podSecurityContext.seccompProfile to RuntimeDefault.
  • Harden default container securityContext by disabling privilege escalation, dropping all Linux capabilities, and setting seccompProfile to RuntimeDefault.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helm/kagent/values.yaml Outdated
Comment thread helm/kagent/values.yaml
@marcofranssen marcofranssen force-pushed the fix-pss-compliant-restricted branch 7 times, most recently from beb465d to 896811a Compare May 16, 2026 11:50
@marcofranssen
Copy link
Copy Markdown
Contributor Author

Added tests to cover for podSecurityContext and extended setting the right context for grafana-mcp and querydoc workloads. This way the entire chart is deployable in a restricted namespace by default and ensure the most stric security settings out of the box.

@marcofranssen marcofranssen force-pushed the fix-pss-compliant-restricted branch from 896811a to 1535b7a Compare May 18, 2026 17:04
Copy link
Copy Markdown
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

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

I agree overall with ensuring stricter security by default, but it looks like the e2e tests are failing for some reason.

Also, I'm curious how these new security policies will interact with skills sandboxes

- equal:
path: spec.template.spec.containers[0].securityContext.seccompProfile.type
value: RuntimeDefault
- isNull:
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.

Why was this changed?

Copy link
Copy Markdown
Contributor Author

@marcofranssen marcofranssen May 19, 2026

Choose a reason for hiding this comment

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

because it is set at the entire Pod level, which applies it already to all containers in that pod. meaning it would not show up as a separate container context setting.

@marcofranssen
Copy link
Copy Markdown
Contributor Author

marcofranssen commented May 19, 2026

I agree overall with ensuring stricter security by default, but it looks like the e2e tests are failing for some reason.

Also, I'm curious how these new security policies will interact with skills sandboxes

I guess not affected at all. I mean, even a skill sandbox shouldn't need any OS specific access. Which is basically what this security context guards against. even a skill sandbox you would want it to run in the container, not give it root access on the node, or give it specific net capabilities or things like that. securityCOntext safeguards us from escalating privileges on the node level.

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
@marcofranssen marcofranssen force-pushed the fix-pss-compliant-restricted branch from 1535b7a to ba7b266 Compare May 19, 2026 16:11
@marcofranssen
Copy link
Copy Markdown
Contributor Author

marcofranssen commented May 19, 2026

@EItanya I fixed the CI part.

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