Runtime Security 标志

Runtime Security

社区
nitinjain999
runtime-security

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".

概览

发布者nitinjain999
代码仓库platform-skills
技能名称runtime-security
星标数
71
复刻数
14
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 nitinjain999 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Runtime Security AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/nitinjain999/platform-skills/tree/main/plugins/platform-skills/skills/runtime-security
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nitinjain999/platform-skills.git /tmp/platform-skills
mkdir -p .claude/skills
cp -r /tmp/platform-skills/plugins/platform-skills/skills/runtime-security .claude/skills/runtime-security
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Runtime Security,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Runtime Security。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Runtime Security 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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
  • kubectl access to the target cluster
  • Node OS: Amazon Linux 2/2023 (EKS) or Container-Optimized OS (GKE) — both support eBPF

Steps:

  1. Add the Falco Helm repository:
    bash
    helm repo add falcosecurity https://falcosecurity.github.io/charts
    helm repo update
  2. Install Falco with eBPF driver (never kernel module on managed K8s):
    bash
    helm install falco falcosecurity/falco \
      --namespace falco \
      --create-namespace \
      -f examples/runtime-security/falco-values.yaml
  3. Verify DaemonSet is running on all nodes:
    bash
    kubectl rollout status daemonset/falco -n falco
    kubectl get pods -n falco -o wide
  4. Confirm Falco is receiving events:
    bash
    kubectl logs -n falco -l app.kubernetes.io/name=falco --tail=20
    Expected: lines like Notice 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:

  1. Explain the rule structure:
    yaml
    - 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]
  2. Key condition fields:
    • spawned_process — a new process was exec'd
    • container — event is inside a container (not on the host)
    • proc.name — process name
    • container.image.repository — image name without tag
    • fd.net — network file descriptor (for connection events)
  3. Test with falco-event-generator:
    bash
    kubectl run event-generator \
      --image=falcosecurity/event-generator \
      --restart=Never \
      --rm -it -- run syscall
    Then check logs: kubectl logs -n falco -l app.kubernetes.io/name=falco | grep WARNING
  4. Load custom rules via Helm values:
    yaml
    customRules:
      custom-rules.yaml: |-
        - rule: Shell spawned in container
          ...

Mode: alerts

Configure Falcosidekick to route Falco alerts to Slack, webhooks, or other outputs.

Steps:

  1. Install Falcosidekick alongside Falco:
    bash
    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
  2. Configure Slack output in Falcosidekick values:
    yaml
    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" }}`
  3. Verify alerts are routing:
    bash
    kubectl port-forward -n falco svc/falco-falcosidekick-ui 2802:2802
    # Open http://localhost:2802 — events appear in the UI
  4. Deduplication: set slack.minimumpriority: warning to 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):

  1. Is Falco running?
    bash
    kubectl get pods -n falco -o wide
    kubectl logs -n falco -l app.kubernetes.io/name=falco | tail -20
  2. Is the rule loaded?
    bash
    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/
  3. Is the condition correct? Test the event type:
    bash
    kubectl exec -n falco daemonset/falco -- falco --validate /etc/falco/rules.d/custom-rules.yaml
  4. Is the event being generated? Use event-generator for syscall rules:
    bash
    kubectl run test --image=falcosecurity/event-generator --rm -it -- run syscall
  5. Is the priority too low? If falcosidekick.config.slack.minimumpriority: error, rules with priority: WARNING are silently dropped. Adjust priority or threshold.
  6. Is there a macro override? Check if a built-in macro like never_true is shadowing your condition:
    bash
    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:

  1. 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
  2. Label the offending workload (from an alert webhook handler or manual response):
    bash
    kubectl label deployment <name> -n <namespace> \
      security.platform/falco-alert=critical
  3. Apply the Kyverno policy to block re-admission:
    yaml
    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."
  4. 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:

bash
# 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
  1. Remediation workflow: fix the workload → remove the label → re-admit

Recovery: If a Kyverno policy blocks a legitimate workload, remove the triggering label immediately:

bash
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.

常见问题

Runtime Security AI 技能有什么作用?

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".

为什么在 TypingMind 中使用 Runtime Security?

因为您只需安装一次,就能搭配任何模型使用。Runtime Security 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Runtime Security?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/nitinjain999/platform-skills/tree/main/plugins/platform-skills/skills/runtime-security。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Runtime Security?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Runtime Security 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Runtime Security 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Runtime Security AI 技能免费吗?

是的。nitinjain999 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