Skip to content

Commit

Permalink
feat: remove rules_override.yaml file, add field so users can specify…
Browse files Browse the repository at this point in the history
… custom rules directly via values
  • Loading branch information
IgorEulalio committed Nov 6, 2024
1 parent 5785832 commit 7e39ab7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
9 changes: 0 additions & 9 deletions charts/falco-talon/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,3 @@
parameters:
labels:
analysis/status: "suspicious"

- rule: Terminal shell in container
match:
rules:
- Terminal shell in container
output_fields:
- k8s.ns.name!=kube-system, k8s.ns.name!=falco
actions:
- action: Label Pod as Suspicious
6 changes: 0 additions & 6 deletions charts/falco-talon/rules_override.yaml

This file was deleted.

9 changes: 5 additions & 4 deletions charts/falco-talon/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
{{- include "falco-talon.labels" . | nindent 4 }}
data:
rules.yaml: |-
{{- range $file := .Values.config.rulesFiles -}}
{{ $fileContent := $.Files.Get . }}
{{- $fileContent | nindent 4 -}}
{{- end -}}
{{ $.Files.Get "rules.yaml" | nindent 4 }}
{{- if .Values.config.rulesOverride }}
{{ .Values.config.rulesOverride | nindent 4 }}
{{- end }}
14 changes: 9 additions & 5 deletions charts/falco-talon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ config:
# -- auto reload the rules when the files change
watchRules: true

# -- list of locale rules to load, they will be concatenated into a single config map
rulesFiles:
- rules.yaml
- rules_override.yaml

# -- deduplication of the Falco events
deduplication:
# -- enable the leader election for cluster mode
Expand All @@ -156,6 +151,15 @@ config:
# -- print in stdout all received events, not only those which match a rule
printAllEvents: false

# User-defined additional rules for rules_override.yaml
rulesOverride: |
- action: Terminate Pod
actionner: kubernetes:terminate
parameters:
ignore_daemonsets: true
ignore_statefulsets: true
grace_period_seconds: 20
# -- open telemetry parameters
otel:
# -- enable otel traces
Expand Down

0 comments on commit 7e39ab7

Please sign in to comment.