Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
psp: Make the restrictive policy as the first on the list
Browse files Browse the repository at this point in the history
The policy order of PSP has two methods of selecting a PSP for
applications:

1. If a PSP allows the pod specification as is without a mutation, then
   that PSP is used.
2. If the above condition fails, then the fist PSP is chosen from an
   allowed-PSP list, and the pod is mutated accordingly.

In Lokomotive's case the general cluster-wide PSP for apps that don't
ship PSP is the minimal restrictive PSP. So we need to ensure that it is
on top of the list for selection not bottom.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
  • Loading branch information
surajssd committed Jan 18, 2021
1 parent 39d4f89 commit 8349564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: zz-minimal
name: aa-minimal
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
Expand Down Expand Up @@ -56,7 +56,7 @@ rules:
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- zz-minimal
- aa-minimal
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/generated_assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8349564

Please sign in to comment.