Skip to content

Commit

Permalink
Merge pull request #430 from rhmdnd/fix-psa-warnings
Browse files Browse the repository at this point in the history
Harden the deployment and the profilebundle
  • Loading branch information
openshift-merge-bot[bot] authored Nov 8, 2023
2 parents ae5267f + 6206b85 commit a1c7cc7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,11 @@ spec:
memory: 20Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
volumeMounts:
- mountPath: /var/run/secrets/serving-cert
name: serving-cert
Expand Down
3 changes: 3 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]
resources:
requests:
memory: "20Mi"
Expand Down
6 changes: 6 additions & 0 deletions pkg/controller/profilebundle/profilebundle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ func (r *ReconcileProfileBundle) newWorkloadForBundle(pb *compliancev1alpha1.Pro
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: &falseP,
ReadOnlyRootFilesystem: &trueP,
RunAsNonRoot: &trueP,
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
Expand Down Expand Up @@ -466,6 +467,7 @@ func (r *ReconcileProfileBundle) newWorkloadForBundle(pb *compliancev1alpha1.Pro
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: &falseP,
ReadOnlyRootFilesystem: &trueP,
RunAsNonRoot: &trueP,
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
Expand Down Expand Up @@ -502,6 +504,10 @@ func (r *ReconcileProfileBundle) newWorkloadForBundle(pb *compliancev1alpha1.Pro
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: &falseP,
ReadOnlyRootFilesystem: &trueP,
RunAsNonRoot: &trueP,
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
},
Command: []string{
"/bin/sh", "-c",
Expand Down

0 comments on commit a1c7cc7

Please sign in to comment.