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]>
  • Loading branch information
dannyzaken committed May 8, 2024
1 parent 8f4aaa2 commit 45a214b
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 @@ -41,6 +41,9 @@ spec:
key: password
name: noobaa-db
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
ports:
- containerPort: 5432
resources:
Expand All @@ -64,7 +67,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 @@ -4286,7 +4286,7 @@ metadata:
data: {}
`

const Sha256_deploy_internal_pod_agent_yaml = "471be013b7cb20d0e00d6715edea3bf439e7a348f07661716326ca3356e648ee"
const Sha256_deploy_internal_pod_agent_yaml = "a02ebca336c7db9e4b84a13459e30664fd8fd2a8ea238e188685caea52a281fd"

const File_deploy_internal_pod_agent_yaml = `apiVersion: v1
kind: Pod
Expand Down Expand Up @@ -4325,6 +4325,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 @@ -5036,7 +5041,7 @@ spec:
resource: limits.memory
`

const Sha256_deploy_internal_statefulset_postgres_db_yaml = "efd4562dd6ce535624a56426dc921c584c5a761c8c2540d4823f9e410fcd0347"
const Sha256_deploy_internal_statefulset_postgres_db_yaml = "37a6c36928ba426ca04fd89e1eb2685e10d1a5f65c63ebb40c68a4f5c37645de"

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

0 comments on commit 45a214b

Please sign in to comment.