Skip to content
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

Allow to run with restricted pod security standards #2072

Merged
merged 9 commits into from
Apr 19, 2024
Merged

Conversation

ramondeklein
Copy link
Contributor

@ramondeklein ramondeklein commented Apr 17, 2024

It's possible to enforce pod security standards by either adding labels or by configuring the built-in admission controller. There are three modes available: privileged (default), baseline and restricted. It looks like both the operator and tenants work in restricted mode, but it requires that all containerSecurityContext values need the following settings:

allowPrivilegeEscalation: false
capabilities:
  drop:
    - ALL
seccompProfile:
  type: RuntimeDefault

This setting can be found in the following places:

This PR adds these values to the Helm charts values.yaml files to ensure that the deployment/stateful-set is also allowed when pod security is set to restricted.

The console is also updated to ensure that it also deploys tenant resources with these values set. All CI/CD tests are updated so they run with the operator namespace in restricted mode.

@ramondeklein ramondeklein self-assigned this Apr 17, 2024
@ramondeklein ramondeklein changed the title Allow to run with restricted pod security standards (Helm charts only) Allow to run with restricted pod security standards (Helm only) Apr 17, 2024
pjuarezd
pjuarezd previously approved these changes Apr 17, 2024
pjuarezd
pjuarezd previously approved these changes Apr 17, 2024
cniackz
cniackz previously approved these changes Apr 17, 2024
Copy link
Contributor

@cniackz cniackz left a comment

Choose a reason for hiding this comment

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

I have tested the changes, and I can deploy tenants and place objects with these values. This modification appears promising to me, especially when the pod-security.kubernetes.io/enforce=restricted label is utilized in the namespace.

@cniackz
Copy link
Contributor

cniackz commented Apr 17, 2024

If the decommissioning test fails, I believe we can disregard this failure as it is not relevant. However, the improvements needed for the test itself should be addressed in a new PR.

@ramondeklein ramondeklein dismissed stale reviews from cniackz and pjuarezd via 1202e37 April 18, 2024 10:17
pjuarezd
pjuarezd previously approved these changes Apr 18, 2024
cniackz
cniackz previously approved these changes Apr 18, 2024
@cniackz
Copy link
Contributor

cniackz commented Apr 18, 2024

@ramondeklein approved but let's resolve conflicts

@ramondeklein ramondeklein dismissed stale reviews from cniackz and pjuarezd via 662b5a4 April 19, 2024 08:22
@ramondeklein ramondeklein changed the title Allow to run with restricted pod security standards (Helm only) Allow to run with restricted pod security standards Apr 19, 2024
@cniackz
Copy link
Contributor

cniackz commented Apr 19, 2024

Great, currently reviewing and testing!

cniackz
cniackz previously approved these changes Apr 19, 2024
Copy link
Contributor

@cniackz cniackz left a comment

Choose a reason for hiding this comment

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

All good, just a minor change requested. And thank you for adding the test in the Helm chart.

resources/base/namespace.yaml Outdated Show resolved Hide resolved
@ramondeklein
Copy link
Contributor Author

All good, just a minor change requested. And thank you for adding the test in the Helm chart.

Added newline, so review became stale...

@cniackz cniackz merged commit ae6c279 into master Apr 19, 2024
25 checks passed
@cniackz cniackz deleted the allow-restricted branch April 19, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants