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

feat: add wiz manifests #8679

Open
wants to merge 39 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ec72710
feat: add wiz manifests
Dec 19, 2024
de2a398
feat: update permissions for sensor
Dec 19, 2024
a5b89dc
feat: add wiz manifests
Dec 19, 2024
c307aaf
feat: add wiz manifests
Dec 19, 2024
0cdad7a
Update secrets namespace + cleanup trailing curly brackets
zaklawrencea Dec 19, 2024
500acb7
fix: minor changes
Dec 20, 2024
38944d1
Merge branch 'vthupili' of https://github.com/zalando-incubator/kuber…
Dec 20, 2024
4fda53d
fix: minor changes
Dec 20, 2024
a65b322
enable wiz to exclude from node ready event
Dec 20, 2024
eb25c7f
Fix typos
katyanna Dec 20, 2024
ebb156a
Fix missing }
katyanna Dec 20, 2024
3630e94
Update cluster/manifests/deletions.yaml
demonCoder95 Dec 23, 2024
dfdffc5
Minor fixes
Jan 2, 2025
aa8ddc6
Minor fixes
Jan 3, 2025
38e467d
Minor fixes
Jan 3, 2025
63ca7d7
Merge branch 'dev' into vthupili
Jan 3, 2025
e773b9a
restructure
Jan 3, 2025
9854e09
Merge branch 'dev' into vthupili
Jan 3, 2025
73ce47e
remove imagepull secrets
Jan 3, 2025
a2aef3f
remove imagepull secrets
Jan 3, 2025
9e6fc8b
add limits for broker
Jan 3, 2025
b8f3a59
add limits for broker
Jan 3, 2025
6b0b73e
restructure
Jan 3, 2025
c176b5b
update image Tags
Jan 3, 2025
0dc9cbe
update image Tags
Jan 3, 2025
24babce
minor fix to secret
Jan 6, 2025
a800342
minor
Jan 6, 2025
711cb87
Merge branch 'dev' into vthupili
Jan 6, 2025
2bdfaa1
minor fix secret
Jan 6, 2025
c20f7af
minor
Jan 6, 2025
026d2fe
rename sensor ds file name
Jan 7, 2025
0e919db
add nodeselector to all worker nodes
Jan 7, 2025
fe51b45
update DS tolerations
Jan 7, 2025
02fd3fa
update tolerations
Jan 7, 2025
af52b16
update tolerations
Jan 7, 2025
8967144
Merge branch 'dev' into vthupili
Jan 7, 2025
8770794
reorder the wiz resources in deletions.yaml
Jan 8, 2025
41affbb
update image tags
Jan 9, 2025
b5ec8ec
Merge branch 'dev' into vthupili
Jan 9, 2025
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
5 changes: 5 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1194,3 +1194,8 @@ role_sync_controller_enabled: "true"
{{ else }}
role_sync_controller_enabled: "false"
{{ end }}

