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 14 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
20 changes: 20 additions & 0 deletions cluster/manifests/wiz/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}}
72 changes: 72 additions & 0 deletions cluster/manifests/wiz/connector/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{ 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:latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest tag will not work in production. So, we definitely need to fix this to the latest build version before merging. It's fine for testing.

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:
demonCoder95 marked this conversation as resolved.
Show resolved Hide resolved
- 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:
null
{{end}}
145 changes: 145 additions & 0 deletions cluster/manifests/wiz/connector/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{{ if eq .Cluster.ConfigItems.wiz_enable_runtime_monitoring_daemonset "true"}}
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/job-create-connector.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: wiz-kubernetes-connector-create-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
spec:
ttlSecondsAfterFinished: 60
manualSelector: true
selector:
matchLabels:
application: "wiz"
component: "connector"
backoffLimit: 1
template:
metadata:
labels:
helm.sh/chart: wiz-kubernetes-connector-3.1.1
app.kubernetes.io/name: wiz-kubernetes-connector
app.kubernetes.io/instance: wiz-connector
app.kubernetes.io/version: "2.5"
app.kubernetes.io/managed-by: Helm
demonCoder95 marked this conversation as resolved.
Show resolved Hide resolved
spec:
serviceAccountName: wiz-auto-modify-connector
restartPolicy: "Never"
securityContext:
runAsNonRoot: true
runAsUser: 1000
containers:
- name: wiz-connector-creator
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
image: "container-registry-test.zalando.net/secops-systems/wiz-broker:latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to use the latest build instead of latest before merging.

imagePullPolicy: IfNotPresent
command:
- "wiz-broker"
args:
- create-kubernetes-connector
- --api-server-endpoint
- "https://kubernetes.default.svc.cluster.local"
- --secrets-namespace
- "wiz"
- --service-account-token-secret-name
- "wiz-cluster-reader-token"
- --output-secret-name
- "wiz-connector-connector"
- --is-on-prem=true
- --service-type
- "Kubernetes"
- --wait=true
env:
- name: LOG_LEVEL
value: info
- name: WIZ_CLIENT_ID
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientId
optional: false
- name: WIZ_CLIENT_TOKEN
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientToken
optional: false
- name: WIZ_ENV
value:
resources:
null
---
# Source: wiz-kubernetes-integration/charts/wiz-kubernetes-connector/templates/job-delete-connector.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: wiz-kubernetes-connector-delete-connector
namespace: "wiz"
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
spec:
ttlSecondsAfterFinished: 60
manualSelector: true
selector:
matchLabels:
application: "wiz"
component: "connector"
backoffLimit: 1
template:
metadata:
labels:
helm.sh/chart: wiz-broker-2.1.0
application: "wiz"
component: "connector"
spec:
serviceAccountName: wiz-auto-modify-connector
restartPolicy: "Never"
securityContext:
runAsNonRoot: true
runAsUser: 1000
containers:
- name: wiz-connector-delete
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
image: "container-registry-test.zalando.net/secops-systems/wiz-broker:latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to use latest build before merging instead of latest.

imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args:
- >
wiz-broker delete-kubernetes-connector
--input-secrets-namespace
"wiz"
--input-secret-name
"wiz-connector-connector"
|| true
env:
- name: LOG_LEVEL
value: info
- name: WIZ_CLIENT_ID
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientId
optional: false
- name: WIZ_CLIENT_TOKEN
valueFrom:
secretKeyRef:
name: wiz-api-token
key: clientToken
optional: false
- name: WIZ_ENV
value: ""
demonCoder95 marked this conversation as resolved.
Show resolved Hide resolved
resources:
null
{{end}}
43 changes: 43 additions & 0 deletions cluster/manifests/wiz/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}}
Loading