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

chore: make operator policies-config optional #2152

Merged
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
1 change: 1 addition & 0 deletions deploy/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Keeps security report resources updated
| trivy.dbRepositoryPassword | string | `nil` | The password for dbRepository authentication |
| trivy.dbRepositoryUsername | string | `nil` | The username for dbRepository authentication |
| trivy.debug | bool | `false` | debug One of `true` or `false`. Enables debug mode. |
| trivy.externalRegoPoliciesEnabled | bool | `false` | The Flag to enable the usage of external rego policies config-map, this should be used when the user wants to use their own rego policies |
| trivy.filesystemScanCacheDir | string | `"/var/trivyoperator/trivy-db"` | filesystemScanCacheDir the flag to set custom path for trivy filesystem scan `cache-dir` parameter. Only applicable in filesystem scan mode. |
| trivy.githubToken | string | `nil` | githubToken is the GitHub access token used by Trivy to download the vulnerabilities database from GitHub. Only applicable in Standalone mode. |
| trivy.httpProxy | string | `nil` | httpProxy is the HTTP proxy used by Trivy to download the vulnerabilities database from GitHub. |
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/templates/configmaps/policies.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.trivy.externalRegoPoliciesEnabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
{{- include "trivy-operator.labels" . | nindent 4 }}
data:
{{- .Values.trivyOperator.policiesConfig | nindent 2 }}
{{- end }}
4 changes: 3 additions & 1 deletion deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,9 @@ trivy:
# -- The Flag to enable the usage of builtin rego policies by default, these policies are downloaded by default from ghcr.io/aquasecurity/trivy-checks
#
useBuiltinRegoPolicies: "true"

# -- The Flag to enable the usage of external rego policies config-map, this should be used when the user wants to use their own rego policies
#
externalRegoPoliciesEnabled: false
# -- To enable the usage of embedded rego policies, set the flag useEmbeddedRegoPolicies. This should serve as a fallback for air-gapped environments.
# When useEmbeddedRegoPolicies is set to true, useBuiltinRegoPolicies should be set to false.
useEmbeddedRegoPolicies: "false"
Expand Down
13 changes: 0 additions & 13 deletions deploy/static/trivy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2948,19 +2948,6 @@ data:

node.collector.nodeSelector: "true"
---
# Source: trivy-operator/templates/configmaps/policies.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: trivy-operator-policies-config
namespace: trivy-system
labels:
app.kubernetes.io/name: trivy-operator
app.kubernetes.io/instance: trivy-operator
app.kubernetes.io/version: "0.21.3"
app.kubernetes.io/managed-by: kubectl
data:
---
# Source: trivy-operator/templates/configmaps/trivy-operator-config.yaml
kind: ConfigMap
apiVersion: v1
Expand Down
Loading