#Wiz Configs
wiz_enable_runtime_monitoring_daemonset: "false"
wiz_adapter_cpu: "300m"
wiz_adapter_memory: "300Mi"
56 changes: 56 additions & 0 deletions cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,59 @@ post_apply:
- name: kube-janitor
kind: ClusterRoleBinding
{{- end }}
{{- if ne .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true" }}
- name: wiz-sensor
kind: ServiceAccount
namespace: wiz
- name: wiz-sensor-apikey
kind: Secret
namespace: wiz
# - name: wiz-sensor-imagepullkey
# kind : Secret
# namespace: wiz
- name: wiz-sensor
kind : DaemonSet
namespace: wiz
- name: wiz-sensor
kind : ClusterRole
namespace: wiz
- name: wiz-sensor
kind : ClusterRoleBinding
namespace: wiz
- name: wiz-broker
kind : ServiceAccount
namespace: wiz
- name: wiz-cluster-reader
kind : ServiceAccount
namespace: wiz
- name: wiz-auto-modify-connector
kind : ServiceAccount
namespace: wiz
- name: wiz-connector-connector
kind : Secret
namespace: wiz
- name: wiz-cluster-reader-token
kind : Secret
namespace: wiz
- name: wiz-api-token
kind : Secret
namespace: wiz
- name: wiz-auto-modify-connector
kind : Role
namespace: wiz
- name: wiz-auto-modify-connector
kind : RoleBinding
namespace: wiz
- name: wiz-kubernetes-connector-create-connector
kind : Job
namespace: wiz
- name: wiz-kubernetes-connector-delete-connector
kind : Job
namespace: wiz
- name: wiz-connector-agent
kind : Deployment
namespace: wiz
- name: wiz-cluster-reader
kind : ClusterRoleBinding
namespace: wiz
{{- end }}
4 changes: 4 additions & 0 deletions cluster/manifests/wiz/001-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: wiz
35 changes: 35 additions & 0 deletions cluster/manifests/wiz/002-connector-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/charts/wiz-broker/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: wiz-broker
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-cluster-reader.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: wiz-cluster-reader
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-modify-connector.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: wiz-auto-modify-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
{{end}}
13 changes: 13 additions & 0 deletions cluster/manifests/wiz/002-sensor-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-sensor/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: wiz-sensor
namespace: wiz
labels:
helm.sh/chart: wiz-sensor-1.0.4760
application: "wiz"
component: "connector"
{{end}}
20 changes: 20 additions & 0 deletions cluster/manifests/wiz/003-connector-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-cluster-reader.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: wiz-cluster-reader
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: readonly # readonly role created by default in out kubernetes environment
subjects:
- kind: ServiceAccount
name: wiz-cluster-reader
namespace: "wiz"
{{end}}
43 changes: 43 additions & 0 deletions cluster/manifests/wiz/003-connector-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-modify-connector.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: wiz-auto-modify-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
rules:
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["wiz-connector-connector"]
verbs: ["update", "get"]
- apiGroups: [""]
resources: ["secrets"]
resourceNames:
- "wiz-api-token"
- "wiz-cluster-reader-token"
verbs: ["get"]
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-modify-connector.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: wiz-auto-modify-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: wiz-auto-modify-connector
subjects:
- kind: ServiceAccount
name: wiz-auto-modify-connector
namespace: "wiz"
{{end}}
42 changes: 42 additions & 0 deletions cluster/manifests/wiz/003-sensor-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-sensor/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: wiz-sensor
labels:
helm.sh/chart: wiz-sensor-1.0.4760
application: "wiz"
component: "sensor"
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "nodes", "replicationcontrollers", "serviceaccounts"]
verbs: ["get", "list", "watch"]

- apiGroups: ["apps"]
resources: ["daemonsets", "replicasets", "deployments", "statefulsets"]
verbs: ["get", "list", "watch"]

- apiGroups: ["batch"]
resources: ["cronjobs"]
verbs: ["get", "list", "watch"]
---
# Source: wiz-sensor/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: wiz-sensor
labels:
helm.sh/chart: wiz-sensor-1.0.4760
application: "wiz"
component: "sensor"
subjects:
- kind: ServiceAccount
name: wiz-sensor
namespace: wiz
roleRef:
kind: ClusterRole
name: wiz-sensor
apiGroup: rbac.authorization.k8s.io
{{end}}
45 changes: 45 additions & 0 deletions cluster/manifests/wiz/004-connector-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/secret-connector.yaml
apiVersion: v1
kind: Secret
metadata:
name: wiz-connector-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
type: Opaque
data:
connectorData: "e30="
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/service-account-cluster-reader.yaml
apiVersion: v1
kind: Secret
metadata:
name: wiz-cluster-reader-token
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
annotations:
kubernetes.io/service-account.name: wiz-cluster-reader
type: kubernetes.io/service-account-token
---
# Source: wiz-sensor/templates/apikeysecret.yaml
apiVersion: v1
kind: Secret
metadata:
name: wiz-api-token
namespace: wiz
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
type: Opaque
data:
clientId: "{{ .Cluster.ConfigItems.wiz_api_client_id | base64 }}"
clientToken: "{{ .Cluster.ConfigItems.wiz_api_client_token | base64 }}"
{{end}}
31 changes: 31 additions & 0 deletions cluster/manifests/wiz/004-sensor-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-sensor/templates/apikeysecret.yaml
apiVersion: v1
kind: Secret
metadata:
name: wiz-sensor-apikey
namespace: wiz
labels:
helm.sh/chart: wiz-sensor-1.0.4760
application: "wiz"
component: "connector"
type: Opaque
data:
clientId: "{{ .Cluster.ConfigItems.wiz_api_client_id | base64 }}"
clientToken: "{{ .Cluster.ConfigItems.wiz_api_client_token | base64 }}"
# ---
# # Source: wiz-sensor/templates/imagepullsecret.yaml
# apiVersion: v1
# kind: Secret
# type: kubernetes.io/dockerconfigjson
# metadata:
# name: wiz-sensor-imagepullkey
# labels:
# helm.sh/chart: wiz-sensor-1.0.4760
# application: "wiz"
# component: "sensor"
# namespace: wiz
# data:
# .dockerconfigjson: "{{ .Cluster.ConfigItems.wiz_sensor_dockerconfigjson }}"
{{end}}
77 changes: 77 additions & 0 deletions cluster/manifests/wiz/connector-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/charts/wiz-broker/templates/wiz-broker-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: wiz-connector-agent
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
spec:
replicas: 1
selector:
matchLabels:
application: "wiz"
component: "connector"
template:
metadata:
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
spec:
serviceAccountName: wiz-broker
securityContext:
runAsNonRoot: true
runAsUser: 1000
volumes:
- name: connector-data
secret:
secretName: wiz-connector-connector
items:
- key: connectorData
path: data
containers:
- name: wiz-broker
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
image: "container-registry-test.zalando.net/secops-systems/wiz-broker:2.5-pr-1-4"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: connector-data
mountPath: /etc/connectorData
readOnly: true
args:
- /etc/connectorData/data
env:
- name: LOG_LEVEL
value: info
- name: WIZ_ENV
value:
- name: WIZ_CLIENT_ID
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientId
- name: WIZ_CLIENT_TOKEN
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientToken
- name: TARGET_IP
value: kubernetes.default.svc.cluster.local
- name: TARGET_PORT
value: "443"
resources:
limits:
cpu: {{ .Cluster.ConfigItems.wiz_adapter_cpu }}
memory: {{ .Cluster.ConfigItems.wiz_adapter_memory }}
requests:
cpu: {{ .Cluster.ConfigItems.wiz_adapter_cpu }}
memory: {{ .Cluster.ConfigItems.wiz_adapter_memory }}
{{end}}
Loading