runtime-security
Skill71 starsChanged 8 days agoApache-2.0View on GitHub
Detect and respond to in-container threats at the syscall level using Falco (eBPF-based, CNCF, open-source, no license cost). Covers Falco installation on EKS/GKE with eBPF driver, custom rule authoring, alert routing via Falcosidekick, rule debugging, and bridging Falco runtime signals to Kyverno admission enforcement. Use when asked to "detect privilege escalation in containers", "set up runtime threat detection", "write a Falco rule", "route Falco alerts to Slack", or "debug why my Falco rule is not firing".
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
When invoked with no arguments, ask before proceeding:
- Very specific: line 33
Before install, check for another eBPF agent: kubectl get ds -A | grep -iE 'node-agent|tetragon'.
- Distinctive: line 56
Add the Falco Helm repository:
- Distinctive: line 68
Verify DaemonSet is running on all nodes:
- Distinctive: line 85
Write and test custom Falco rules.
- Distinctive: line 153
Verify alerts are routing:
- Very specific: line 162
If you need deeper context on any Falco component, load references/runtime-security.md.
- Distinctive: line 178
Is the condition correct?: Test the event type:
- Distinctive: line 182
Is the event being generated?: Use event-generator for syscall rules:
- Very specific: line 186
Is the priority too low?: If falcosidekick.config.slack.minimumpriority: error, rules with priority: WARNING are silently dropped.
- Very specific: line 187
Is there a macro override?: Check if a built-in macro like never_true is shadowing your condition:
- Distinctive: line 235
Recovery: If a Kyverno policy blocks a legitimate workload, remove the triggering label immediately:
- Very specific: line 243
After completing this task, log errors and learnings via /platform-skills:self-improve log.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Detect and respond to threats inside running containers using Falco.
Interactive Wizard (fires when no arguments are provided)
When invoked with no arguments, ask before proceeding:
Q1 — Mode?
What do you need?
1. install — deploy Falco on Kubernetes (EKS or GKE) with eBPF driver
2. rules — write and test a custom Falco rule
3. alerts — configure Falcosidekick to route alerts (Slack, webhook, etc.)
4. debug — diagnose why a Falco rule is not firing
5. harden — map runtime Falco alerts to Kyverno admission policies
Alerts on behaviour a container never showed while learning (profile-based,
no rule writing), or Kubescape already runs → /platform-skills:kubescape-operator runtime
Enter 1–5 or mode name:Before install, check for another eBPF agent: kubectl get ds -A | grep -iE 'node-agent|tetragon'. Kubescape's node-agent with runtimeDetection overlaps with Falco on the same nodes; pick one per node pool, or disable Kubescape's runtimeDetection and keep its posture and CVE capabilities.
Q2 — Context (after mode selected, one at a time):
- install:
Which cloud platform? EKS / GKE / other (specify node OS if known): - rules:
Describe the behaviour to detect (e.g. "shell spawned in a container", "unexpected outbound connection"): - alerts:
Which output destination? Slack / webhook / PagerDuty / other: - debug:
Describe the symptom — which rule is not firing, and what event should trigger it? - harden:
Which Falco alert or rule output should block re-admission? (paste the alert or rule name):
Then proceed into the relevant mode below.
Mode: install
Deploy Falco on Kubernetes (EKS or GKE) using the eBPF driver via Helm.
Prerequisites:
- Helm 3.x
kubectlaccess to the target cluster- Node OS: Amazon Linux 2/2023 (EKS) or Container-Optimized OS (GKE) — both support eBPF
Steps:
- Add the Falco Helm repository:
helm repo add falcosecurity https://falcosecurity.github.io/charts helm repo update - Install Falco with eBPF driver (never kernel module on managed K8s):
helm install falco falcosecurity/falco \ --namespace falco \ --create-namespace \ -f examples/runtime-security/falco-values.yaml - Verify DaemonSet is running on all nodes:
kubectl rollout status daemonset/falco -n falco kubectl get pods -n falco -o wide - Confirm Falco is receiving events:
Expected: lines likekubectl logs -n falco -l app.kubernetes.io/name=falco --tail=20Notice A shell was spawned...(from the default ruleset test events)
EKS-specific note: if using Bottlerocket nodes, set driver.kind: modern_ebpf in Helm values — Bottlerocket does not ship kernel headers for the classic eBPF probe.
GKE-specific note: COS nodes require driver.kind: modern_ebpf. GKE Autopilot does not support Falco (no DaemonSet scheduling).
Mode: rules
Write and test custom Falco rules.
Steps:
- Explain the rule structure:
- rule: Shell spawned in container desc: A shell was spawned inside a container — potential interactive intrusion condition: > spawned_process and container and shell_procs and not container.image.repository in (allowed_shell_images) output: > Shell spawned in container (user=%user.name user_id=%user.uid container=%container.name image=%container.image.repository shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline) priority: WARNING tags: [container, shell, mitre_execution] - Key condition fields:
spawned_process— a new process was exec'dcontainer— event is inside a container (not on the host)proc.name— process namecontainer.image.repository— image name without tagfd.net— network file descriptor (for connection events)
- Test with falco-event-generator:
Then check logs:kubectl run event-generator \ --image=falcosecurity/event-generator \ --restart=Never \ --rm -it -- run syscallkubectl logs -n falco -l app.kubernetes.io/name=falco | grep WARNING - Load custom rules via Helm values:
customRules: custom-rules.yaml: |- - rule: Shell spawned in container ...
Mode: alerts
Configure Falcosidekick to route Falco alerts to Slack, webhooks, or other outputs.
Steps:
- Install Falcosidekick alongside Falco:
helm upgrade --install falco falcosecurity/falco \ --namespace falco \ --create-namespace \ --set falcosidekick.enabled=true \ --set falcosidekick.webui.enabled=true \ -f examples/runtime-security/falcosidekick-values.yaml - Configure Slack output in Falcosidekick values:
falcosidekick: config: slack: webhookurl: "https://hooks.slack.com/services/<token>" minimumpriority: warning messageformat: > Alert: *{{ .Rule }}* (Priority: {{ .Priority }}) Container: `{{ index .OutputFields "container.name" }}` Image: `{{ index .OutputFields "container.image.repository" }}` - Verify alerts are routing:
kubectl port-forward -n falco svc/falco-falcosidekick-ui 2802:2802 # Open http://localhost:2802 — events appear in the UI - Deduplication: set
slack.minimumpriority: warningto suppress DEBUG/INFO noise
Mode: debug
If you need deeper context on any Falco component, load references/runtime-security.md.
Diagnose why a Falco rule is not firing.
Checklist (work through in order):
- Is Falco running?
kubectl get pods -n falco -o wide kubectl logs -n falco -l app.kubernetes.io/name=falco | tail -20 - Is the rule loaded?
kubectl logs -n falco -l app.kubernetes.io/name=falco | grep -i "Loading rules" kubectl exec -n falco daemonset/falco -- cat /etc/falco/rules.d/custom-rules.yaml 2>/dev/null \ || kubectl exec -n falco daemonset/falco -- ls /etc/falco/ - Is the condition correct? Test the event type:
kubectl exec -n falco daemonset/falco -- falco --validate /etc/falco/rules.d/custom-rules.yaml - Is the event being generated? Use event-generator for syscall rules:
kubectl run test --image=falcosecurity/event-generator --rm -it -- run syscall - Is the priority too low? If
falcosidekick.config.slack.minimumpriority: error, rules withpriority: WARNINGare silently dropped. Adjust priority or threshold. - Is there a macro override? Check if a built-in macro like
never_trueis shadowing your condition:kubectl exec -n falco daemonset/falco -- cat /etc/falco/falco_rules.yaml | grep -A3 "macro: <macro name>" kubectl exec -n falco daemonset/falco -- ls /etc/falco/rules.d/
Mode: harden
Map Falco runtime alerts to Kyverno admission policies to prevent redeployment of flagged workloads.
Steps:
- Explain the bridge pattern: Falco detects a runtime violation → alert metadata is added as a label/annotation to the offending Pod or Deployment → Kyverno admission policy blocks future admission of workloads with that label
- Label the offending workload (from an alert webhook handler or manual response):
kubectl label deployment <name> -n <namespace> \ security.platform/falco-alert=critical - Apply the Kyverno policy to block re-admission:
apiVersion: policies.kyverno.io/v1 kind: ValidatingPolicy metadata: name: block-falco-flagged-workloads spec: validationActions: [Deny] matchConstraints: resourceRules: - apiGroups: ["apps"] apiVersions: ["v1"] operations: ["CREATE", "UPDATE"] resources: ["deployments"] validations: - expression: > !has(object.metadata.labels) || !('security.platform/falco-alert' in object.metadata.labels) || object.metadata.labels['security.platform/falco-alert'] != 'critical' message: "Deployment is flagged by a Falco critical alert and cannot be re-admitted. Remove the flag after remediation." Important: Kyverno blocks new pod admissions only — it does not terminate existing running pods that violate the policy. After applying the policy, manually identify and terminate flagged pods:
# Find pods matching the label that triggered the alert kubectl get pods -n <namespace> -l <label-key>=<label-value> # Terminate with grace period to allow in-flight requests to drain kubectl delete pod <name> -n <namespace> --grace-period=30
- Remediation workflow: fix the workload → remove the label → re-admit
Recovery: If a Kyverno policy blocks a legitimate workload, remove the triggering label immediately:
kubectl label deployment <name> -n <namespace> security.platform/falco-alert-The workload will be re-admitted on next rollout. Fix the underlying security issue, then re-apply the label to re-admit under policy enforcement.
After completing this task, log errors and learnings via /platform-skills:self-improve log.
In this repository59 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/keda.mdcCursor rule
- .cursor/rules/kubernetes.mdcCursor rule
- .cursor/rules/platform-skills.mdcCursor rule
- .cursor/rules/terraform.mdcCursor rule
- code-reviewSkill
- platform-skillsSkill
- ai-governanceSkill
- awesome-docsSkill
- aws-profileSkill
- awsSkill
- azureSkill
- backup-drSkill
- chaosSkill
- checkovSkill
- cluster-upgradeSkill
- commitSkill
- complianceSkill
- composite-actionsSkill
- datadogSkill
- debugSkill
- documentSkill
- doraSkill
- dynatraceSkill
- finopsSkill
- fluxcdSkill
- gateway-apiSkill
- github-actionsSkill
- gitopsSkill
- helmchartSkill
- karpenterSkill
- kedaSkill
- kingfisherSkill
- kubernetesSkill
- kubescape-operatorSkill
- kubescapeSkill
- kyvernoSkill
- linkerdSkill
- linuxSkill
- mcpSkill
- observabilitySkill
- opaSkill
- openshiftSkill
- platform-skillsSkill
- preflightSkill
- productSkill
- progressive-deliverySkill
- pr-reviewSkill
- renovateSkill
- secretsSkill
- self-improveSkill
- setup-agentsSkill
- supply-chainSkill
- terraformSkill
- token-optimizerSkill
- triageSkill
- trivySkill
- zizmorSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

