pilot-compliance-audit
Use when Pilot is RENDERING A PERIODIC POLICY-CONFORMANCE REPORT for a compliance audit. Natural phrasings: "Pilot, run the quarterly compliance audit", "render the conformance report against policy", "audit our prod fleet against the security baseline", "produce the compliance evidence pack for the auditor", "Pilot, what are this quarter's policy violations + their evidence?". Pilot consumes cub-scout's scope-wide `compare source-truth` (per-resource verdicts under the declared strategy) + `scan` findings (risk-pattern matches) + (optional) per-resource receipts persisted to the local store, then synthesizes a compliance-shaped report with violations table + fingerprinted evidence inventory. Differs from `pilot-fleet-conformance` which is the SAME-VERBS-SAME-DAY operational verdict; this skill is the LONGER-CYCLE compliance shape — the output is a quarterly/monthly report with attached evidence inventory, not a real-time gate. Do NOT load for: a single-resource pre-deploy gate (use pilot-cd-gate), real-time event response (use pilot-watch-alert-response), incident close-out evidence (use pilot-incident-evidence), or a rollback decision (use pilot-rollback-decision).
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 14
- Forks
- 1
01 前言 Front Matter
- name
- pilot-compliance-audit
- phase
- cross-cutting
- description
- Use when Pilot is RENDERING A PERIODIC POLICY-CONFORMANCE REPORT for a compliance audit. Natural phrasings: "Pilot, run the quarterly compliance audit", "render the conformance report against policy", "audit our prod fleet against the security baseline", "produce the compliance evidence pack for the auditor", "Pilot, what are this quarter's policy violations + their evidence?". Pilot consumes cub-scout's scope-wide `compare source-truth` (per-resource verdicts under the declared strategy) + `scan` findings (risk-pattern matches) + (optional) per-resource receipts persisted to the local store, then synthesizes a compliance-shaped report with violations table + fingerprinted evidence inventory. Differs from `pilot-fleet-conformance` which is the SAME-VERBS-SAME-DAY operational verdict; this skill is the LONGER-CYCLE compliance shape — the output is a quarterly/monthly report with attached evidence inventory, not a real-time gate. Do NOT load for: a single-resource pre-deploy gate (use pilot-cd-gate), real-time event response (use pilot-watch-alert-response), incident close-out evidence (use pilot-incident-evidence), or a rollback decision (use pilot-rollback-decision).
- allowed-tools
- Bash(./cub-scout compare three-way *) Bash(cub-scout compare three-way *) Bash(cub scout compare three-way *) Bash(./cub-scout compare source-truth *) Bash(cub-scout compare source-truth *) Bash(cub scout compare source-truth *) Bash(./cub-scout compare drift *) Bash(cub-scout compare drift *) Bash(cub scout compare drift *) Bash(./cub-scout scan *) Bash(cub-scout scan *) Bash(cub scout scan *) Bash(./cub-scout patterns *) Bash(cub-scout patterns *) Bash(cub scout patterns *) Bash(./cub-scout fleet outliers *) Bash(cub-scout fleet outliers *) Bash(cub scout fleet outliers *) Bash(./cub-scout views resolve *) Bash(cub-scout views resolve *) Bash(cub scout views resolve *) Bash(./cub-scout views project *) Bash(cub-scout views project *) Bash(cub scout views project *) Bash(./cub-scout receipt verify *) Bash(cub-scout receipt verify *) Bash(cub scout receipt verify *) Bash(./cub-scout receipt list *) Bash(cub-scout receipt list *) Bash(cub scout receipt list *) Bash(./cub-scout receipt show *) Bash(cub-scout receipt show *) Bash(cub scout receipt show *) Bash(./cub-scout receipt validate *) Bash(cub-scout receipt validate *) Bash(cub scout receipt validate *) Bash(./cub-scout map list *) Bash(./cub-scout map workloads *) Bash(./cub-scout map orphans *) Bash(cub-scout map list *) Bash(cub-scout map workloads *) Bash(cub-scout map orphans *) Bash(cub scout map list *) Bash(cub scout map workloads *) Bash(cub scout map orphans *) Bash(./cub-scout audit *) Bash(cub-scout audit *) Bash(cub scout audit *) Bash(kubectl get *) Bash(kubectl describe *) Bash(cub space list *) Bash(cub unit get *) Bash(cub unit list *) Bash(cub link get *) Bash(cub link list *) Bash(cub view get *) Bash(cub view list *) Bash(cub unit-event list *) Bash(cub resource list *) Bash(cub release list *) Bash(cub changeset list *) Bash(cub view list)
03 SKILL.md 正文
pilot-compliance-audit
The periodic compliance-audit scenario from Pilot's side. A quarterly/monthly audit window opens; Pilot is asked to render a structured compliance report with per-resource violations + their fingerprinted evidence. The downstream consumer is the auditor (internal security/compliance team, external auditor, SOC 2 reviewer, regulator) — not the SRE team running the cluster.
Same cub-scout verbs as pilot-fleet-conformance, different framing: that skill is the operational verdict (today's snapshot, today's decision); this skill is the compliance shape (last quarter's evidence, an auditor's report). The output cadence is longer; the evidence-attachment requirement is stricter.
When to use
Explicit phrasings:
- "Pilot, run the quarterly compliance audit"
- "Render the conformance report against policy"
- "Audit our prod fleet against the security baseline"
- "Produce the compliance evidence pack for the auditor"
- "Pilot, what are this quarter's policy violations + their evidence?"
- "Generate the SOC 2 evidence inventory from cub-scout"
- "Compliance run for {policy/baseline name}"
Implicit intents:
- The cadence is periodic (quarterly, monthly), not real-time
- The audience is the auditor — an external or compliance-team reviewer who wants structured violations + fingerprinted evidence per violation
- The report needs to be fingerprint-stable — the auditor may re-validate any receipt months later
- The report rolls up across scope (View / namespace / cluster / fleet) — not a single resource
- Pilot's verdict per resource maps to a compliance category (Compliant / Compliant with caveats / Non-compliant / Insufficient evidence) — slightly different vocabulary from PASS/WATCH/ASK/BLOCK
Do not load for
- A single-resource pre-deploy gate —
pilot-cd-gate - The operational version of the same audit (same-day; not for the auditor) —
pilot-fleet-conformance. Same verbs; different framing. - A real-time event-driven response —
pilot-watch-alert-response - An incident close-out evidence pack —
pilot-incident-evidence - A rollback decision —
pilot-rollback-decision - A promotion safety check —
pilot-promotion-gate - Any mutating action. Compliance audits are read-only by design.
The Pilot ↔ cub-scout compliance loop
quarterly compliance window opens (cron / manual trigger)
│
▼
Pilot (acceptance judge in compliance-report mode)
│ "render Q2 2026 compliance report for view:prod-baseline"
│
├──► cub-scout views resolve <baseline-view> # scope confirmation
│
├──► For each resource in scope:
│ cub-scout compare source-truth <r> -n <ns> --strategy <s> --format json
│ cub-scout scan -n <ns> --format json # risk-pattern matches per resource
│ cub-scout receipt verify <r> -n <ns> --strategy <s> \
│ --save # fingerprinted, persisted to local store
│
├──► Cross-cluster (if View has cluster scope):
│ cub-scout fleet outliers --view <baseline-view> --format json
│
├──► Audit-trail layer:
│ cub-scout audit list --since 90d --format json # ConfigHub audit entries
│ cub-scout receipt list --format json # full receipt inventory
│
└──► (optional) chain ALL per-resource receipts under one aggregate:
# When #448 aggregate-with-discovery half ships, this collapses to one call.
# Until then: produce one receipt per resource; the report inventory links each.
│
▼
Pilot's compliance report:
│ Compliant resources: <list with PASS receipts>
│ Compliant-with-caveats resources: <list with WATCH receipts + proof_gaps>
│ Non-compliant resources: <list with BLOCK receipts + violation reason>
│ Insufficient-evidence resources: <list with INCONCLUSIVE receipts + omissions>
│ Audit-trail (last 90d): <ConfigHub change events that touched the scope>
│ Receipt inventory: <fingerprint-stable file paths per resource>
│
▼
auditor reads the report
│ Auditor can `cub-scout receipt validate <path>` any individual entry to confirm tamper-free
└────────────────────────────────────────────────────
Verdict mapping (cub-scout → compliance vocabulary)
Auditors typically don't speak PASS / WATCH / ASK / BLOCK. Map cub-scout's receipt verdicts to compliance vocabulary at the report-rendering layer:
| Receipt verdict | Compliance category | Auditor-facing meaning |
|---|---|---|
PASS |
Compliant | Evidence supports the claim against the declared strategy / baseline |
WATCH |
Compliant with caveats | Evidence is ambiguous; proof_gaps listed; the auditor can decide whether the gaps invalidate compliance |
BLOCK |
Non-compliant | Evidence contradicts the claim — a real violation |
INCONCLUSIVE |
Insufficient evidence | The receipt couldn't be built (missing strategy, missing input); the auditor needs the cube-scout-side fix or a manual review |
ASK is a source-truth status value, not a receipt verdict. When it surfaces during the audit, the wrapping receipt has verdict WATCH (per pkg/agent/receipt_predicates.go:396-407); Pilot's compliance report should list the auditor-facing meaning consistently.
Step-by-step
Step 1 — resolve the audit scope
A View is the canonical compliance scope (declared in ConfigHub via cub view create):
$ cub-scout views resolve https://hub.confighub.com/views/prod-baseline-q2-2026
View: prod-baseline-q2-2026
scope: cluster
columns: [team, service, source_truth_strategy, last_audited]
resolved at: 2026-05-22T22:00:00Z
Scope sources for compliance: ConfigHub Views (preferred — declared scope is auditable), namespace, cluster. Avoid ad-hoc resource lists for periodic compliance — they're harder to defend later.
Step 2 — per-resource source-truth + scan + receipt
# Per-resource source-truth verdict against the baseline's declared strategy
$ for r in $(cub-scout views project --view prod-baseline-q2-2026 --format json \
| jq -r '.[] | "\(.kind)/\(.name) -n \(.namespace)"'); do
cub-scout compare source-truth $r --strategy git-argo --format json \
> evidence/$r-source-truth.json
done
# Risk-pattern scan (CVE, expiring certs, dangling resources, etc.)
$ cub-scout scan --format json > evidence/scan-findings.json
# Fingerprinted per-resource receipts (immutable; survive the audit window)
$ for r in $(cub-scout views project --view prod-baseline-q2-2026 --format json \
| jq -r '.[] | "\(.kind)/\(.name) -n \(.namespace)"'); do
cub-scout receipt verify $r --strategy git-argo --save
done
Each receipt lands in the immutable local store ($CUB_SCOUT_RECEIPTS_DIR → $XDG_DATA_HOME → $HOME/.local/share/cub-scout/receipts) with a canonical filename. Auditors can validate any receipt months later with cub-scout receipt validate.
Step 3 — connected-mode audit trail layer
$ cub-scout audit list --since 90d --format json > evidence/confighub-audit.json
$ cub-scout fleet outliers --view prod-baseline-q2-2026 --format json > evidence/fleet-outliers.json
audit list (connected) captures break-glass accept/reject entries from ConfigHub — the human-decision audit trail that paired with the per-resource verdicts during the quarter. fleet outliers flags cross-cluster divergences against the baseline.
Step 4 — compose the report
Pilot's compliance report shape:
{
"report_type": "quarterly_compliance",
"audit_window": "Q2 2026 (2026-04-01 → 2026-06-30)",
"scope": "view:prod-baseline-q2-2026",
"declared_strategy": "git-argo",
"rollup": {
"compliant": 184,
"compliant_with_caveats": 12,
"non_compliant": 3,
"insufficient_evidence": 1
},
"non_compliant": [
{
"resource": "Deployment/payments-cron in prod-use1",
"verdict": "BLOCK",
"reason": "source_truth=MISMATCH; manual-edit detected on container image",
"receipt": "/path/to/receipts/2026-Q2/payments-cron.receipt.json"
},
{"resource": "Deployment/legacy-api in prod-euw1", "verdict": "BLOCK", "reason": "fleet outlier: missing per-cluster baseline", "receipt": "/path/to/..." }
],
"compliant_with_caveats": [
{"resource": "Deployment/api in prod-use1", "verdict": "WATCH", "proof_gaps": ["git-source-anchor unresolved: argocd CLI not installed"], "receipt": "/path/to/..."}
],
"insufficient_evidence": [
{"resource": "Deployment/legacy-tool in prod-use1", "verdict": "INCONCLUSIVE", "omissions": ["managedFields"], "receipt": "/path/to/..."}
],
"audit_trail_entries": "evidence/confighub-audit.json (90 entries)",
"scan_findings": "evidence/scan-findings.json (4 critical, 12 warning, 31 info)",
"fleet_outliers": "evidence/fleet-outliers.json (2 outliers)",
"evidence_inventory": "evidence/receipt-list.json (200 receipts; all fingerprint-verifiable)"
}
Step 5 — handoff + later re-validation
The auditor receives the report + the evidence/ directory. To validate any individual receipt:
$ cub-scout receipt validate evidence/non-compliant/payments-cron.receipt.json
# exit 0 = fingerprint intact; 1 = mismatch; 2 = I/O
$ cub-scout receipt show evidence/non-compliant/payments-cron.receipt.json --format ascii
# Renders the same evidence Pilot's report cited — tamper-evident
Pilot's report is only as durable as the receipt store — auditors typically want the evidence/ directory archived externally (S3, GitHub Release artifact, ConfigHub bundle catalog) for the retention period.
Worked example
Q2 2026 compliance run; scope = view:prod-baseline-q2-2026; strategy = git-argo.
$ mkdir -p evidence/{non-compliant,with-caveats,inconclusive}
# Per-resource receipts (saved to immutable store + linked into evidence/)
$ for r in $(cub-scout views project --view prod-baseline-q2-2026 --format json \
| jq -r '.[] | "\(.kind)/\(.name) -n \(.namespace)"'); do
cub-scout receipt verify $r --strategy git-argo --save 2>/dev/null
done
# Categorize by verdict
$ cub-scout receipt list --format json \
| jq '[.[] | select(.verdict == "BLOCK")]' > evidence/non-compliant.json
$ cub-scout receipt list --format json \
| jq '[.[] | select(.verdict == "WATCH")]' > evidence/with-caveats.json
$ cub-scout receipt list --format json \
| jq '[.[] | select(.verdict == "INCONCLUSIVE")]' > evidence/inconclusive.json
# Audit-trail + scan + fleet outliers
$ cub-scout audit list --since 90d --format json > evidence/audit.json
$ cub-scout scan --format json > evidence/scan.json
$ cub-scout fleet outliers --view prod-baseline-q2-2026 --format json > evidence/outliers.json
# Rollup
$ jq 'length' evidence/{non-compliant,with-caveats,inconclusive}.json
3
12
1
Pilot's report cites the 3 non-compliant resources by name + their receipts + their violation reasons; the WATCH/INCONCLUSIVE lists fill in the caveats; the audit-trail / scan / outliers layers give the auditor the cross-axis evidence. Total artifact count: 200 receipts (one per resource in scope) + 3 supporting JSON files. All fingerprint-verifiable.
Standalone vs connected
Connected mode is effectively required for compliance audits:
compare source-truth --strategy— connectedviews resolve/views project— connectedfleet outliers— connectedaudit list— connectedreceipt verify --strategy source-truth-pass— connected
Standalone-mode compliance is narrower (no View scope; no ConfigHub audit trail; no fleet-outlier dimension) and rarely useful for an external auditor. If standalone is the only option, Pilot's report should call out the limitation explicitly so the auditor knows what's missing.
Tool boundary
- Allowed (cub-scout): Compare verbs (read-only),
scan,patterns,fleet outliers,views resolve/project,receipt verify/show/validate/list,map,audit list. All read-only. - Allowed (cluster):
kubectl get/describe. NOTkubectl apply / edit / patch / delete. - Allowed (ConfigHub):
cub <entity> get / listfor the entities named in allowed-tools. NOTcub * create / update / delete. - Compliance audits are read-only by design. The audit produces evidence; remediation (re-aligning the non-compliant resources) is a separate operational decision, typically routed through
pilot-patch-and-driftorpilot-rollback-decision— those skills handle Pilot's mutation path. This skill stops at the report.
References
pilot-fleet-conformance— same verbs, operational (same-day) framing instead of compliance (periodic) framingscout-compare— Compare verbsscout-verify— receipt persistence + validationscout-govern— fleet, views, audit, summaryaudit-fleet-conformance— operator-side counterpartscout-attribute— per-field attribution for violation explainability- Source-truth contract:
#393,#418(Phase 2 strategies) - Receipts v1+v2:
#446(v1),#463(v2 surface) - Read-only triad:
references/read-only-triad.md
Constraints
- The audit is point-in-time: the report reflects the cluster + ConfigHub state at evaluation. Compliance frameworks that require continuous monitoring should pair this skill with
pilot-watch-alert-responsefor the event-driven side. - Receipts are fingerprint-stable but not signed in v1/v2 (
#463); cryptographic signing is a future hardening direction. Auditors who require non-repudiation need the future signing layer — flag this in the report. - The local receipt store at
$XDG_DATA_HOME/cub-scout/receiptsis per-host. For multi-host compliance pipelines, Pilot should archive each run'sevidence/directory externally (S3, ConfigHub bundle catalog, GitHub Release artifact) for the retention period. scancovers ~46 built-in risk patterns; bespoke policies (custom CIS benchmarks, SOC 2 controls) need either custom patterns (out of cub-scout scope) or a policy engine (Kyverno, OPA Gatekeeper) that this skill doesn't replace.- Compliance vocabulary (Compliant / Non-compliant) is the report-layer translation of receipt verdicts (PASS / BLOCK). cub-scout doesn't speak compliance vocabulary natively; Pilot's report renders the translation.
04 同仓库更多 Skills
异常工作负载故障分诊
triage-unhealthy-workload
当用户需要在时间压力下应对出现故障的 Kubernetes 工作负载时使用——例如寻呼告警响起、CI 飘红、“生产环境挂了”的场景。自然表述包括:“deploy/api 出现 CrashLoopBackOff,该怎么办?”“发布卡住了,帮帮我”“这个 pod 起不来”“支付服务触发了寻呼告警”“argocd 里全红了”“我应该先检查什么?”“给我一份针对这个工作负载的分诊方案”。它将 doctor → explain → trace 组合成一个紧凑的约 30 秒循环,运维人员可在已确认寻呼告警的上下文中执行。不要用于:没有紧迫性的计划性排查(直接使用 scout-diagnose)、漂移相关问题(使用 investigate-drift),或任何变更操作(cub-scout 从不做变更——应由用户主导,转由 kubectl 处理)。
资源证据收据生成与校验
scout-verify
当用户需要针对某个 Kubernetes 资源生成带类型、带指纹、不可篡改(TYPED、FINGERPRINTED、IMMUTABLE)的证据工件时使用——即 cub-scout 的 Verify 动词组(在 #446 中发布的收据能力)。自然表述包括:“出具一份证明此资源合规的收据”“给我一份证明集群与 Git 一致的证明”“我需要一份可用于审计跟踪的可验证记录”“生成一份收据,证明自部署以来没有人工改动”“对照事实源(source-truth)校验 deploy/api 并保存工件”“验证此收据未被篡改”“展示我们有哪些收据”“此收据是否被篡改过?”“把证据附加到我的 CI 关卡”。当意图涉及 receipt / attestation / evidence-artifact / tamper-evident-record / verified-record / audit-trail / postmortem-evidence / acceptance-judge-input 时均应加载。不要用于:不落盘工件的实时比对(使用 scout-compare)、解读单个字段的来源出处(使用 scout-attribute),或真正实施修复(cub-scout 从不做变更——应由用户主导,转由 cub / argocd / kubectl 处理)。
scout-observe
Use when the user wants to SEE what is running in a Kubernetes cluster, who owns it, and how it is structured — the read-only Observe verb group of cub-scout. Natural phrasing: "what is running in my cluster?", "give me a map of resources", "who owns this Deployment?", "trace this back to its source", "show me the ownership tree", "scan this cluster for risk", "dump the cluster as JSON", "stream cluster events", "run cub-scout as a bot", "what is the connection status?", "is this cluster healthy?". Load when intent is observe / inventory / map / show / list / trace / scan / dump / stream / bot / health-check over a Kubernetes cluster. Do NOT load for: explaining WHY something is broken (use scout-diagnose), comparing cluster state to intended state (use scout-compare), provenance of individual field values (use scout-attribute), or any action that mutates the cluster (cub-scout never mutates — route to cub or kubectl with the user driving).
scout-mcp
Use when the user wants to expose cub-scout to an AI agent over MCP, wants a deterministic AI-ready snapshot of cluster context, or wants cub-scout running as a read-only event bot — the Integrate verb group. Natural phrasing: "start the MCP server", "expose cub-scout to Claude / Codex / my agent", "give me an AI-ready context pack of this cluster", "set up the MCP gateway", "what MCP tools does cub-scout expose?", "run cub-scout as a bot", "produce JSON context for an LLM to reason about this cluster". Load whenever intent is mcp / mcp-gateway / mcp-serve / context-pack / bot / agent-context / ai-snapshot / llm-context / model-context-protocol. Do NOT load for: actually running a non-integrate verb (those are scout-observe / scout-diagnose / scout-compare / scout-attribute / scout-ingest / scout-govern / scout-verify), or `cub` MCP integration (that's a separate tool surface).
scout-ingest
Use when the user wants to ADOPT existing Kubernetes / GitOps workload structure into ConfigHub after observing the live cluster — the adoption/import verb group of cub-scout. Natural phrasing: "discover workloads in this cluster and propose ConfigHub units", "show me the import proposal before I apply", "import this Argo Application set", "bring my Flux Kustomizations into ConfigHub", "preview what would land in ConfigHub if I imported this repo", "parse my git repo as a ConfigHub import bundle", "import a cluster aggregator", "what would --git-path produce for this repo?". Load whenever intent is adopt / import / ingest / preview / propose / parse-repo / discovery / aggregator / bring-into-confighub / what-would-confighub-see. Do NOT load for: questions about who changed a resource, whether it was edited by hand or drifted (use scout-attribute or investigate-drift); reading an exported `kubectl get -o yaml` dump to answer a question about the cluster (that is not an import); basic live-cluster inventory (use scout-observe), troubleshooting (use scout-diagnose), comparing live state to ConfigHub (use scout-compare), or the actual write to ConfigHub via `cub variant upload` (that is `cub`, not cub-scout — route to cub skills). Important: `cub-scout import apply` IS the mutating write into ConfigHub — this skill teaches the read-only preview path and explicitly refuses to invoke `import apply` itself.
ConfigHub 治理信号查询
scout-govern
当用户希望从 cub-scout 获取已连接的(CONNECTED)ConfigHub 治理信号时使用该技能 —— Govern(治理)动词组。自然表述:"给我看这个单元的 ChangeSet 历史"、"如果我修改这个单元,影响范围(blast radius)有多大?"、"我的机群中哪些集群是异常值?"、"给我看昨天的连接摘要"、"在整个机群中呈现这个视图"、"审计谁修改了这个"、"上一次应用来自哪里?"、"列出我拥有的 ConfigHub bundle"、"给我看过往快照的目录"。当意图为历史 / 影响 / 影响范围 / 机群异常 / 摘要 / 视图 / 审计 / bundle / 目录 / 连接上下文时加载。不要用于:实时集群比较(使用 scout-compare)、回执(使用 scout-verify)、正在运行的 Pod 清单(使用 scout-observe),或通过 cub 进行的任何修改。该技能的大部分功能需要 `cub auth login` —— 请提前说明。