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

feat(sec) add securitycontext restrictions #909

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Oct 20, 2023

What this PR does / why we need it:

Updates the container security context defaults with various settings.

Didn't stick the whole thing in the readme since it'd look a bit silly.

Which issue this PR fixes

Part of Kong/kubernetes-ingress-controller#4102

Special notes for your reviewer:

These settings apply the restricted pod security standard. Namespaces with restricted standards enforced will accept chart Pods with these settings in place.

The containerSecurityContext from values.yaml applies to all chart-managed containers equally. We do not support different security contexts for KIC and Kong containers.

The runAsUser setting is set to align with the current proxy image user ID, though I am basing this off partial knowledge of the build process and waiting on gateway team confirmation. The controller currently uses a different UID, but I intend to change that in Kong/kubernetes-ingress-controller#4911.

Basic testing suggested a mismatch between the controller image and runAsUser ID doesn't actually matter, which makes sense--our executable is world-executable and doesn't need to do anything on the filesystem. The Kong image has many more relevant files, though anything it writes all goes in emptydirs.

AFAIK there is no reason we should need any of the restricted capabilities under normal circumstances. As the context settings are part of values.yaml, they can be adjusted if you need to.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • PR is based off the current tip of the main branch.
  • Changes are documented under the "Unreleased" header in CHANGELOG.md
  • New or modified sections of values.yaml are documented in the README.md
  • Commits follow the Kong commit message guidelines

@rainest rainest merged commit 179f76c into main Oct 23, 2023
23 checks passed
@rainest rainest deleted the feat/security-context branch October 23, 2023 08:43
@pmalek
Copy link
Member

pmalek commented Oct 23, 2023

@rainest Did you intend to wait with this for something specific? The HOLD/DO NOT MERGE was still on.

Additionally I believe this deserves a CHANGELOG entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants