Skip to content

Commit

Permalink
Improve security context restrictions (#4242)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthchr authored Sep 5, 2024
1 parent b373ec4 commit bc949fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion v2/charts/azure-service-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,18 @@ revisionHistoryLimit: 10

# Specify security settings for a Container
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
# It is not recommended to reduce the restrictions in this list, but additional restrictions outside of the default set
# It is not recommended to reduce the restrictions in this list, but additional restrictions outside the default set
# can be applied. If you believe additional securityContext configuration should be specified by default
# please raise an issue.
securityContext:
runAsUser: 65532 # nonroot user from gcr.io/distroless/static:nonroot image
runAsGroup: 65532 # nonroot group from gcr.io/distroless/static:nonroot image
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL

# Tolerations are applied to pods. Tolerations allow the scheduler to schedule pods with matching taints. Tolerations allow scheduling but don't guarantee scheduling
# For more information, see https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration.
Expand Down
10 changes: 8 additions & 2 deletions v2/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ spec:
matchLabels:
control-plane: controller-manager
replicas: 1
revisionHistoryLimit: 10
template:
metadata:
labels:
aadpodidbinding: aso-manager-binding
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: ${VERSION}
Expand Down Expand Up @@ -72,6 +72,12 @@ spec:
cpu: 200m
memory: 256Mi
securityContext:
readOnlyRootFilesystem: true
runAsUser: 65532 # nonroot user from gcr.io/distroless/static:nonroot image
runAsGroup: 65532 # nonroot group from gcr.io/distroless/static:nonroot image
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
terminationGracePeriodSeconds: 10

0 comments on commit bc949fe

Please sign in to comment.