From 9153a7d090ad8398eef60776ae00486e147c87d6 Mon Sep 17 00:00:00 2001 From: "isaac.schnitzer" Date: Thu, 20 Apr 2023 12:01:42 +0300 Subject: [PATCH] refactor broker deployment refactor broker deployment --- wiz-broker-v2/.helmignore | 23 ++++ wiz-broker-v2/Chart.yaml | 8 ++ wiz-broker-v2/templates/_helpers.tpl | 68 +++++++++++ wiz-broker-v2/templates/secret-proxy.yaml | 20 +++ .../templates/serviceaccount.yaml | 6 +- .../templates/wiz-broker-deployment.yaml | 34 +++--- wiz-broker-v2/values.yaml | 43 +++++++ wiz-kubernetes-connector/Chart.yaml | 8 ++ wiz-kubernetes-connector/templates/NOTES.txt | 4 +- .../templates/_helpers.tpl | 20 +-- .../templates/job-create-connector.yaml | 8 +- .../templates/secret-proxy.yaml | 12 +- .../templates/secrets.yaml | 12 +- .../service-account-create-connector.yaml | 4 +- wiz-kubernetes-connector/values.yaml | 115 +++++++++--------- 15 files changed, 279 insertions(+), 106 deletions(-) create mode 100644 wiz-broker-v2/.helmignore create mode 100644 wiz-broker-v2/Chart.yaml create mode 100644 wiz-broker-v2/templates/_helpers.tpl create mode 100644 wiz-broker-v2/templates/secret-proxy.yaml rename wiz-kubernetes-connector/templates/service-account-broker.yaml => wiz-broker-v2/templates/serviceaccount.yaml (64%) rename {wiz-kubernetes-connector => wiz-broker-v2}/templates/wiz-broker-deployment.yaml (73%) create mode 100644 wiz-broker-v2/values.yaml diff --git a/wiz-broker-v2/.helmignore b/wiz-broker-v2/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/wiz-broker-v2/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/wiz-broker-v2/Chart.yaml b/wiz-broker-v2/Chart.yaml new file mode 100644 index 00000000..2b077cd0 --- /dev/null +++ b/wiz-broker-v2/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: "wiz-broker-v2" +description: Wiz Broker for tunneling http traffic to Wiz backend + +type: application + +version: 1.0.0 +appVersion: "2.0.162274" diff --git a/wiz-broker-v2/templates/_helpers.tpl b/wiz-broker-v2/templates/_helpers.tpl new file mode 100644 index 00000000..9e253b34 --- /dev/null +++ b/wiz-broker-v2/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "wiz-broker.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "wiz-broker.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "wiz-broker.labels" -}} +helm.sh/chart: {{ include "wiz-broker.chart" . }} +{{ include "wiz-broker.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.commonLabels }} +{{- range $index, $content := .Values.commonLabels }} +{{ $index }}: {{ tpl $content $ }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "wiz-broker.selectorLabels" -}} +app.kubernetes.io/name: {{ include "wiz-broker.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create Wiz broker properties to use +*/}} + +{{- define "wiz-broker.wizConnectorSecretData" -}} +{{- if not .Values.global.autoCreateConnector }} +CONNECTOR_ID: {{ required "A valid .Values.global.wizConnector.connectorId entry required!" .Values.global.wizConnector.connectorId | quote}} +CONNECTOR_TOKEN: {{ required "A valid .Values.global.wizConnector.connectorToken entry required!" .Values.global.wizConnector.connectorToken | quote }} +TARGET_DOMAIN: {{ required "A valid .Values.global.wizConnector.targetDomain entry required!" .Values.global.wizConnector.targetDomain | quote }} +TARGET_IP: {{ required "A valid .Values.global.wizConnector.targetIp entry required!" .Values.global.wizConnector.targetIp | quote }} +TARGET_PORT: {{ required "A valid .Values.global.wizConnector.targetPort entry required!" .Values.global.wizConnector.targetPort | quote }} +{{- end }} +{{- end }} + +{{/* +Secrets names +*/}} + +{{- define "wiz-broker.apiTokenSecretName" -}} +{{ coalesce (.Values.global.wizApiToken.secret.name) (printf "%s-api-token" .Release.Name) }} +{{- end }} + +{{- define "wiz-broker.proxySecretName" -}} +{{ coalesce (.Values.global.httpProxyConfiguration.secretName) (printf "%s-proxy-configuration" .Release.Name) }} +{{- end }} + +{{- define "wiz-broker.connectorSecretName" -}} +{{ coalesce (.Values.global.wizConnector.secretName) (printf "%s-connector" .Release.Name) }} +{{- end }} \ No newline at end of file diff --git a/wiz-broker-v2/templates/secret-proxy.yaml b/wiz-broker-v2/templates/secret-proxy.yaml new file mode 100644 index 00000000..b57790b1 --- /dev/null +++ b/wiz-broker-v2/templates/secret-proxy.yaml @@ -0,0 +1,20 @@ +{{- if .Values.global.httpProxyConfiguration.enabled }} +{{- if .Values.global.httpProxyConfiguration.create }} +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ include "wiz-broker.proxySecretName" . | trim }} + namespace: {{ .Release.Namespace | quote }} + {{- with .Values.global.httpProxyConfiguration.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "wiz-broker.labels" . | nindent 4 }} +data: + httpProxy: {{ .Values.global.httpProxyConfiguration.httpProxy | b64enc | quote }} + httpsProxy: {{ .Values.global.httpProxyConfiguration.httpsProxy | b64enc | quote }} + noProxyAddress: {{ .Values.global.httpProxyConfiguration.noProxyAddress | b64enc | quote }} +{{- end }} +{{- end }} diff --git a/wiz-kubernetes-connector/templates/service-account-broker.yaml b/wiz-broker-v2/templates/serviceaccount.yaml similarity index 64% rename from wiz-kubernetes-connector/templates/service-account-broker.yaml rename to wiz-broker-v2/templates/serviceaccount.yaml index 25859b28..f5778000 100644 --- a/wiz-kubernetes-connector/templates/service-account-broker.yaml +++ b/wiz-broker-v2/templates/serviceaccount.yaml @@ -1,13 +1,13 @@ {{- if .Values.broker.enabled }} -{{- if .Values.broker.serviceAccount.create -}} +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.broker.serviceAccount.name }} + name: {{ .Values.serviceAccount.name }} namespace: {{ .Release.Namespace | quote }} labels: {{- include "wiz-kubernetes-connector.labels" . | nindent 4 }} - {{- with .Values.broker.serviceAccount.annotations }} + {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/wiz-kubernetes-connector/templates/wiz-broker-deployment.yaml b/wiz-broker-v2/templates/wiz-broker-deployment.yaml similarity index 73% rename from wiz-kubernetes-connector/templates/wiz-broker-deployment.yaml rename to wiz-broker-v2/templates/wiz-broker-deployment.yaml index 9208a277..3257dbbe 100644 --- a/wiz-kubernetes-connector/templates/wiz-broker-deployment.yaml +++ b/wiz-broker-v2/templates/wiz-broker-deployment.yaml @@ -5,42 +5,42 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "wiz-kubernetes-connector.name" . }}-broker + name: {{ include "wiz-broker.name" . }}-broker namespace: {{ .Release.Namespace | quote }} labels: - {{- include "wiz-kubernetes-connector.labels" . | nindent 4 }} + {{- include "wiz-broker.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - {{- include "wiz-kubernetes-connector.selectorLabels" . | nindent 6 }} + {{- include "wiz-broker.selectorLabels" . | nindent 6 }} template: metadata: annotations: rollme: {{ randAlphaNum 5 | quote }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{/* - `labels` includes `selectorLabels` - */}} - {{- include "wiz-kubernetes-connector.labels" . | nindent 8 }} + `labels` includes `selectorLabels` + */}} + {{- include "wiz-broker.labels" . | nindent 8 }} spec: {{- with .Values.image.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ .Values.broker.serviceAccount.name }} + serviceAccountName: {{ .Values.serviceAccount.name }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} volumes: - name: connector-data secret: - secretName: {{ include "wiz-kubernetes-connector.connectorSecretName" . | trim }} + secretName: {{ include "wiz-broker.connectorSecretName" . | trim }} items: - - key: connectorData - path: {{ $connectorDataFileName }} + - key: connectorData + path: {{ $connectorDataFileName }} {{- with .Values.broker.customVolumes }} {{- toYaml . | nindent 8 }} {{- end }} @@ -62,17 +62,17 @@ spec: ] env: - name: WIZ_ENV - value: {{ .Values.wizApiToken.clientEndpoint | quote }} - {{- if not .Values.wizApiToken.usePodCustomEnvironmentVariablesFile }} + value: {{ .Values.global.wizApiToken.clientEndpoint | quote }} + {{- if not .Values.global.wizApiToken.usePodCustomEnvironmentVariablesFile }} - name: WIZ_CLIENT_ID valueFrom: secretKeyRef: - name: {{ include "wiz-kubernetes-connector.apiTokenSecretName" . | trim }} + name: {{ include "wiz-broker.apiTokenSecretName" . | trim }} key: clientId - name: WIZ_CLIENT_TOKEN valueFrom: secretKeyRef: - name: {{ include "wiz-kubernetes-connector.apiTokenSecretName" . | trim }} + name: {{ include "wiz-broker.apiTokenSecretName" . | trim }} key: clientToken {{- end }} {{- if .Values.broker.podCustomEnvironmentVariablesFile }} @@ -83,11 +83,11 @@ spec: {{- end }} - name: TARGET_IP value: {{ .Values.broker.targetIp }} - {{- if .Values.httpProxyConfiguration.enabled }} + {{- if .Values.global.httpProxyConfiguration.enabled }} - name: HTTP_PROXY valueFrom: secretKeyRef: - name: {{ include "wiz-kubernetes-connector.proxySecretName" . | trim }} + name: {{ include "wiz-broker.proxySecretName" . | trim }} key: httpsProxy # The frp project supports only HTTP_PROXY, it uses it for both http and https. Our broker always uses https, so we're using the httpsProxy value here (See: https://github.com/fatedier/frp/#connecting-to-frps-via-http-proxy) {{- end }} resources: diff --git a/wiz-broker-v2/values.yaml b/wiz-broker-v2/values.yaml new file mode 100644 index 00000000..cb2d9187 --- /dev/null +++ b/wiz-broker-v2/values.yaml @@ -0,0 +1,43 @@ +# Default values for wiz-broker. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# override default application name +nameOverride: "wiz-broker" + +serviceAccount: + # Specifies whether a service account should be created + create: true + + # Annotations to add to the service account + annotations: {} + + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "wiz-broker" + + # Create RBAC resources for our service account. + # Needed to fetch kubernetes metadata from the api-server + rbac: true + +image: + registry: wiziopublic.azurecr.io/wiz-app + repository: wiz-broker + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + imagePullSecrets: [] + +broker: + enabled: true + targetIp: "" + podCustomEnvironmentVariablesFile: "" + + customVolumes: [] + customVolumeMounts: [] + +podAnnotations: {} + +podSecurityContext: + runAsNonRoot: true + runAsUser: 1000 diff --git a/wiz-kubernetes-connector/Chart.yaml b/wiz-kubernetes-connector/Chart.yaml index 021e263b..eace5b17 100644 --- a/wiz-kubernetes-connector/Chart.yaml +++ b/wiz-kubernetes-connector/Chart.yaml @@ -22,3 +22,11 @@ version: 2.0.1 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "2.0.162274" + +# Add wiz-broker dependency to the chart +dependencies: + - name: "wiz-broker-v2" + version: "1.0.0" +# repository: "https://wiz-sec.github.io/charts" + repository: "file://../wiz-broker-v2" + condition: broker.enabled \ No newline at end of file diff --git a/wiz-kubernetes-connector/templates/NOTES.txt b/wiz-kubernetes-connector/templates/NOTES.txt index 2eb52805..96f7f59e 100644 --- a/wiz-kubernetes-connector/templates/NOTES.txt +++ b/wiz-kubernetes-connector/templates/NOTES.txt @@ -14,11 +14,11 @@ For uninstalling the wiz kubernetes connector you need to delete helm hooks reso Please run the following commands: helm uninstall {{ .Release.Name | quote }} -n {{ .Release.Namespace | quote }} {{- if .Values.broker.enabled }} -{{- if .Values.wizConnector.createSecret }} +{{- if .Values.global.wizConnector.createSecret }} kubectl delete secret {{ include "wiz-kubernetes-connector.connectorSecretName" . | trim }} -n {{ .Release.Namespace | quote }} {{- end }} {{- end }} -{{- if and .Values.wizApiToken.secret.create .Values.autoCreateConnector.enabled }} +{{- if and .Values.global.wizApiToken.secret.create .Values.autoCreateConnector.enabled }} kubectl delete secret {{ include "wiz-kubernetes-connector.apiTokenSecretName" . | trim }} -n {{ .Release.Namespace | quote }} {{- end }} {{- if .Values.clusterReader.installRbac }} diff --git a/wiz-kubernetes-connector/templates/_helpers.tpl b/wiz-kubernetes-connector/templates/_helpers.tpl index 98681ca8..4759a0ae 100644 --- a/wiz-kubernetes-connector/templates/_helpers.tpl +++ b/wiz-kubernetes-connector/templates/_helpers.tpl @@ -42,12 +42,12 @@ Create Wiz connector properties to use */}} {{- define "wiz-kubernetes-connector.wizConnectorSecretData" -}} -{{- if not .Values.autoCreateConnector.enabled }} -CONNECTOR_ID: {{ required "A valid .Values.wizConnector.connectorId entry required!" .Values.wizConnector.connectorId | quote}} -CONNECTOR_TOKEN: {{ required "A valid .Values.wizConnector.connectorToken entry required!" .Values.wizConnector.connectorToken | quote }} -TARGET_DOMAIN: {{ required "A valid .Values.wizConnector.targetDomain entry required!" .Values.wizConnector.targetDomain | quote }} -TARGET_IP: {{ required "A valid .Values.wizConnector.targetIp entry required!" .Values.wizConnector.targetIp | quote }} -TARGET_PORT: {{ required "A valid .Values.wizConnector.targetPort entry required!" .Values.wizConnector.targetPort | quote }} +{{- if not .Values.global.autoCreateConnector }} +CONNECTOR_ID: {{ required "A valid .Values.global.wizConnector.connectorId entry required!" .Values.global.wizConnector.connectorId | quote}} +CONNECTOR_TOKEN: {{ required "A valid .Values.global.wizConnector.connectorToken entry required!" .Values.global.wizConnector.connectorToken | quote }} +TARGET_DOMAIN: {{ required "A valid .Values.global.wizConnector.targetDomain entry required!" .Values.global.wizConnector.targetDomain | quote }} +TARGET_IP: {{ required "A valid .Values.global.wizConnector.targetIp entry required!" .Values.global.wizConnector.targetIp | quote }} +TARGET_PORT: {{ required "A valid .Values.global.wizConnector.targetPort entry required!" .Values.global.wizConnector.targetPort | quote }} {{- end }} {{- end }} @@ -56,15 +56,15 @@ Secrets names */}} {{- define "wiz-kubernetes-connector.apiTokenSecretName" -}} -{{ coalesce (.Values.wizApiToken.secret.name) (printf "%s-api-token" .Release.Name) }} +{{ coalesce (.Values.global.wizApiToken.secret.name) (printf "%s-api-token" .Release.Name) }} {{- end }} {{- define "wiz-kubernetes-connector.proxySecretName" -}} -{{ coalesce (.Values.httpProxyConfiguration.secretName) (printf "%s-proxy-configuration" .Release.Name) }} +{{ coalesce (.Values.global.httpProxyConfiguration.secretName) (printf "%s-proxy-configuration" .Release.Name) }} {{- end }} {{- define "wiz-kubernetes-connector.connectorSecretName" -}} -{{ coalesce (.Values.wizConnector.secretName) (printf "%s-connector" .Release.Name) }} +{{ coalesce (.Values.global.wizConnector.secretName) (printf "%s-connector" .Release.Name) }} {{- end }} {{- define "wiz-kubernetes-connector.clusterReaderToken" -}} @@ -75,7 +75,7 @@ Secrets names Input parameters */}} {{- define "wiz-kubernetes-connector.apiServerEndpoint" -}} - {{- if and .Values.autoCreateConnector.enabled (not .Values.broker.enabled) }} + {{- if and .Values.global.autoCreateConnector (not .Values.broker.enabled) }} {{- required "A valid .Values.autoCreateConnector.apiServerEndpoint entry required!" .Values.autoCreateConnector.apiServerEndpoint -}} {{- else -}} {{ if .Values.autoCreateConnector.apiServerEndpoint }} diff --git a/wiz-kubernetes-connector/templates/job-create-connector.yaml b/wiz-kubernetes-connector/templates/job-create-connector.yaml index 42b21574..0b26c3ab 100644 --- a/wiz-kubernetes-connector/templates/job-create-connector.yaml +++ b/wiz-kubernetes-connector/templates/job-create-connector.yaml @@ -1,4 +1,4 @@ -{{- if .Values.autoCreateConnector.enabled }} +{{- if .Values.global.autoCreateConnector }} apiVersion: batch/v1 kind: Job metadata: @@ -76,7 +76,7 @@ spec: - name: USE_CLI_ENV_FILE value: "true" {{- end }} - {{- if not .Values.wizApiToken.usePodCustomEnvironmentVariablesFile }} + {{- if not .Values.global.wizApiToken.usePodCustomEnvironmentVariablesFile }} - name: WIZ_CLIENT_ID valueFrom: secretKeyRef: @@ -89,8 +89,8 @@ spec: key: clientToken {{- end }} - name: WIZ_ENV - value: {{ .Values.wizApiToken.clientEndpoint | quote }} - {{- if .Values.httpProxyConfiguration.enabled }} + value: {{ .Values.global.wizApiToken.clientEndpoint | quote }} + {{- if .Values.global.httpProxyConfiguration.enabled }} - name: HTTP_PROXY valueFrom: secretKeyRef: diff --git a/wiz-kubernetes-connector/templates/secret-proxy.yaml b/wiz-kubernetes-connector/templates/secret-proxy.yaml index e65f81f5..361e3947 100644 --- a/wiz-kubernetes-connector/templates/secret-proxy.yaml +++ b/wiz-kubernetes-connector/templates/secret-proxy.yaml @@ -1,20 +1,20 @@ -{{- if .Values.httpProxyConfiguration.enabled }} -{{- if .Values.httpProxyConfiguration.create }} +{{- if .Values.global.httpProxyConfiguration.enabled }} +{{- if .Values.global.httpProxyConfiguration.create }} apiVersion: v1 kind: Secret type: Opaque metadata: name: {{ include "wiz-kubernetes-connector.proxySecretName" . | trim }} namespace: {{ .Release.Namespace | quote }} - {{- with .Values.httpProxyConfiguration.annotations }} + {{- with .Values.global.httpProxyConfiguration.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} labels: {{- include "wiz-kubernetes-connector.labels" . | nindent 4 }} data: - httpProxy: {{ .Values.httpProxyConfiguration.httpProxy | b64enc | quote }} - httpsProxy: {{ .Values.httpProxyConfiguration.httpsProxy | b64enc | quote }} - noProxyAddress: {{ .Values.httpProxyConfiguration.noProxyAddress | b64enc | quote }} + httpProxy: {{ .Values.global.httpProxyConfiguration.httpProxy | b64enc | quote }} + httpsProxy: {{ .Values.global.httpProxyConfiguration.httpsProxy | b64enc | quote }} + noProxyAddress: {{ .Values.global.httpProxyConfiguration.noProxyAddress | b64enc | quote }} {{- end }} {{- end }} diff --git a/wiz-kubernetes-connector/templates/secrets.yaml b/wiz-kubernetes-connector/templates/secrets.yaml index 5b60afd3..6084adab 100644 --- a/wiz-kubernetes-connector/templates/secrets.yaml +++ b/wiz-kubernetes-connector/templates/secrets.yaml @@ -1,5 +1,5 @@ {{- if .Values.broker.enabled }} -{{- if .Values.wizConnector.createSecret }} +{{- if .Values.global.wizConnector.createSecret }} apiVersion: v1 kind: Secret metadata: @@ -10,7 +10,7 @@ metadata: annotations: "helm.sh/hook": pre-install,pre-upgrade "helm.sh/hook-weight": "-1" - {{- with .Values.wizConnector.annotations }} + {{- with .Values.global.wizConnector.annotations }} {{- toYaml . | nindent 4 }} {{- end }} type: Opaque @@ -19,7 +19,7 @@ stringData: {{- end }} {{- end }} -{{- if and .Values.wizApiToken.secret.create .Values.autoCreateConnector.enabled }} +{{- if and .Values.global.wizApiToken.secret.create .Values.global.autoCreateConnector }} --- apiVersion: v1 kind: Secret @@ -31,10 +31,10 @@ metadata: annotations: "helm.sh/hook": pre-install,pre-upgrade "helm.sh/hook-weight": "-1" - {{- with .Values.wizApiToken.secret.annotations }} + {{- with .Values.global.wizApiToken.secret.annotations }} {{- toYaml . | nindent 4 }} {{- end }} data: - clientId: {{ required "Missing required value wizApiToken.clientId is required" .Values.wizApiToken.clientId | b64enc | quote }} - clientToken: {{ required "Missing required value: wizApiToken.clientToken is required" .Values.wizApiToken.clientToken | b64enc | quote }} + clientId: {{ required "Missing required value wizApiToken.clientId is required" .Values.global.wizApiToken.clientId | b64enc | quote }} + clientToken: {{ required "Missing required value: wizApiToken.clientToken is required" .Values.global.wizApiToken.clientToken | b64enc | quote }} {{- end }} diff --git a/wiz-kubernetes-connector/templates/service-account-create-connector.yaml b/wiz-kubernetes-connector/templates/service-account-create-connector.yaml index 826d4ff7..ae993f30 100644 --- a/wiz-kubernetes-connector/templates/service-account-create-connector.yaml +++ b/wiz-kubernetes-connector/templates/service-account-create-connector.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.autoCreateConnector.enabled .Values.autoCreateConnector.serviceAccount.create }} +{{- if and .Values.global.autoCreateConnector .Values.autoCreateConnector.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -13,7 +13,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} -{{- if and .Values.autoCreateConnector.enabled .Values.autoCreateConnector.serviceAccount.createRbac }} +{{- if and .Values.global.autoCreateConnector .Values.autoCreateConnector.serviceAccount.createRbac }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/wiz-kubernetes-connector/values.yaml b/wiz-kubernetes-connector/values.yaml index 1020da17..9408ecd4 100644 --- a/wiz-kubernetes-connector/values.yaml +++ b/wiz-kubernetes-connector/values.yaml @@ -25,9 +25,8 @@ clusterReader: annotations: {} autoCreateConnector: - enabled: true - connectorName: "" # optional + connectorName: "" # optional clusterFlavor: "" # optional (EKS, AKS, GKE, OKE, OpenShift, Kubernetes) # Required arguments for broker.enabled = false apiServerEndpoint: "" @@ -39,48 +38,12 @@ autoCreateConnector: annotations: {} # The name of the service account to use. name: "wiz-auto-create-connector" - + podCustomEnvironmentVariablesFile: "" - + customVolumes: [] customVolumeMounts: [] -wizApiToken: - clientId: "" - clientToken: "" - clientEndpoint: "" # Set custom endpoint (gov for example) - - secret: - # Specifies whether an api token secret should be created - # If create is false you need to create it with clientId, clientToken - create: true - # Annotations to add to the secret - annotations: {} - # The name of the secret to use. - # If not set, a name is generated using the fullname template - name: "" - - # API token should be read from an environment file, which is specified in podCustomEnvironmentVariablesFile - usePodCustomEnvironmentVariablesFile: false - -wizConnector: # Relevant only for broker.enabled = true & autoCreateConnector = false - # Specifies whether a proxy secret should be created - # If createSecret is false you need to: - # 1. Create secret with this keys: - # CONNECTOR_ID, CONNECTOR_TOKEN, TARGET_DOMAIN, TARGET_IP, TARGET_PORT - # 2. Set secretName to reference your secret - createSecret: true - # Annotations to add to the secret - annotations: {} - secretName: "" - - # Required arguments for autoCreateConnector = false - connectorId: "" - connectorToken: "" - targetDomain: "" - targetIp: "" - targetPort: "" - broker: enabled: true targetIp: "kubernetes.default.svc.cluster.local" @@ -95,7 +58,6 @@ broker: customVolumes: [] customVolumeMounts: [] - # Labels applied on all the resources (not used for selection) commonLabels: {} @@ -111,7 +73,7 @@ securityContext: runAsUser: 1000 allowPrivilegeEscalation: false -resources: +resources: # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -129,17 +91,58 @@ tolerations: [] affinity: {} -httpProxyConfiguration: - enabled: false - - # Specifies whether a proxy secret should be created - # If create is false you need to: - # 1. Create secret with httpProxy, httpsProxy and noProxyAddress. - # 2. Set secretName to reference your secret - create: true - annotations: {} - secretName: "" # Overriding default name for proxy secret name (.Release.Name + "-proxy-configuration" by default) - - httpProxy: "" # http(s)://user:password@your-proxy:port (user, password and port are optional) - httpsProxy: "" # http(s)://user:password@your-proxy:port (user, password and port are optional) - noProxyAddress: "" # comma or space separated list of machine or domain names +global: + + autoCreateConnector: true + + # The API key identifying this installation (for comm with Wiz portal) + wizApiToken: + clientId: "" + clientToken: "" + clientEndpoint: "" # Set custom endpoint (gov for example) + + secret: + # Specifies whether an api token secret should be created + # If create is false you need to create it with clientId, clientToken + create: true + # Annotations to add to the secret + annotations: { } + # The name of the secret to use. + # If not set, a name is generated using the fullname template + name: "" + + # API token should be read from an environment file, which is specified in podCustomEnvironmentVariablesFile + usePodCustomEnvironmentVariablesFile: false + + wizConnector: # Relevant only for broker.enabled = true & autoCreateConnector = false + # Specifies whether a proxy secret should be created + # If createSecret is false you need to: + # 1. Create secret with this keys: + # CONNECTOR_ID, CONNECTOR_TOKEN, TARGET_DOMAIN, TARGET_IP, TARGET_PORT + # 2. Set secretName to reference your secret + createSecret: true + # Annotations to add to the secret + annotations: { } + secretName: "" + + # Required arguments for autoCreateConnector = false + connectorId: "" + connectorToken: "" + targetDomain: "" + targetIp: "" + targetPort: "" + + httpProxyConfiguration: + enabled: false + + # Specifies whether a proxy secret should be created + # If create is false you need to: + # 1. Create secret with httpProxy, httpsProxy and noProxyAddress. + # 2. Set secretName to reference your secret + create: true + annotations: { } + secretName: "" # Overriding default name for proxy secret name (.Release.Name + "-proxy-configuration" by default) + + httpProxy: "" # http(s)://user:password@your-proxy:port (user, password and port are optional) + httpsProxy: "" # http(s)://user:password@your-proxy:port (user, password and port are optional) + noProxyAddress: "" # comma or space separated list of machine or domain names