Skip to content

Commit

Permalink
Security context changes
Browse files Browse the repository at this point in the history
* Added fsGroup 0 to the agent pod
* moved allowPrivilegeEscalation in the DB sts to the container security
  context

Signed-off-by: Danny Zaken <[email protected]>
(cherry picked from commit 45a214b)
  • Loading branch information
dannyzaken authored and tangledbytes committed May 8, 2024
1 parent 9838c75 commit ad93b4d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions deploy/internal/pod-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ spec:
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
securityContext:
runAsUser: 10001
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
volumes:
- name: tmp-logs-vol
emptyDir: {}
Expand Down
4 changes: 3 additions & 1 deletion deploy/internal/statefulset-postgres-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
key: password
name: noobaa-db
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
ports:
- containerPort: 5432
resources:
Expand Down Expand Up @@ -109,7 +112,6 @@ spec:
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
allowPrivilegeEscalation: false
volumeClaimTemplates:
- metadata:
name: db
Expand Down
13 changes: 10 additions & 3 deletions pkg/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4221,7 +4221,7 @@ spec:
value: KUBERNETES
restartPolicy: OnFailure`

const Sha256_deploy_internal_pod_agent_yaml = "0f58d0ef2d3ffce46680db6c44878cfdcdcf0942867d27768cb0636891157e2e"
const Sha256_deploy_internal_pod_agent_yaml = "de840ba1da0fc16cab8e1ddf8af35f886be35dbefa449e73dcf75b5659001aa1"

const File_deploy_internal_pod_agent_yaml = `apiVersion: v1
kind: Pod
Expand Down Expand Up @@ -4260,6 +4260,11 @@ spec:
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
securityContext:
runAsUser: 10001
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
volumes:
- name: tmp-logs-vol
emptyDir: {}
Expand Down Expand Up @@ -5011,7 +5016,7 @@ spec:
storage: 50Gi
`

const Sha256_deploy_internal_statefulset_postgres_db_yaml = "3a83f8f0cea0d0b909834afb3de3009ed9e1e7347d82c31fc65cc8e5016b247b"
const Sha256_deploy_internal_statefulset_postgres_db_yaml = "ea7ea63d019cb84327e89fbfa6a34788e0f43726ae8b2446eb1801e2a50240e1"

const File_deploy_internal_statefulset_postgres_db_yaml = `apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -5096,6 +5101,9 @@ spec:
key: password
name: noobaa-db
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
ports:
- containerPort: 5432
resources:
Expand Down Expand Up @@ -5124,7 +5132,6 @@ spec:
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
allowPrivilegeEscalation: false
volumeClaimTemplates:
- metadata:
name: db
Expand Down

0 comments on commit ad93b4d

Please sign in to comment.