Skip to content

Commit

Permalink
Restrict tigera-operator secret access to namespace only, retain get/…
Browse files Browse the repository at this point in the history
…list/watch cluster-wide
  • Loading branch information
vara2504 committed Dec 5, 2024
1 parent 35aca22 commit f09666d
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Permissions required to manipulate operator secrets for a Calico cluster.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tigera-operator-secrets
labels:
{{- include "tigera-operator.labels" (dict "context" .) | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- update
- delete
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ rules:
- endpoints
- events
- configmaps
- secrets
- serviceaccounts
verbs:
- create
Expand All @@ -72,6 +71,7 @@ rules:
- ""
resources:
- resourcequotas
- secrets
verbs:
- list
- get
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tigera-operator-secrets
namespace: {{.Release.Namespace}}
labels:
{{- include "tigera-operator.labels" (dict "context" .) | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{.Release.Namespace}}
namespace: {{.Release.Namespace}}
roleRef:
kind: ClusterRole
name: tigera-operator-secrets
apiGroup: rbac.authorization.k8s.io
16 changes: 16 additions & 0 deletions manifests/ocp/02-role-tigera-operator-secrets.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion manifests/ocp/02-role-tigera-operator.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions manifests/ocp/02-rolebinding-tigera-operator-secrets.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 36 additions & 1 deletion manifests/tigera-operator.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f09666d

Please sign in to comment.