-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: allow users to opt out of cluster scoped RBAC (#48)
Goldpinger optionally searches for Pods in every namespace, but used to have unconditional cluster scoped RBAC to do so. Combined with the fact that it's role refers to an unrestricted PSP, users should be able to opt out of this cluster scoped binding. This commit does a couple of things: - splits `podsecuritypolicy.yaml` into `role.yaml` and `rolebinding.yaml`, so it's more like its cluster scoped equivalents - make both cluster scoped as namespaced role/-binding optional Signed-off-by: Jorik Jonker <[email protected]>
- Loading branch information
Showing
7 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if or .Values.podSecurityPolicy.enabled (not .Values.rbac.clusterscoped) }} | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "goldpinger.fullname" . }}-pod-security-policy | ||
labels: | ||
{{- include "goldpinger.labels" . | nindent 4 }} | ||
rules: | ||
{{- if not .Values.rbac.clusterscoped }} | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["list"] | ||
{{- end }} | ||
{{- if .Values.podSecurityPolicy.enabled }} | ||
- apiGroups: ["extensions"] | ||
resources: ["podsecuritypolicies"] | ||
resourceNames: [{{ .Values.podSecurityPolicy.policyName | quote }}] | ||
verbs: ["use"] | ||
{{- end }} | ||
{{- end }} |
15 changes: 1 addition & 14 deletions
15
...ldpinger/templates/podsecuritypolicy.yaml → charts/goldpinger/templates/rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ image: | |
|
||
rbac: | ||
create: true | ||
clusterscoped: true | ||
serviceAccount: | ||
create: true | ||
name: | ||
|