Skip to content

Commit

Permalink
Set security context of workloads
Browse files Browse the repository at this point in the history
This commit sets the following security context of all workloads
directly handled by the operator:

```
securityContext:
    privileged: false
    readOnlyRootFilesystem: true
```

this as required by: RHOBS-1001

Signed-off-by: Jacob Baungard Hansen <[email protected]>
  • Loading branch information
jacobbaungard committed Feb 13, 2024
1 parent 02da6b2 commit e372071
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions operators/endpointmetrics/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
- mountPath: /spoke/hub-kubeconfig
name: hub-kubeconfig-secret
readOnly: true
securityContext:
privileged: false
readOnlyRootFilesystem: true
volumes:
- name: hub-kubeconfig-secret
secret:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyFilesystem: true
ports:
- containerPort: 9443
name: webhook-server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ spec:
name: config-volume
- mountPath: /alertmanager
name: alertmanager-db
securityContext:
privileged: false
readOnlyRootFilesystem: false
- args:
- -webhook-url=http://localhost:9093/-/reload
- -volume-dir=/etc/alertmanager/config
Expand All @@ -94,6 +97,9 @@ spec:
- mountPath: /etc/tls/private
name: tls-secret
readOnly: true
securityContext:
privileged: false
readOnlyRootFilesystem: false
- args:
- --provider=openshift
- --https-address=:9095
Expand Down Expand Up @@ -138,6 +144,9 @@ spec:
readOnly: true
- mountPath: /etc/proxy/secrets
name: alertmanager-proxy
securityContext:
privileged: false
readOnlyRootFilesystem: false
serviceAccount: alertmanager
serviceAccountName: alertmanager
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ spec:
name: grafana-datasources
- mountPath: /etc/grafana
name: grafana-config
securityContext:
privileged: false
readOnlyRootFilesystem: true
- name: grafana-dashboard-loader
env:
- name: POD_NAMESPACE
Expand All @@ -75,6 +78,9 @@ spec:
requests:
cpu: 4m
memory: 50Mi
securityContext:
privileged: false
readOnlyRootFilesystem: true
- readinessProbe:
httpGet:
path: /oauth/healthz
Expand Down Expand Up @@ -114,6 +120,9 @@ spec:
- '--scope=user:full'
- '--openshift-ca=/etc/pki/tls/cert.pem'
- '--openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
securityContext:
privileged: false
readOnlyRootFilesystem: true
serviceAccount: grafana
imagePullSecrets:
- name: multiclusterhub-operator-pull-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ spec:
requests:
cpu: 10m
memory: 50Mi
securityContext:
privileged: false
readOnlyRootFilesystem: true
imagePullSecrets:
- name: "{{MULTICLUSTEROBSERVABILITY_IMAGE_PULL_SECRET}}"
serviceAccountName: observatorium
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
requests:
cpu: 20m
memory: 100Mi
securityContext:
privileged: false
readOnlyRootFilesystem: true
- args:
- --provider=openshift
- --https-address=:8443
Expand Down Expand Up @@ -114,6 +117,9 @@ spec:
readOnly: true
- mountPath: /etc/proxy/secrets
name: cookie-secret
securityContext:
privileged: false
readOnlyRootFilesystem: true
serviceAccountName: rbac-query-proxy
imagePullSecrets:
- name: multiclusterhub-operator-pull-secret
Expand Down

0 comments on commit e372071

Please sign in to comment.