Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for least privileged cluster reader role and PSS restricted pods #145

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,79 @@ metadata:
labels:
{{- include "wiz-kubernetes-connector.labels" . | nindent 4 }}
rules:
{{- if .Values.clusterReader.installLeastPrivileged }}
## Install least privileged (no secrets access) reader permissions
- apiGroups: ["*"]
resources: [
"customresourcedefinitions",
"nodes",
"pods",
"services",
"ingresses",
"endpoints",
"roles",
"rolebindings",
"clusterroles",
"clusterrolebindings",
"ingressclasses",
"replicasets",
"daemonsets",
"statefulsets",
"deployments",
"serviceaccounts",
"namespaces",
"configmaps",
"jobs",
"cronjobs",
"networkpolicies",
"controllerrevisions",
"podsecuritypolicies",
"persistentvolumes",
"persistentvolumeclaims",
"storageclasses",
"dtabs",
"tokenreviews",
"events",
"endpointslices",
"iamusergroups",
"iamidentitymappings",
"iamidentitymappings/status",
"subjectaccessreviews",
"poddisruptionbudgets",
"validatingwebhookconfigurations",
"mutatingwebhookconfigurations",
"volumesnapshots",
"csinodes",
"csidrivers",
"volumeattachments",
"csistoragecapacities",
"volumesnapshotcontents",
"volumesnapshotclassnames",
"leases"
]
verbs: ["get","list","watch"]
- apiGroups: [
"networking.istio.io",
"authentication.istio.io",
"rbac.istio.io",
"config.istio.io",
"security.istio.io",
"linkerd.io",
"policy.linkerd.io",
"crd.projectcalico.org",
"apiregistration.k8s.io",
"cluster.k8s.io",
"k8s.nginx.org",
"cis.f5.com"
]
resources: ["*"]
verbs: ["get", "list", "watch"]
{{- else -}}
## Else install broad readonly access
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "list", "watch"]
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
12 changes: 12 additions & 0 deletions wiz-kubernetes-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ image:

clusterReader:
installRbac: true
installLeastPrivileged: true # No access to read secrets
serviceAccount:
create: true
# Annotations to add to the service account
Expand Down Expand Up @@ -104,14 +105,25 @@ broker:

podAnnotations: {}

# Pod - Adhere to PSS restricted
podSecurityContext:
runAsNonRoot: true
runAsUser: 1000
seccompProfile:
type: RuntimeDefault

# Container - Adhere to PSS restricted
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- all
seccompProfile:
type: RuntimeDefault

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down