-
Notifications
You must be signed in to change notification settings - Fork 604
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
Conform to the Kubernetes restricted pod security standard #2014
Comments
We instruct users how to enforce a restricted pod security policy here: https://fluxcd.io/docs/installation/#pod-security-policy |
That does not align with the recommendation, which is to ship with defaults enabled. |
Yes, shipping a seccomp profile by default is not something that I would consider for Flux. Kubernetes has alpha support for it https://kubernetes.io/blog/2021/08/25/seccomp-default/ |
@stefanprodan the solution above does not cover the registry credentials sync. Setting the Pod Security Policy in a similar way to the other components causes the following error: |
@kingdonb you can assign this one to me. |
I would agree that we don't want to create and maintain a custom seccomp profile at this point in time. However, enabling the default seccomp profile helps decreasing the impact of potential supply chain attacks. Seccomp is a bit of a niche subject, but Kubernetes has two separate features for it: one to "enable seccomp across the cluster" (currently in alpha) and the seccomp support itself (GA at version 1.19). We would rely on the latter to comply with some of the recommendations. The "secure by default" recommendations can be beneficial to the project as a whole, as running in least privileges at all times may help us understand the impact of new features in the security model at earlier stages (i.e. failing tests), and allow us to communicate explicitly as new permission requirements emerge. I will propose an initial PR for the |
@dholbach as part of this we will need to update the documentation around pod security policy. Do you mind adding it here as a check list? Once all changes are applied we will confirm whether we will be able to support |
@pjbgf I have added check lists to the issue. Let me know if it covers all tasks. |
It looks good to me, thank you for updating it. 👍 |
after this change I see:
If I drop the seccomp profile it will schedule just fine. openshift 4.9.x
|
@davidkarlsen see here the OpenShift docs: https://fluxcd.io/docs/use-cases/openshift/#security-context-constraints |
Encountering:
Link for https://fluxcd.io/docs/installation/#pod-security-policy seems dead? |
@oliverbaehler here is the new link https://fluxcd.io/docs/security/#pod-security-standard You can remove the seccomp profile with a patch in apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- gotk-components.yaml
- gotk-sync.yaml
patches:
- target:
kind: Deployment
patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: all
spec:
template:
spec:
containers:
- name: manager
securityContext:
seccompProfile:
$patch: delete |
@oliverbaehler I think your PSP is old, please update it like so: apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: pod-security-policy-restricted-psp
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' In Kubernetes 1.19 |
We should make Flux conform to the Kubernetes restricted pod security standard and update the documentation to reflect this.
Patch the deployment spec for:
From Ada Logics
The text was updated successfully, but these errors were encountered: