Skip to content

Commit

Permalink
feat(helm): support custom policies with built-in scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
yurrriq committed Apr 20, 2022
1 parent b367c30 commit 3e7982c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.10.4
version: 0.11.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 9 additions & 0 deletions deploy/helm/templates/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -863,3 +863,12 @@ data:
kubernetes.namespace]))\n\n\tres := {\n\t\t\"msg\": msg,\n\t\t\"id\": __rego_metadata__.id,\n\t\t\"title\":
__rego_metadata__.title,\n\t\t\"severity\": __rego_metadata__.severity,\n\t\t\"type\":
__rego_metadata__.type,\n\t}\n}\n"
{{- with .Values.additionalPolicies }}
{{- range $key, $val := .library }}
library.{{ $key }}: {{ $val | quote }}
{{- end }}
{{- range $key, $val := .policy }}
policy.{{ $key }}.rego: {{ $val.rego | quote }}
policy.{{ $key }}.kinds: {{ $val.kinds | quote }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,19 @@ nodeSelector: {}
tolerations: []

affinity: {}

additionalPolicies:
library: {}
# kubernetes.rego: |
# << REGO >>
# utils.rego: |
# << REGO >>
policy: {}
# access_to_host_pid:
# rego: |
# << REGO >>
# kinds: Workload
# configmap_with_sensitive_data:
# rego: |
# << REGO >>
# kinds: ConfigMap

0 comments on commit 3e7982c

Please sign in to comment.