Validate a rules file before reload
Check rule syntax before you apply it; on error the exit code is non-zero, so it works as a CI check.
falco -r /etc/falco/falco_rules.yaml --validate
- tool
- falco6 commands
More falco commands
-
kubectl logs -l app.kubernetes.io/name=falco -n falco | jq 'select(.priority=="Critical")'Show only Critical Falco events from the JSON output; needs json_output: true in falco.yaml.
-
falcoctl artifact install falco-rules:latest && falcoctl artifact listInstall and manage versioned rules and plugins from OCI registries instead of copying rule files by hand.
-
falco -M 60 -o json_output=true 2>/dev/null | jq -c '{rule,output_fields}'Run Falco for 60 seconds and exit; useful for a quick check of a suspicious node.
-
falco --list | grep -E 'k8s\.|container\.|proc\.' | sortFind k8s, container and process fields to use in your own rule conditions and outputs.
-
cat > /etc/falco/rules.d/shell.yaml <<'EOF' - rule: Shell in container desc: A shell was spawned in a container condition: container and proc.name in (bash, sh, zsh) output: "Shell spawned (pod=%k8s.pod.name cmd=%proc.cmdline)" priority: WARNING EOFWrite a minimal custom rule with condition, output and priority to rules.d, where Falco picks it up.