Skip to content

Commit

Permalink
fix(policy-server): Run the policy server with readonly root
Browse files Browse the repository at this point in the history
Ensure the Policy Server container runs with a readonly root filesystem.
This improves the security of the project.

This partially addresses kubewarden/helm-charts#51

Signed-off-by: Flavio Castelli <[email protected]>
  • Loading branch information
flavio committed Jan 20, 2022
1 parent 3aaa1f4 commit 715f074
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/pkg/admission/policy-server-deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ func (r *Reconciler) deployment(configMapVersion string, policyServer *policiesv
},
)
}
enableReadOnlyFilesystem := true
admissionContainerSecurityContext := corev1.SecurityContext{
ReadOnlyRootFilesystem: &enableReadOnlyFilesystem,
}
admissionContainer.SecurityContext = &admissionContainerSecurityContext

templateAnnotations := policyServer.Spec.Annotations
if templateAnnotations == nil {
Expand Down

0 comments on commit 715f074

Please sign in to comment.