Skip to content

Commit

Permalink
chore: workload identity settings (#1282)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan authored Jun 11, 2023
1 parent b31210e commit c5f72b2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
3 changes: 0 additions & 3 deletions deploy/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ Keeps security report resources updated
| trivy.timeout | string | `"5m0s"` | timeout is the duration to wait for scan completion. |
| trivy.useBuiltinRegoPolicies | string | `"true"` | The Flag to enable the usage of builtin rego policies by default |
| trivyOperator.additionalReportLabels | string | `""` | additionalReportLabels comma-separated representation of the labels which the user wants the scanner pods to be labeled with. Example: `foo=bar,env=stage` will labeled the reports with the labels `foo: bar` and `env: stage` |
| trivyOperator.azureWorkloadIdentity | bool | `false` | azureWorkloadIdentity if enable azure workload identity annotation and labels wil be added to trivy-operator service account and scan job must be used with azureWorkloadIdentityClientID, azurerkloadIdentityTenantID and azureWorkloadIdentityUseAnnotation |
| trivyOperator.azureWorkloadIdentityAnnotation | object | `{"azure.workload.identity/client-id":"client-id","azure.workload.identity/tenant-id":"tenant-id"}` | azureWorkloadIdentityAnnotation annotation to be added to trivy-operator service account it is required to update the values of : <tenant-id> and <client-id> |
| trivyOperator.azureWorkloadIdentityUseLabel | object | `{"azure.workload.identity/use":true}` | azureWorkloadIdentityUseLabel label to be added to trivy-operator service account |
| trivyOperator.configAuditReportsPlugin | string | `"Trivy"` | configAuditReportsPlugin the name of the plugin that generates config audit reports. |
| trivyOperator.metricsResourceLabelsPrefix | string | `"k8s_label_"` | metricsResourceLabelsPrefix Prefix that will be prepended to the labels names indicated in `reportResourceLabels` when including them in the Prometheus metrics |
| trivyOperator.reportRecordFailedChecksOnly | bool | `true` | reportRecordFailedChecksOnly flag is to record only failed checks on misconfiguration reports (config-audit and rbac assessment) |
Expand Down
4 changes: 0 additions & 4 deletions deploy/helm/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ data:
{{- with .Values.nodeCollector.excludeNodes }}
nodeCollector.excludeNodes: {{ . | quote }}
{{- end }}
{{- if .Values.trivyOperator.azureWorkloadIdentity }}
scanJob.podTemplateLabels: {{ printf "azure.workload.identity/use=true,%s" .Values.trivyOperator.scanJobPodTemplateLabels | quote }}
{{- else }}
{{- with .Values.trivyOperator.scanJobPodTemplateLabels }}
scanJob.podTemplateLabels: {{ . | quote }}
{{- end }}
{{- end }}
{{- with .Values.trivyOperator.additionalReportLabels }}
report.additionalLabels: {{ . | quote }}
{{- end }}
Expand Down
14 changes: 1 addition & 13 deletions deploy/helm/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,10 @@ metadata:
namespace: {{ include "trivy-operator.namespace" . }}
labels:
{{- include "trivy-operator.labels" . | nindent 4 }}
{{- if .Values.trivyOperator.azureWorkloadIdentity}}
{{- range $name, $value := .Values.trivyOperator.azureWorkloadIdentityUseLabel }}
{{ $name }}: {{ $value | quote }}
{{- end -}}
{{- end }}
{{- if or .Values.serviceAccount.annotations .Values.trivyOperator.azureWorkloadIdentity }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- end }}
{{- with .Values.serviceAccount.annotations }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- if .Values.trivyOperator.azureWorkloadIdentity}}
{{- range $name, $value := .Values.trivyOperator.azureWorkloadIdentityAnnotation }}
{{ $name }}: {{ $value | quote }}
{{- end -}}
{{- end }}
{{- end }}

{{- if .Values.rbac.create }}
Expand Down
7 changes: 0 additions & 7 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,6 @@ trivyOperator:
# labeled with. Example: `foo=bar,env=stage` will labeled the reports with the labels `foo: bar` and `env: stage`
additionalReportLabels: ""

# -- azureWorkloadIdentity if enable azure workload identity annotation and labels wil be added to trivy-operator service account and scan job must be used with azureWorkloadIdentityClientID, azurerkloadIdentityTenantID and azureWorkloadIdentityUseAnnotation
azureWorkloadIdentity: false
# -- azureWorkloadIdentityAnnotation annotation to be added to trivy-operator service account it is required to update the values of : <tenant-id> and <client-id>
azureWorkloadIdentityAnnotation: {azure.workload.identity/client-id: client-id, azure.workload.identity/tenant-id: tenant-id}
# -- azureWorkloadIdentityUseLabel label to be added to trivy-operator service account
azureWorkloadIdentityUseLabel: {azure.workload.identity/use: true}

trivy:
# -- createConfig indicates whether to create config objects
createConfig: true
Expand Down

0 comments on commit c5f72b2

Please sign in to comment.