|
| 1 | +{{- if and .Values.rbac.enable (.Capabilities.APIVersions.Has "security.openshift.io/v1") }} |
| 2 | +# SCC for AuthBridge proxy-sidecar containers in agent namespaces. |
| 3 | +# Custom SCC needed because restricted-v2 does not permit CSI volumes |
| 4 | +# (csi.spiffe.io for SPIRE workload API). |
| 5 | +# groups is empty -- the operator creates per-namespace RoleBindings at runtime. |
| 6 | +apiVersion: security.openshift.io/v1 |
| 7 | +kind: SecurityContextConstraints |
| 8 | +metadata: |
| 9 | + name: kagenti-authbridge |
| 10 | + labels: |
| 11 | + {{- include "chart.labels" . | nindent 4 }} |
| 12 | + app.kubernetes.io/component: authbridge |
| 13 | +groups: [] |
| 14 | +allowHostDirVolumePlugin: false |
| 15 | +allowHostIPC: false |
| 16 | +allowHostNetwork: false |
| 17 | +allowHostPID: false |
| 18 | +allowHostPorts: false |
| 19 | +allowPrivilegedContainer: false |
| 20 | +allowPrivilegeEscalation: false |
| 21 | +allowedCapabilities: [] |
| 22 | +defaultAddCapabilities: [] |
| 23 | +requiredDropCapabilities: |
| 24 | + - ALL |
| 25 | +fsGroup: |
| 26 | + type: RunAsAny |
| 27 | +runAsUser: |
| 28 | + type: MustRunAsNonRoot |
| 29 | +seLinuxContext: |
| 30 | + type: MustRunAs |
| 31 | +supplementalGroups: |
| 32 | + type: RunAsAny |
| 33 | +seccompProfiles: |
| 34 | + - runtime/default |
| 35 | +volumes: |
| 36 | + - configMap |
| 37 | + - csi |
| 38 | + - downwardAPI |
| 39 | + - emptyDir |
| 40 | + - ephemeral |
| 41 | + - persistentVolumeClaim |
| 42 | + - projected |
| 43 | + - secret |
| 44 | +--- |
| 45 | +# ClusterRole granting "use" on the kagenti-authbridge SCC. |
| 46 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 47 | +kind: ClusterRole |
| 48 | +metadata: |
| 49 | + name: system:openshift:scc:kagenti-authbridge |
| 50 | + labels: |
| 51 | + {{- include "chart.labels" . | nindent 4 }} |
| 52 | + app.kubernetes.io/component: authbridge |
| 53 | +rules: |
| 54 | + - apiGroups: ["security.openshift.io"] |
| 55 | + resources: ["securitycontextconstraints"] |
| 56 | + resourceNames: ["kagenti-authbridge"] |
| 57 | + verbs: ["use"] |
| 58 | +--- |
| 59 | +# Grants the operator SA "use" on the SCC so it can delegate via RoleBindings. |
| 60 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 61 | +kind: ClusterRoleBinding |
| 62 | +metadata: |
| 63 | + name: kagenti-operator-scc-authbridge |
| 64 | + labels: |
| 65 | + {{- include "chart.labels" . | nindent 4 }} |
| 66 | + app.kubernetes.io/component: authbridge |
| 67 | +roleRef: |
| 68 | + apiGroup: rbac.authorization.k8s.io |
| 69 | + kind: ClusterRole |
| 70 | + name: system:openshift:scc:kagenti-authbridge |
| 71 | +subjects: |
| 72 | + - kind: ServiceAccount |
| 73 | + name: {{ .Values.controllerManager.serviceAccountName }} |
| 74 | + namespace: {{ .Release.Namespace }} |
| 75 | +{{- end -}} |
0 commit comments