Skip to content

Commit

Permalink
change to using extraRules
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmosco committed Oct 16, 2024
1 parent 0894f4b commit 4ac10b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ The cluster contains several default security context constraints (SCCs). The av

Example:


```yaml
role:
create: true

scc:
resourceNames:
- privileged
- hostnetwork
extraRoles:
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["anyuid"]
verbs: ["use"]
```
For a more comprehensive overview, see the official SCC documentation: [OpenShift SCCs](https://docs.openshift.com/container-platform/4.16/authentication/managing-security-context-constraints.html)
Expand Down
17 changes: 10 additions & 7 deletions charts/localstack/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get", "list"]
{{- if .Values.scc }}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames:
{{- range .Values.scc.resourceNames }}
- {{ . | quote }}
verbs: ["use"]
{{- if .Values.role.extraRoles }}
{{- range .Values.role.extraRoles }}
- apiGroups: {{ toJson .apiGroups | nindent 2 }}
resources: {{ toJson .resources | nindent 2 }}
{{- if .resourceNames }}
resourceNames: {{ toJson .resourceNames | nindent 2 }}
{{- end }}
verbs: {{ toJson .verbs | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}

7 changes: 0 additions & 7 deletions charts/localstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ role:
# If not set and create is true, a name is generated using the fullname template
name: ""

## OpenShift Security Context Constraints. When set to 'true' it will add SecurityContextConstraings (SCC)
## to the role
scc:
resourceNames:
- anyuid
- nonroot

podLabels: {}

podAnnotations: {}
Expand Down

0 comments on commit 4ac10b9

Please sign in to comment.