Skip to content

Commit

Permalink
SCC fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Utkarsh Srivastava <[email protected]>

include pod agent change

Signed-off-by: Utkarsh Srivastava <[email protected]>

make gen-api

Signed-off-by: Utkarsh Srivastava <[email protected]>
  • Loading branch information
tangledbytes committed Apr 15, 2024
1 parent 4bf91c8 commit 53c7ba2
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 9 deletions.
3 changes: 3 additions & 0 deletions deploy/internal/pod-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
mountPath: /noobaa_storage
- name: tmp-logs-vol
mountPath: /usr/local/noobaa/logs
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
volumes:
- name: tmp-logs-vol
emptyDir: {}
Expand Down
3 changes: 3 additions & 0 deletions deploy/internal/statefulset-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ spec:
valueFrom:
resourceFieldRef:
resource: limits.memory
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
- name: noobaa-log-processor
image: NOOBAA_CORE_IMAGE
command:
Expand Down
1 change: 1 addition & 0 deletions deploy/internal/statefulset-postgres-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ spec:
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
allowPrivilegeEscalation: false
volumeClaimTemplates:
- metadata:
name: db
Expand Down
9 changes: 9 additions & 0 deletions deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ kind: Role
metadata:
name: noobaa
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- noobaa
resources:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- noobaa.io
resources:
Expand Down Expand Up @@ -132,3 +140,4 @@ rules:
- '*'
verbs:
- '*'

13 changes: 13 additions & 0 deletions deploy/scc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: noobaa
requiredDropCapabilities:
- ALL
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
supplementalGroups:
type: RunAsAny
readOnlyRootFilesystem: true
5 changes: 5 additions & 0 deletions deploy/scc_db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ allowHostPID: false
allowHostPorts: false
allowPrivilegedContainer: false
readOnlyRootFilesystem: false
allowedCapabilities:
- SETUID
- SETGID
requiredDropCapabilities:
- ALL
fsGroup:
type: RunAsAny
runAsUser:
Expand Down
3 changes: 1 addition & 2 deletions deploy/scc_endpoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ groups: []
priority: null
readOnlyRootFilesystem: false
requiredDropCapabilities:
- KILL
- MKNOD
- ALL
runAsUser:
type: RunAsAny
seLinuxContext:
Expand Down
51 changes: 44 additions & 7 deletions pkg/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4279,6 +4279,9 @@ spec:
mountPath: /noobaa_storage
- name: tmp-logs-vol
mountPath: /usr/local/noobaa/logs
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
volumes:
- name: tmp-logs-vol
emptyDir: {}
Expand Down Expand Up @@ -4806,7 +4809,7 @@ spec:
noobaa-s3-svc: "true"
`

const Sha256_deploy_internal_statefulset_core_yaml = "56bc0da847d71be17138025a208dbf8dc0b02e6f4817bbbac4ce828429d86c26"
const Sha256_deploy_internal_statefulset_core_yaml = "9e5d53eeabce0afc9f3059802f579dc1b69e07c9b1954a8e9bdb9008ac3534d0"

const File_deploy_internal_statefulset_core_yaml = `apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -4949,6 +4952,9 @@ spec:
valueFrom:
resourceFieldRef:
resource: limits.memory
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
- name: noobaa-log-processor
image: NOOBAA_CORE_IMAGE
command:
Expand Down Expand Up @@ -4987,7 +4993,7 @@ spec:
resource: limits.memory
`

const Sha256_deploy_internal_statefulset_postgres_db_yaml = "947307ea1e93ce5b7789bd16352eb7848e1483cd36e7fc489d9ee156e4e7d8bd"
const Sha256_deploy_internal_statefulset_postgres_db_yaml = "efd4562dd6ce535624a56426dc921c584c5a761c8c2540d4823f9e410fcd0347"

const File_deploy_internal_statefulset_postgres_db_yaml = `apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -5055,6 +5061,7 @@ spec:
runAsGroup: 0
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
allowPrivilegeEscalation: false
volumeClaimTemplates:
- metadata:
name: db
Expand Down Expand Up @@ -5959,13 +5966,21 @@ spec:
# name: socket
`

const Sha256_deploy_role_yaml = "ce3cbcb74a9309158d7cf71ef38e747fe76c1bc0fb0f15d3e5404a746ce988e1"
const Sha256_deploy_role_yaml = "7738cea71cb4fdb56055d3e3bb6033de9f5e0758c8423306ef6e27aceca15f71"

const File_deploy_role_yaml = `apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: noobaa
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- noobaa
resources:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- noobaa.io
resources:
Expand Down Expand Up @@ -6095,6 +6110,7 @@ rules:
- '*'
verbs:
- '*'
`

const Sha256_deploy_role_binding_yaml = "59a2627156ed3db9cd1a4d9c47e8c1044279c65e84d79c525e51274329cb16ff"
Expand Down Expand Up @@ -6340,7 +6356,24 @@ rules:
- bucketclasses
`

const Sha256_deploy_scc_db_yaml = "747ebcab94f3f3d42037016f30fa82df085ee5a0a405cbee61e8fdfdfcfc37b0"
const Sha256_deploy_scc_yaml = "baa4d3a3def2d63a5d9e53bc4fc1ac961f9b4fe5172db7118d1529caa14e2191"

const File_deploy_scc_yaml = `apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: noobaa
requiredDropCapabilities:
- ALL
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
supplementalGroups:
type: RunAsAny
readOnlyRootFilesystem: true
`

const Sha256_deploy_scc_db_yaml = "af4d7f9119c7ef0902d424da530bb3dd3c21c440c7267956d4f5304355b68441"

const File_deploy_scc_db_yaml = `apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
Expand All @@ -6354,6 +6387,11 @@ allowHostPID: false
allowHostPorts: false
allowPrivilegedContainer: false
readOnlyRootFilesystem: false
allowedCapabilities:
- SETUID
- SETGID
requiredDropCapabilities:
- ALL
fsGroup:
type: RunAsAny
runAsUser:
Expand All @@ -6364,7 +6402,7 @@ supplementalGroups:
type: RunAsAny
`

const Sha256_deploy_scc_endpoint_yaml = "f097a29eb11230a7612ab5f86894da523a743093e21eb2217a39332c5a31b10c"
const Sha256_deploy_scc_endpoint_yaml = "f9407c9f1fd1876eabbaad4cf910a05e57db33a2d590b2e2efad22bd1e3f8876"

const File_deploy_scc_endpoint_yaml = `apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
Expand All @@ -6387,8 +6425,7 @@ groups: []
priority: null
readOnlyRootFilesystem: false
requiredDropCapabilities:
- KILL
- MKNOD
- ALL
runAsUser:
type: RunAsAny
seLinuxContext:
Expand Down

0 comments on commit 53c7ba2

Please sign in to comment.