oh-my-agent-commandcode 0.0.0-stage → 20.38.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/filter-test-output.sh +52 -0
- package/mods/oma.ts +347 -0
- package/package.json +30 -4
- package/skills/_shared/conditional/experiment-ledger.md +28 -0
- package/skills/_shared/conditional/exploration-loop.md +22 -0
- package/skills/_shared/conditional/quality-score.md +33 -0
- package/skills/_shared/core/anti-ai-prose.md +191 -0
- package/skills/_shared/core/api-contracts/README.md +28 -0
- package/skills/_shared/core/api-contracts/template.md +90 -0
- package/skills/_shared/core/clarification-protocol.md +23 -0
- package/skills/_shared/core/code-intelligence.md +46 -0
- package/skills/_shared/core/collaboration-policy.md +28 -0
- package/skills/_shared/core/common-checklist.md +28 -0
- package/skills/_shared/core/context-budget.md +22 -0
- package/skills/_shared/core/context-loading.md +34 -0
- package/skills/_shared/core/difficulty-guide.md +26 -0
- package/skills/_shared/core/execution-policy.md +31 -0
- package/skills/_shared/core/lessons-learned.md +33 -0
- package/skills/_shared/core/prompt-structure.md +18 -0
- package/skills/_shared/core/quality-principles.md +11 -0
- package/skills/_shared/core/session-metrics.md +35 -0
- package/skills/_shared/core/skill-routing.md +39 -0
- package/skills/_shared/core/test-approach.md +54 -0
- package/skills/_shared/core/vendor-detection.md +52 -0
- package/skills/_shared/runtime/memory-protocol.md +118 -0
- package/skills/_shared/runtime/result-contract.md +64 -0
- package/skills/_shared/ui-interaction-quality.md +133 -0
- package/skills/oma-academic-writing/SKILL.md +181 -0
- package/skills/oma-academic-writing/resources/abstract-guide.md +51 -0
- package/skills/oma-academic-writing/resources/academic-verb-tiers.md +42 -0
- package/skills/oma-academic-writing/resources/anti-ai-checklist.md +52 -0
- package/skills/oma-academic-writing/resources/hedging-guide.md +132 -0
- package/skills/oma-academic-writing/resources/sentence-structure-reference.md +151 -0
- package/skills/oma-architecture/SKILL.md +203 -0
- package/skills/oma-architecture/resources/api-evolution.md +41 -0
- package/skills/oma-architecture/resources/checklist.md +42 -0
- package/skills/oma-architecture/resources/execution-protocol.md +115 -0
- package/skills/oma-architecture/resources/methodology-selection.md +92 -0
- package/skills/oma-architecture/resources/migration-patterns.md +28 -0
- package/skills/oma-architecture/resources/output-templates.md +111 -0
- package/skills/oma-architecture/resources/stakeholder-synthesis.md +80 -0
- package/skills/oma-backend/SKILL.md +202 -0
- package/skills/oma-backend/resources/checklist.md +45 -0
- package/skills/oma-backend/resources/error-playbook.md +97 -0
- package/skills/oma-backend/resources/execution-protocol.md +39 -0
- package/skills/oma-backend/resources/orm-reference.md +61 -0
- package/skills/oma-backend/variants/node/api-template.ts +315 -0
- package/skills/oma-backend/variants/node/snippets.md +475 -0
- package/skills/oma-backend/variants/node/stack.yaml +21 -0
- package/skills/oma-backend/variants/node/tech-stack.md +33 -0
- package/skills/oma-backend/variants/python/api-template.py +378 -0
- package/skills/oma-backend/variants/python/snippets.md +199 -0
- package/skills/oma-backend/variants/python/stack.yaml +18 -0
- package/skills/oma-backend/variants/python/tech-stack.md +45 -0
- package/skills/oma-backend/variants/rust/api-template.rs +635 -0
- package/skills/oma-backend/variants/rust/snippets.md +471 -0
- package/skills/oma-backend/variants/rust/stack.yaml +20 -0
- package/skills/oma-backend/variants/rust/tech-stack.md +36 -0
- package/skills/oma-backend/variants/stack.schema.json +73 -0
- package/skills/oma-brainstorm/SKILL.md +166 -0
- package/skills/oma-brainstorm/resources/triz-lite.md +117 -0
- package/skills/oma-coordination/SKILL.md +171 -0
- package/skills/oma-db/SKILL.md +201 -0
- package/skills/oma-db/resources/anti-patterns.md +177 -0
- package/skills/oma-db/resources/checklist.md +67 -0
- package/skills/oma-db/resources/document-templates.md +107 -0
- package/skills/oma-db/resources/error-playbook.md +50 -0
- package/skills/oma-db/resources/examples.md +170 -0
- package/skills/oma-db/resources/execution-protocol.md +127 -0
- package/skills/oma-db/resources/iso-controls.md +98 -0
- package/skills/oma-db/resources/migration-playbook.md +93 -0
- package/skills/oma-db/resources/query-tuning.md +57 -0
- package/skills/oma-db/resources/vector-db.md +159 -0
- package/skills/oma-debug/SKILL.md +146 -0
- package/skills/oma-debug/resources/bug-report-template.md +327 -0
- package/skills/oma-debug/resources/checklist.md +31 -0
- package/skills/oma-debug/resources/common-patterns.md +734 -0
- package/skills/oma-debug/resources/debugging-checklist.md +364 -0
- package/skills/oma-debug/resources/error-playbook.md +94 -0
- package/skills/oma-debug/resources/execution-protocol.md +40 -0
- package/skills/oma-design/SKILL.md +135 -0
- package/skills/oma-design/resources/asset-strategy.md +34 -0
- package/skills/oma-design/resources/checklist.md +63 -0
- package/skills/oma-design/resources/data-grid.md +48 -0
- package/skills/oma-design/resources/design-md-spec.md +107 -0
- package/skills/oma-design/resources/design-tokens.md +53 -0
- package/skills/oma-design/resources/error-playbook.md +18 -0
- package/skills/oma-design/resources/execution-protocol.md +95 -0
- package/skills/oma-design/resources/external-design-skills.md +130 -0
- package/skills/oma-design/resources/getdesign-fetcher.md +104 -0
- package/skills/oma-design/resources/product-interface-review.md +59 -0
- package/skills/oma-design/resources/redesign-protocol.md +52 -0
- package/skills/oma-design/resources/stitch-integration.md +244 -0
- package/skills/oma-dev-workflow/SKILL.md +375 -0
- package/skills/oma-dev-workflow/resources/affected-checks.py +58 -0
- package/skills/oma-dev-workflow/resources/api-workflows.md +58 -0
- package/skills/oma-dev-workflow/resources/database-patterns.md +107 -0
- package/skills/oma-dev-workflow/resources/i18n-patterns.md +63 -0
- package/skills/oma-dev-workflow/resources/release-coordination.md +240 -0
- package/skills/oma-dev-workflow/resources/tooling-profiles.md +217 -0
- package/skills/oma-dev-workflow/resources/troubleshooting.md +78 -0
- package/skills/oma-dev-workflow/resources/validation-pipeline.md +246 -0
- package/skills/oma-docs/SKILL.md +77 -0
- package/skills/oma-docs/resources/commands.md +76 -0
- package/skills/oma-explanation/SKILL.md +212 -0
- package/skills/oma-explanation/resources/document-structure.md +115 -0
- package/skills/oma-explanation/resources/draft-format.md +199 -0
- package/skills/oma-explanation/resources/html-contract.md +102 -0
- package/skills/oma-frontend/SKILL.md +227 -0
- package/skills/oma-frontend/resources/angular-rules.md +110 -0
- package/skills/oma-frontend/resources/checklist.md +76 -0
- package/skills/oma-frontend/resources/error-playbook.md +125 -0
- package/skills/oma-frontend/resources/execution-protocol.md +46 -0
- package/skills/oma-frontend/resources/snippets.md +354 -0
- package/skills/oma-frontend/resources/specialized-visual-implementation.md +193 -0
- package/skills/oma-frontend/resources/tailwind-rules.md +83 -0
- package/skills/oma-frontend/resources/tech-stack.md +156 -0
- package/skills/oma-hwp/SKILL.md +166 -0
- package/skills/oma-hwp/config/hwp-config.yaml +35 -0
- package/skills/oma-hwp/resources/balanced-tables.ts +39 -0
- package/skills/oma-hwp/resources/execution-protocol.md +145 -0
- package/skills/oma-hwp/resources/flatten-tables.ts +101 -0
- package/skills/oma-hwp/resources/package.json +13 -0
- package/skills/oma-hwp/resources/troubleshooting.md +70 -0
- package/skills/oma-hwp/resources/tsconfig.json +10 -0
- package/skills/oma-hwp/resources/turndown-plugin-gfm.d.ts +9 -0
- package/skills/oma-image/SKILL.md +142 -0
- package/skills/oma-image/config/image-config.yaml +70 -0
- package/skills/oma-image/resources/checklist.md +18 -0
- package/skills/oma-image/resources/execution-protocol.md +117 -0
- package/skills/oma-image/resources/invocation.md +105 -0
- package/skills/oma-image/resources/prompt-tips.md +71 -0
- package/skills/oma-image/resources/vendor-matrix.md +90 -0
- package/skills/oma-market/SKILL.md +142 -0
- package/skills/oma-market/resources/checklist.md +12 -0
- package/skills/oma-market/resources/error-playbook.md +12 -0
- package/skills/oma-market/resources/execution-protocol.md +60 -0
- package/skills/oma-market/resources/frameworks/pestel.md +101 -0
- package/skills/oma-market/resources/frameworks/porters-5f.md +90 -0
- package/skills/oma-market/resources/frameworks/swot.md +61 -0
- package/skills/oma-market/resources/intent-rules.md +35 -0
- package/skills/oma-market/resources/output-laws.md +53 -0
- package/skills/oma-mobile/SKILL.md +168 -0
- package/skills/oma-mobile/resources/checklist.md +77 -0
- package/skills/oma-mobile/resources/error-playbook.md +198 -0
- package/skills/oma-mobile/resources/execution-protocol.md +47 -0
- package/skills/oma-mobile/resources/screen-template.dart +331 -0
- package/skills/oma-mobile/resources/screen-template.swift +239 -0
- package/skills/oma-mobile/resources/screen-template.tsx +179 -0
- package/skills/oma-mobile/resources/tech-stack.md +69 -0
- package/skills/oma-mobile/variants/README.md +45 -0
- package/skills/oma-mobile/variants/flutter/api-template.dart +461 -0
- package/skills/oma-mobile/variants/flutter/snippets.md +1353 -0
- package/skills/oma-mobile/variants/flutter/stack.yaml +21 -0
- package/skills/oma-mobile/variants/flutter/tech-stack.md +201 -0
- package/skills/oma-mobile/variants/kotlin-android/api-template.kt +182 -0
- package/skills/oma-mobile/variants/kotlin-android/snippets.md +871 -0
- package/skills/oma-mobile/variants/kotlin-android/stack.yaml +32 -0
- package/skills/oma-mobile/variants/kotlin-android/tech-stack.md +159 -0
- package/skills/oma-mobile/variants/react-native/api-template.ts +531 -0
- package/skills/oma-mobile/variants/react-native/snippets.md +1014 -0
- package/skills/oma-mobile/variants/react-native/stack.yaml +22 -0
- package/skills/oma-mobile/variants/react-native/tech-stack.md +192 -0
- package/skills/oma-mobile/variants/stack.schema.json +68 -0
- package/skills/oma-mobile/variants/swift-ios/api-template.swift +165 -0
- package/skills/oma-mobile/variants/swift-ios/snippets.md +1028 -0
- package/skills/oma-mobile/variants/swift-ios/stack.yaml +25 -0
- package/skills/oma-mobile/variants/swift-ios/tech-stack.md +174 -0
- package/skills/oma-observability/SKILL.md +225 -0
- package/skills/oma-observability/resources/anti-patterns.md +555 -0
- package/skills/oma-observability/resources/boundaries/cross-application.md +348 -0
- package/skills/oma-observability/resources/boundaries/multi-tenant.md +290 -0
- package/skills/oma-observability/resources/boundaries/release.md +372 -0
- package/skills/oma-observability/resources/boundaries/slo.md +225 -0
- package/skills/oma-observability/resources/checklist.md +123 -0
- package/skills/oma-observability/resources/examples.md +448 -0
- package/skills/oma-observability/resources/execution-protocol.md +166 -0
- package/skills/oma-observability/resources/incident-forensics.md +348 -0
- package/skills/oma-observability/resources/intent-rules.md +307 -0
- package/skills/oma-observability/resources/layers/L3-network.md +281 -0
- package/skills/oma-observability/resources/layers/L4-transport.md +299 -0
- package/skills/oma-observability/resources/layers/L7-application/crash-analytics.md +359 -0
- package/skills/oma-observability/resources/layers/L7-application/mobile-rum.md +278 -0
- package/skills/oma-observability/resources/layers/L7-application/waf.md +246 -0
- package/skills/oma-observability/resources/layers/L7-application/web-rum.md +350 -0
- package/skills/oma-observability/resources/layers/mesh.md +368 -0
- package/skills/oma-observability/resources/matrix.md +177 -0
- package/skills/oma-observability/resources/meta-observability.md +605 -0
- package/skills/oma-observability/resources/observability-as-code.md +666 -0
- package/skills/oma-observability/resources/signals/audit.md +310 -0
- package/skills/oma-observability/resources/signals/cost.md +303 -0
- package/skills/oma-observability/resources/signals/logs.md +263 -0
- package/skills/oma-observability/resources/signals/metrics.md +478 -0
- package/skills/oma-observability/resources/signals/privacy.md +351 -0
- package/skills/oma-observability/resources/signals/profiles.md +245 -0
- package/skills/oma-observability/resources/signals/traces.md +360 -0
- package/skills/oma-observability/resources/standards.md +214 -0
- package/skills/oma-observability/resources/transport/collector-topology.md +308 -0
- package/skills/oma-observability/resources/transport/otlp-grpc-vs-http.md +256 -0
- package/skills/oma-observability/resources/transport/sampling-recipes.md +297 -0
- package/skills/oma-observability/resources/transport/udp-statsd-mtu.md +167 -0
- package/skills/oma-observability/resources/vendor-categories.md +352 -0
- package/skills/oma-orchestration/SKILL.md +302 -0
- package/skills/oma-orchestration/config/cli-config.yaml +92 -0
- package/skills/oma-orchestration/resources/memory-schema.md +232 -0
- package/skills/oma-orchestration/resources/subagent-prompt-template.md +30 -0
- package/skills/oma-orchestration/scripts/parallel-run.sh +6 -0
- package/skills/oma-orchestration/scripts/spawn-agent.sh +5 -0
- package/skills/oma-orchestration/scripts/verify.sh +20 -0
- package/skills/oma-orchestration/templates/backend-task.md +19 -0
- package/skills/oma-orchestration/templates/debug-task.md +16 -0
- package/skills/oma-orchestration/templates/frontend-task.md +18 -0
- package/skills/oma-orchestration/templates/mobile-task.md +18 -0
- package/skills/oma-orchestration/templates/qa-task.md +16 -0
- package/skills/oma-orchestration/templates/tasks-example.yaml +15 -0
- package/skills/oma-pdf/SKILL.md +162 -0
- package/skills/oma-pdf/config/pdf-config.yaml +27 -0
- package/skills/oma-pdf/resources/execution-protocol.md +127 -0
- package/skills/oma-pm/SKILL.md +157 -0
- package/skills/oma-pm/resources/error-playbook.md +75 -0
- package/skills/oma-pm/resources/examples.md +439 -0
- package/skills/oma-pm/resources/execution-protocol.md +62 -0
- package/skills/oma-pm/resources/iso-planning.md +110 -0
- package/skills/oma-pm/resources/plan-phase-protocol.md +66 -0
- package/skills/oma-pm/resources/task-template.json +86 -0
- package/skills/oma-qa/SKILL.md +141 -0
- package/skills/oma-qa/resources/checklist.md +339 -0
- package/skills/oma-qa/resources/error-playbook.md +98 -0
- package/skills/oma-qa/resources/execution-protocol.md +169 -0
- package/skills/oma-qa/resources/iso-quality.md +82 -0
- package/skills/oma-qa/resources/verify-ship-protocol.md +116 -0
- package/skills/oma-recap/SKILL.md +245 -0
- package/skills/oma-recap/resources/output-formats.md +83 -0
- package/skills/oma-refactor/SKILL.md +184 -0
- package/skills/oma-refactor/resources/definition.md +108 -0
- package/skills/oma-refactor/resources/governance.md +33 -0
- package/skills/oma-refactor/resources/hotspots.py +44 -0
- package/skills/oma-refactor/resources/measurement.md +93 -0
- package/skills/oma-scholar/SKILL.md +276 -0
- package/skills/oma-scholar/config/scholar-config.yaml +79 -0
- package/skills/oma-scholar/resources/api-endpoints.md +174 -0
- package/skills/oma-scholar/resources/checklist.md +92 -0
- package/skills/oma-scholar/resources/execution-protocol.md +224 -0
- package/skills/oma-scholar/resources/fallback-providers.md +143 -0
- package/skills/oma-scholar/resources/setup-openalex.md +85 -0
- package/skills/oma-scholar/resources/sidecar-spec.md +341 -0
- package/skills/oma-scholar/resources/upstream-spec-cache.md +972 -0
- package/skills/oma-scm/SKILL.md +103 -0
- package/skills/oma-scm/resources/cm-operations.md +56 -0
- package/skills/oma-scm/resources/codeowners-playbook.md +45 -0
- package/skills/oma-scm/resources/conventional-commits.md +108 -0
- package/skills/oma-scm/resources/merge-risk.md +76 -0
- package/skills/oma-scm/resources/onboarding-risk-signals.md +71 -0
- package/skills/oma-search/SKILL.md +125 -0
- package/skills/oma-search/resources/checklist.md +36 -0
- package/skills/oma-search/resources/error-playbook.md +66 -0
- package/skills/oma-search/resources/examples.md +80 -0
- package/skills/oma-search/resources/execution-protocol.md +86 -0
- package/skills/oma-search/resources/intent-rules.md +47 -0
- package/skills/oma-search/resources/trust-registry.md +53 -0
- package/skills/oma-security/SKILL.md +172 -0
- package/skills/oma-security/resources/artex.md +108 -0
- package/skills/oma-security/resources/ci.md +134 -0
- package/skills/oma-security/resources/cisco-source.md +108 -0
- package/skills/oma-security/resources/deepsec-config.md +45 -0
- package/skills/oma-security/resources/deepsec-matchers.md +35 -0
- package/skills/oma-security/resources/deepsec-scanning.md +45 -0
- package/skills/oma-security/resources/deepsec-setup.md +41 -0
- package/skills/oma-security/resources/findings-contract.md +408 -0
- package/skills/oma-security/resources/mcp-scanning.md +122 -0
- package/skills/oma-security/resources/skill-scanning.md +106 -0
- package/skills/oma-security/resources/validation.md +71 -0
- package/skills/oma-skill-creation/SKILL.md +84 -0
- package/skills/oma-skill-creation/resources/prompt-evaluation.md +36 -0
- package/skills/oma-skill-creation/resources/ssl-lite-template.md +108 -0
- package/skills/oma-skill-creation/resources/validation-checklist.md +101 -0
- package/skills/oma-slide/SKILL.md +277 -0
- package/skills/oma-slide/resources/animation-patterns.md +245 -0
- package/skills/oma-slide/resources/assets/deck-stage.js +514 -0
- package/skills/oma-slide/resources/assets/viewport-base.css +257 -0
- package/skills/oma-slide/resources/canva-integration.md +203 -0
- package/skills/oma-slide/resources/checklist.md +46 -0
- package/skills/oma-slide/resources/design-doctrine.md +260 -0
- package/skills/oma-slide/resources/fixed-stage.md +232 -0
- package/skills/oma-slide/resources/generation-protocol.md +393 -0
- package/skills/oma-slide/resources/native-pptx.md +84 -0
- package/skills/oma-slide/resources/selection-index.json +461 -0
- package/skills/oma-slide/resources/style-presets.LICENSE +10 -0
- package/skills/oma-slide/resources/style-presets.md +520 -0
- package/skills/oma-tf-infra/SKILL.md +201 -0
- package/skills/oma-tf-infra/resources/checklist.md +53 -0
- package/skills/oma-tf-infra/resources/cost-optimization.md +574 -0
- package/skills/oma-tf-infra/resources/error-playbook.md +68 -0
- package/skills/oma-tf-infra/resources/examples.md +38 -0
- package/skills/oma-tf-infra/resources/execution-protocol.md +129 -0
- package/skills/oma-tf-infra/resources/iso-42001-infra.md +229 -0
- package/skills/oma-tf-infra/resources/multi-cloud-examples.md +241 -0
- package/skills/oma-tf-infra/resources/policy-testing-examples.md +332 -0
- package/skills/oma-translation/SKILL.md +229 -0
- package/skills/oma-translation/resources/anti-ai-patterns.md +104 -0
- package/skills/oma-translation/resources/lang/_template.md +73 -0
- package/skills/oma-translation/resources/lang/en.md +123 -0
- package/skills/oma-translation/resources/lang/ja.md +274 -0
- package/skills/oma-translation/resources/lang/ko.md +228 -0
- package/skills/oma-translation/resources/lang/zh.md +285 -0
- package/skills/oma-translation/resources/style-skills.md +104 -0
- package/skills/oma-translation/resources/translation-rubric.md +126 -0
- package/skills/oma-video/SKILL.md +229 -0
- package/skills/oma-video/config/video-config.yaml +60 -0
- package/skills/oma-video/resources/checklist.md +26 -0
- package/skills/oma-video/resources/execution-protocol.md +122 -0
- package/skills/oma-video/resources/existing-media.md +185 -0
- package/skills/oma-video/resources/hyperframes-authoring/README.md +44 -0
- package/skills/oma-video/resources/hyperframes-authoring/demo.md +31 -0
- package/skills/oma-video/resources/hyperframes-authoring/explainer.md +10 -0
- package/skills/oma-video/resources/hyperframes-authoring/shorts.md +10 -0
- package/skills/oma-video/resources/motion-principles.md +81 -0
- package/skills/oma-video/resources/mpt/driver.py +301 -0
- package/skills/oma-video/resources/prompt-tips.md +75 -0
- package/skills/oma-video/resources/script-schema.md +81 -0
- package/skills/oma-video/resources/sound-design.md +127 -0
- package/skills/oma-video/resources/strudel/package.json +11 -0
- package/skills/oma-video/resources/strudel/page.html +87 -0
- package/skills/oma-video/resources/strudel/render.mjs +295 -0
- package/skills/oma-video/resources/vendor-matrix.md +124 -0
- package/skills/oma-voice/SKILL.md +249 -0
- package/skills/oma-voice/config/voice-config.yaml +30 -0
- package/skills/oma-voice/resources/audio-processing.md +119 -0
- package/skills/oma-voice/resources/checklist.md +47 -0
- package/skills/oma-voice/resources/execution-protocol.md +215 -0
- package/skills/oma-voice/resources/prompt-tips.md +43 -0
- package/skills/oma-voice/resources/voice-matrix.md +51 -0
- package/skills/oma-voice/resources/voicestudio.md +87 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
---
|
|
2
|
+
otel_semconv: "1.43.0 (2026-07); security.* namespace: Development/proposed"
|
|
3
|
+
tools:
|
|
4
|
+
- "Falco: v0.38+ (CNCF Graduated); rekor: v1.x (sigstore)"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Audit Signal Reference
|
|
8
|
+
|
|
9
|
+
## 1. Scope & Distinction
|
|
10
|
+
|
|
11
|
+
Audit trails answer **who did what when**; immutable evidence for compliance, legal hold, and forensic investigation. They are a distinct signal from both operational logs (`logs.md`) and privacy records (`privacy.md`).
|
|
12
|
+
|
|
13
|
+
### Integrity and privacy requirements
|
|
14
|
+
|
|
15
|
+
| Dimension | Audit | Privacy |
|
|
16
|
+
|------------------|----------------------------------------|----------------------------------------|
|
|
17
|
+
| Retention goal | Preserve required evidence for the applicable schedule | Minimize collection and assess erasure grounds/exceptions |
|
|
18
|
+
| Storage model | Tamper protection; WORM when required by the selected control | Controls that honor eligible erasure and justified retention |
|
|
19
|
+
| Consumers | Auditors, legal, compliance officers | Data subjects, DPO, engineering |
|
|
20
|
+
| Default posture | Collect necessary evidence; expire under a justified schedule | Collect only justified personal data |
|
|
21
|
+
|
|
22
|
+
Audit and privacy are separate concerns, but both apply to personal data in an audit trail. Specify the legal basis, required evidence, access controls, retention period, and erasure exceptions together.
|
|
23
|
+
|
|
24
|
+
### Distinction from operational logs (`logs.md`)
|
|
25
|
+
|
|
26
|
+
| Dimension | Operational logs | Audit events |
|
|
27
|
+
|-----------------|-------------------------------------|----------------------------------------|
|
|
28
|
+
| Retention | Purpose-specific operational schedule | Law/contract/evidence-specific schedule (Section 7) |
|
|
29
|
+
| Consumers | On-call engineers, SRE | Auditors, legal, compliance |
|
|
30
|
+
| Mutability | May be rotated and purged | Protected against unauthorized alteration; WORM when required |
|
|
31
|
+
| Storage | Loki / Elasticsearch / ClickHouse | Access-controlled evidence store with selected integrity/retention controls |
|
|
32
|
+
| Primary tools | Fluent Bit, OTel Collector | Falco, auditd, pgaudit, audit pipeline |
|
|
33
|
+
|
|
34
|
+
Cross-ref `../meta-observability.md §Retention Matrix` for unified policy across all signals.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Regulatory Drivers
|
|
39
|
+
|
|
40
|
+
| Framework | Relevant controls | Audit requirement |
|
|
41
|
+
|-----------|-------------------|-------------------|
|
|
42
|
+
| **SOC 2 (Type I/II)** | CC7.2 monitoring activities; CC7.3 incident response | Evidence supporting the selected monitoring/response controls; scope and protection depend on the engagement |
|
|
43
|
+
| **ISO/IEC 27001:2022** | A.8.15 logging; A.8.16 monitoring | Log protection, log administrator access control |
|
|
44
|
+
| **ISO/IEC 27002:2022** | 8.15 logging controls | Protect logs from tampering and unauthorized access |
|
|
45
|
+
| **HIPAA Security Rule** | §164.312(b) audit controls; §164.316(b) documentation | Audit mechanisms for ePHI; retain required security documentation for 6 years, not a blanket 6-year rule for every raw log |
|
|
46
|
+
| **PCI DSS v4.0** | Requirement 10; track and monitor all access to cardholder data | 1 year online + offline retention; tamper detection |
|
|
47
|
+
| **GDPR Art. 30** | Records of processing activities | Audit of data processing operations |
|
|
48
|
+
|
|
49
|
+
Cross-ref `../standards.md §ISO/IEC 27001/27002` for the normative standards baseline.
|
|
50
|
+
|
|
51
|
+
Sources: [iso.org/standard/27001](https://www.iso.org/standard/27001) · [aicpa.org SOC 2](https://www.aicpa.org/soc2) · [hhs.gov HIPAA](https://www.hhs.gov/hipaa/for-professionals/security/index.html) · [pcisecuritystandards.org PCI DSS v4.0](https://www.pcisecuritystandards.org)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Audit Event Categories
|
|
56
|
+
|
|
57
|
+
| Category | Examples | Regulatory driver |
|
|
58
|
+
|----------|----------|-------------------|
|
|
59
|
+
| **Authentication** | Login success/failure, MFA challenge, password change, session create/destroy | SOC 2 CC7.2, ISO A.8.15 |
|
|
60
|
+
| **Authorization** | Permission grants, role changes, scope escalation, RBAC mutations | SOC 2 CC7.2, PCI DSS 10.2 |
|
|
61
|
+
| **Data access** | Read/create/update/delete of regulated data (PII, CHD, PHI) | HIPAA §164.312(b), PCI DSS 10.2 |
|
|
62
|
+
| **Administrative** | Config changes, user provisioning, API key lifecycle, certificate rotation | ISO A.5.25, SOC 2 CC7.3 |
|
|
63
|
+
| **Security events** | IDS/IPS alerts, anomalous kernel syscalls (Falco), policy violations | SOC 2 CC7.3, ISO A.8.16 |
|
|
64
|
+
| **System events** | Kernel audit (Linux auditd), container lifecycle events | ISO A.8.15; cross-ref `logs.md §OS-level log sources` |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 4. Required Attributes per Audit Event
|
|
69
|
+
|
|
70
|
+
Every audit event MUST carry these fields. Map to OTel `security.*` semconv namespace (Development/proposed).
|
|
71
|
+
|
|
72
|
+
| Attribute | Type | Description |
|
|
73
|
+
|-----------|------|-------------|
|
|
74
|
+
| `user.id` | string | Authenticated identity; pseudonymized or hashed; never plain email (PII) |
|
|
75
|
+
| `actor.type` | enum | `user` \| `service_account` \| `system` |
|
|
76
|
+
| `action` | string | Verb: `read`, `write`, `delete`, `approve`, `login`, `logout` |
|
|
77
|
+
| `resource.type` | string | What was acted on: `order`, `user_record`, `api_key`, `rbac_role` |
|
|
78
|
+
| `resource.id` | string | Identifier of the affected resource |
|
|
79
|
+
| `event.outcome` | enum | `success` \| `failure` \| `denied` |
|
|
80
|
+
| `ip.address` | string | Source IP; may be PII; cross-ref `privacy.md §IP addresses` |
|
|
81
|
+
| `timestamp` | ISO 8601 UTC | Event time; required for chain ordering (Section 6) |
|
|
82
|
+
| `trace_id` | 32-char hex | Correlation with operational trace; cross-ref `../incident-forensics.md` |
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"timestamp": "2026-04-21T09:15:32.847Z",
|
|
87
|
+
"actor.type": "user",
|
|
88
|
+
"user.id": "sha256:a3f8c2...",
|
|
89
|
+
"action": "delete",
|
|
90
|
+
"resource.type": "user_record",
|
|
91
|
+
"resource.id": "rec_9f2k1",
|
|
92
|
+
"event.outcome": "success",
|
|
93
|
+
"ip.address": "203.0.113.42",
|
|
94
|
+
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
|
|
95
|
+
"service.name": "user-management-api",
|
|
96
|
+
"deployment.environment": "production"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 5. Immutable WORM Storage (Write-Once-Read-Many)
|
|
103
|
+
|
|
104
|
+
Select tamper protection and retention controls for the applicable obligation. These frameworks do not establish a universal WORM requirement for every audit log. WORM can implement a selected immutability requirement; document why it is needed before locking records.
|
|
105
|
+
|
|
106
|
+
| Platform | Mechanism | Key constraint |
|
|
107
|
+
|----------|-----------|----------------|
|
|
108
|
+
| **AWS S3** | Object Lock; Compliance mode | Cannot delete even by root or AWS support |
|
|
109
|
+
| **GCS** | Retention Policy with locked bucket | Lock is irreversible once applied |
|
|
110
|
+
| **Azure Blob** | Immutability policy (time-based retention) | Legal hold override available |
|
|
111
|
+
| **On-premises** | WORM tape, compliance appliances | Hardware write-protect; chain of custody required |
|
|
112
|
+
|
|
113
|
+
S3 Object Lock Compliance mode example for a record class whose approved retention is 7 years (not a default for all audit data):
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"ObjectLockConfiguration": {
|
|
118
|
+
"ObjectLockEnabled": "Enabled",
|
|
119
|
+
"Rule": {
|
|
120
|
+
"DefaultRetention": {
|
|
121
|
+
"Mode": "COMPLIANCE",
|
|
122
|
+
"Years": 7
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`COMPLIANCE` mode prevents deletion by any principal, including the AWS account root, during the retention period. Use it only when that irreversible behavior matches the approved requirement. `GOVERNANCE` allows privileged override and may suit a different control; choose the mode explicitly.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 6. Tamper Evidence (Cryptographic Integrity)
|
|
134
|
+
|
|
135
|
+
WORM prevents deletion; tamper evidence proves no records were silently modified or omitted.
|
|
136
|
+
|
|
137
|
+
**Hash chain:** each event record includes `prev_hash`; the SHA-256 of the previous event. Any insertion, deletion, or modification breaks the chain.
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
event_N.hash = SHA256(event_N.payload + event_{N-1}.hash)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Merkle root anchoring:** daily, compute the Merkle root of all events in the period. Anchor this root to an external transparency log; detached from the audit system; so the anchoring timestamp is independently verifiable.
|
|
144
|
+
|
|
145
|
+
| Tool | Type | Notes |
|
|
146
|
+
|------|------|-------|
|
|
147
|
+
| **rekor** (sigstore) | OSS transparency log | CNCF project; append-only; publicly verifiable |
|
|
148
|
+
| **AWS QLDB** | Managed ledger DB | Cryptographic journal; AWS-proprietary |
|
|
149
|
+
| **IBM LinuxONE** | Hardware-backed ledger | Enterprise on-prem |
|
|
150
|
+
|
|
151
|
+
Source: [github.com/sigstore/rekor](https://github.com/sigstore/rekor)
|
|
152
|
+
|
|
153
|
+
**Verification schedule:** run chain integrity check weekly (automated), and before any compliance audit. Verification failure is a CRITICAL security event; trigger incident response.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 7. Evidence-Specific Retention Policy
|
|
158
|
+
|
|
159
|
+
Map each record class to its legal/contractual requirement and purpose. HIPAA required security documentation, PCI audit history, and SOC 2 engagement evidence have different scopes; one period does not prove all compliance. Set an approved retention schedule and erasure/legal-hold exceptions before configuring lifecycle or Object Lock. The table below is a 7-year example only for a record class that needs that period.
|
|
160
|
+
|
|
161
|
+
| Tier | Duration | Storage | Cost tier |
|
|
162
|
+
|------|----------|---------|-----------|
|
|
163
|
+
| Hot (recent, searchable) | 90 days | Elasticsearch / Loki | $$$ |
|
|
164
|
+
| Warm (searchable, compressed) | 1 year | ClickHouse / archive index | $$ |
|
|
165
|
+
| Cold (WORM, immutable) | 7 years | S3 Glacier Deep Archive (Object Lock Compliance) | $ |
|
|
166
|
+
|
|
167
|
+
**Legal hold:** when an active investigation or litigation hold is active, suppress automated expiry for all affected records regardless of tier. Implement via S3 Object Lock legal hold or equivalent.
|
|
168
|
+
|
|
169
|
+
**Lifecycle policy:** apply S3 Lifecycle rules to transition objects automatically. Compliance mode Object Lock must be set at write time; it cannot be applied retroactively.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 8. Falco Integration (CNCF Graduated)
|
|
174
|
+
|
|
175
|
+
Falco provides runtime security detection: anomalous kernel syscalls, container escapes, file access violations, and Kubernetes API abuse.
|
|
176
|
+
|
|
177
|
+
Source: [falco.org](https://falco.org)
|
|
178
|
+
|
|
179
|
+
**Deployment:** Falco DaemonSet on every node. Output JSON events → audit pipeline.
|
|
180
|
+
|
|
181
|
+
Custom Falco rule example (detect secret access in production namespace):
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
- rule: K8s Secret Access in Production
|
|
185
|
+
desc: Detect any read of a Kubernetes secret in the production namespace
|
|
186
|
+
condition: >
|
|
187
|
+
ka.verb=get and ka.target.resource=secrets
|
|
188
|
+
and ka.target.namespace=production
|
|
189
|
+
and not ka.user.name startswith "system:"
|
|
190
|
+
output: >
|
|
191
|
+
Secret accessed (user=%ka.user.name secret=%ka.target.name
|
|
192
|
+
ns=%ka.target.namespace ua=%ka.user-agent)
|
|
193
|
+
priority: WARNING
|
|
194
|
+
source: k8saudit
|
|
195
|
+
tags: [audit, pci_dss, hipaa]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Pipeline integration:** Falco JSON output → `filelogreceiver` (OTel Collector) → audit logs pipeline → WORM cold tier. Apply the same hash chain enrichment as application audit events before writing.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 9. Kubernetes Audit Logs
|
|
203
|
+
|
|
204
|
+
Kubernetes API server audit logs record every API call; essential for cluster-admin accountability, secret access auditing, and RBAC change tracking.
|
|
205
|
+
|
|
206
|
+
| Audit level | Records | Use case |
|
|
207
|
+
|-------------|---------|----------|
|
|
208
|
+
| `None` | Nothing | Exclude noisy, low-value paths |
|
|
209
|
+
| `Metadata` | Method, URL, user, timestamp | Default for most resources |
|
|
210
|
+
| `Request` | + request body | Selected non-secret mutations (e.g., RBAC), after assessing sensitive fields |
|
|
211
|
+
| `RequestResponse` | + response body | Selected non-secret operations whose bodies are necessary and safe to retain |
|
|
212
|
+
|
|
213
|
+
Put the Secret metadata-only exception before broader body-recording rules; Kubernetes audit policies use the first matching rule. Do not record Secret `data`/`stringData` or credential response bodies in the audit archive.
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
apiVersion: audit.k8s.io/v1
|
|
217
|
+
kind: Policy
|
|
218
|
+
rules:
|
|
219
|
+
- level: Metadata
|
|
220
|
+
resources:
|
|
221
|
+
- group: ""
|
|
222
|
+
resources: ["secrets"]
|
|
223
|
+
# Add narrowly scoped, reviewed non-secret rules here.
|
|
224
|
+
- level: Metadata
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Feed Kubernetes audit logs into the audit pipeline separately from operational logs. Tag with `source: k8s_apiserver` for routing. Source: <https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/>.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 10. Database Audit Logs
|
|
232
|
+
|
|
233
|
+
| Database | Extension / feature | Notes |
|
|
234
|
+
|----------|---------------------|-------|
|
|
235
|
+
| PostgreSQL | `pgaudit` extension | Log SELECT, DDL, DML per role |
|
|
236
|
+
| MySQL | Enterprise Audit plugin | JSON output; filter by user/schema |
|
|
237
|
+
| MongoDB | Audit system (Enterprise) | Filter by action type and collection |
|
|
238
|
+
| AWS RDS | Built-in audit logging | Enable via parameter group |
|
|
239
|
+
| GCP Cloud SQL | `cloudsql.enable_pgaudit` | Same pgaudit under the hood |
|
|
240
|
+
| Azure SQL | Unified Audit Log | Native, sends to Storage/Log Analytics |
|
|
241
|
+
|
|
242
|
+
Database audit events feed the same audit pipeline as application events. Normalize to the attribute schema in Section 4 before storage.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## 11. Access Control on Audit Data
|
|
247
|
+
|
|
248
|
+
Audit data must be readable by auditors and legal; and not writable by anyone after initial ingest.
|
|
249
|
+
|
|
250
|
+
- Separate RBAC role: `audit-reader` is distinct from `operations-engineer` and `developer`
|
|
251
|
+
- Auditors have read-only access, scoped to approved time ranges
|
|
252
|
+
- No single engineer can both produce audit events and modify audit storage
|
|
253
|
+
- Cross-ref `privacy.md §Backend RBAC` for principle of least privilege patterns
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 12. Cross-Signal Correlation
|
|
258
|
+
|
|
259
|
+
Every audit event carries `trace_id`. During an incident:
|
|
260
|
+
|
|
261
|
+
1. Start from the audit event (who did what)
|
|
262
|
+
2. Pivot via `trace_id` to the operational trace (what the system did)
|
|
263
|
+
3. Join with logs (`logs.md §Trace ID Injection Rules`) for execution detail
|
|
264
|
+
4. Reference `../incident-forensics.md` for the full MRA playbook
|
|
265
|
+
|
|
266
|
+
Audit events are the authoritative source of truth for incident timelines; operational traces provide the execution context.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 13. Matrix Coverage: Audit Column
|
|
271
|
+
|
|
272
|
+
Cells from `../matrix.md` owned by this file:
|
|
273
|
+
|
|
274
|
+
| Layer | Boundary | Status | Notes |
|
|
275
|
+
|-------|----------|--------|-------|
|
|
276
|
+
| L3-network | any | PASS | VPC flow audit trail; who connected to what |
|
|
277
|
+
| L4-transport | any | PARTIAL | Limited: connection-level only, no payload |
|
|
278
|
+
| L7-application | multi-tenant | PASS | Per-tenant audit trail; supports GDPR data subject right of access |
|
|
279
|
+
| release | any | PASS | Deployment audit: who deployed what when (actor, SHA, timestamp) |
|
|
280
|
+
| privacy | audit | overlap | See `privacy.md`; audit records data processing; privacy governs erasure |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 14. Anti-patterns
|
|
285
|
+
|
|
286
|
+
Append candidates for `../anti-patterns.md §Section F Security & Compliance`:
|
|
287
|
+
|
|
288
|
+
| ID | Anti-pattern | Fix |
|
|
289
|
+
|----|--------------|-----|
|
|
290
|
+
| A-AU1 | Audit evidence can be altered without detection | Apply access controls and tamper protection; choose WORM only when the approved obligation requires it |
|
|
291
|
+
| A-AU2 | No tamper evidence (no hash chain or notary) | Implement hash chain per Section 6; anchor Merkle root to rekor |
|
|
292
|
+
| A-AU3 | PII in audit events without redaction | Hash or pseudonymize `user.id`; evaluate `ip.address` per `privacy.md` |
|
|
293
|
+
| A-AU4 | Shared RBAC for operations and audit readers | Create separate `audit-reader` role; enforce in IaC |
|
|
294
|
+
| A-AU5 | Retention differs from the approved record-specific schedule | Apply the documented law/contract/purpose schedule and legal holds; expire eligible records |
|
|
295
|
+
| A-AU6 | Kubernetes audit logs routed to operational log store | Separate pipeline: K8s audit → WORM cold tier |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 15. References
|
|
300
|
+
|
|
301
|
+
1. ISO/IEC 27001:2022; <https://www.iso.org/standard/27001>
|
|
302
|
+
2. ISO/IEC 27002:2022; <https://www.iso.org/standard/27002>
|
|
303
|
+
3. AICPA SOC 2 Common Criteria: <https://www.aicpa.org/soc2>
|
|
304
|
+
4. HIPAA Security Rule §164.312(b): <https://www.hhs.gov/hipaa/for-professionals/security/index.html>
|
|
305
|
+
5. PCI DSS v4.0 Requirement 10: <https://www.pcisecuritystandards.org>
|
|
306
|
+
6. GDPR Art. 30: <https://gdpr-info.eu/art-30-gdpr/>
|
|
307
|
+
7. Falco: <https://falco.org>
|
|
308
|
+
8. sigstore rekor: <https://github.com/sigstore/rekor>
|
|
309
|
+
9. OTel security semconv (proposed): <https://opentelemetry.io/docs/specs/semconv/attributes-registry/security/>
|
|
310
|
+
10. `../standards.md` · `../matrix.md` · `../meta-observability.md` · `../incident-forensics.md` · `privacy.md` · `logs.md`
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
---
|
|
2
|
+
otel_spec: "1.x (stable API/SDK)"
|
|
3
|
+
otel_semconv: "1.43.0 (2026-07)"
|
|
4
|
+
specs:
|
|
5
|
+
- "FOCUS Spec: 1.0 (FinOps Open Cost and Usage Specification)"
|
|
6
|
+
notes:
|
|
7
|
+
- "OpenCost: CNCF Incubating (advanced 2024-10-31)"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Cost Signal
|
|
11
|
+
|
|
12
|
+
## 1. Scope & Boundary
|
|
13
|
+
|
|
14
|
+
Cost is the 6th signal in the `oma-observability` skill (design decision D4: cost as 1st-class signal, standalone). It sits alongside metrics, logs, traces, profiles, audit, and privacy in the 4 × 4 × 7 coverage matrix.
|
|
15
|
+
|
|
16
|
+
**In scope:**
|
|
17
|
+
- Cost as a telemetry signal: metric surface (OpenCost Prometheus exposition), attribution rules, and unit economics
|
|
18
|
+
- Kubernetes-native cost allocation via OpenCost (CNCF Incubating)
|
|
19
|
+
- Per-tenant cost attribution (B2B SaaS) and per-feature cost deltas
|
|
20
|
+
- LLM/AI token-cost observability at the span attribute level
|
|
21
|
+
- Cross-cloud egress cost attribution
|
|
22
|
+
- Retention policy and access-control rules for cost data
|
|
23
|
+
- Cardinality rules specific to cost labels
|
|
24
|
+
|
|
25
|
+
**Out of scope:**
|
|
26
|
+
- Full FinOps strategy: procurement, Reserved Instances / Savings Plans, commitment analysis, contract negotiation; see [FinOps Foundation framework](https://www.finops.org/framework/)
|
|
27
|
+
- Full LLM observability (prompt versioning, evals, model routing economics); see Langfuse, Arize Phoenix, LangSmith
|
|
28
|
+
- Cluster cost optimization (rightsizing, spot orchestration): see Kubecost commercial tier or CloudZero
|
|
29
|
+
|
|
30
|
+
**Distinct boundary with `../boundaries/multi-tenant.md §Cost Attribution`:** that file uses cost as a _routing signal_ (tenant chargeback, showback, residency). This file defines cost as a _telemetry signal_; what to collect, how to attribute it, and how to store it. Cross-reference is mandatory.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Why Cost Is a 1st-Class Signal
|
|
35
|
+
|
|
36
|
+
Cost differs from metrics, logs, and traces in three structural ways:
|
|
37
|
+
|
|
38
|
+
| Dimension | Metrics / Logs / Traces | Cost |
|
|
39
|
+
|-----------|------------------------|------|
|
|
40
|
+
| Data source | Instrumented applications + infra agents | Cloud billing APIs + Kubernetes allocation engine |
|
|
41
|
+
| Primary consumer | Engineering, SRE | Finance, Platform Engineering |
|
|
42
|
+
| Retention requirement | 30–90 days typical | 2 years (financial audit compliance) |
|
|
43
|
+
| Granularity | Per-request, sub-second | Per-hour or per-day billing aggregates |
|
|
44
|
+
|
|
45
|
+
Unit economics is the motivation: understanding `$ per request`, `$ per tenant`, and `$ per feature` requires correlating cloud billing data with application-level telemetry. Neither data source alone is sufficient.
|
|
46
|
+
|
|
47
|
+
FinOps Foundation identifies cost visibility as a foundational practice across three phases: Inform → Optimize → Operate. The Inform phase is entirely an observability problem; cost data must be collected, attributed, and surfaced before optimization can occur.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. OpenCost (CNCF Incubating)
|
|
52
|
+
|
|
53
|
+
Sources:
|
|
54
|
+
- <https://www.opencost.io/>
|
|
55
|
+
- <https://www.cncf.io/blog/2024/10/31/opencost-advances-to-cncf-incubator/>
|
|
56
|
+
- <https://github.com/opencost/opencost>
|
|
57
|
+
|
|
58
|
+
OpenCost is the open-source Kubernetes cost monitoring standard. It advanced to CNCF Incubating status on 2024-10-31. The OSS core is maintained by IBM Kubecost (post-acquisition) and the community. Kubecost's commercial tier adds UI, recommendations, and multi-cluster federation on top of the OpenCost core.
|
|
59
|
+
|
|
60
|
+
### 3.1 Architecture
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Cloud Billing API (AWS CUR / GCP Billing Export / Azure Cost Management)
|
|
64
|
+
|
|
|
65
|
+
v
|
|
66
|
+
+----------------+ /metrics (Prometheus format)
|
|
67
|
+
| OpenCost Pod | -----> Prometheus scrape -----> OTel Collector prometheusreceiver
|
|
68
|
+
| (namespace: | |
|
|
69
|
+
| opencost) | v
|
|
70
|
+
+----------------+ Your TSDB backend
|
|
71
|
+
| (Thanos / Mimir / VictoriaMetrics)
|
|
72
|
+
v
|
|
73
|
+
Kubernetes API (node prices, pod labels, PVC claims)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The OpenCost pod reads node price data from a cloud-provider price configmap (or the cloud billing API directly), reads Kubernetes resource allocations from the kubelet and API server, and exposes Prometheus metrics at port 9003.
|
|
77
|
+
|
|
78
|
+
### 3.2 Key Metrics Exposed
|
|
79
|
+
|
|
80
|
+
Source: <https://opencost.io/docs/integrations/metrics/>. OpenCost exposes allocation quantities and unit/hourly prices; it does not automatically emit namespace/workload cost counters.
|
|
81
|
+
|
|
82
|
+
| Metric | Unit | Purpose |
|
|
83
|
+
|--------|------|---------|
|
|
84
|
+
| `node_cpu_hourly_cost` | USD / core-hour | Node CPU unit price |
|
|
85
|
+
| `node_ram_hourly_cost` | USD / GiB-hour | Node memory unit price |
|
|
86
|
+
| `node_total_hourly_cost` | USD / hour | Total node rate |
|
|
87
|
+
| `container_cpu_allocation` | cores | Allocated container CPU |
|
|
88
|
+
| `container_memory_allocation_bytes` | bytes | Allocated container memory |
|
|
89
|
+
| `pod_pvc_allocation` | bytes | Allocated PVC storage |
|
|
90
|
+
| `pv_hourly_cost` | USD / GiB-hour | Persistent-volume unit price |
|
|
91
|
+
| `kubecost_network_internet_egress_cost` | USD / GiB | Internet egress price; multiply by attributed usage |
|
|
92
|
+
| `kubecost_load_balancer_cost` | USD / hour | Load-balancer rate |
|
|
93
|
+
| `kubecost_cluster_management_cost` | USD / hour | Cluster management rate |
|
|
94
|
+
|
|
95
|
+
### 3.3 Scrape Configuration (OTel Collector)
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
receivers:
|
|
99
|
+
prometheus:
|
|
100
|
+
config:
|
|
101
|
+
scrape_configs:
|
|
102
|
+
- job_name: opencost
|
|
103
|
+
scrape_interval: 60s
|
|
104
|
+
static_configs:
|
|
105
|
+
- targets: ["opencost.opencost.svc.cluster.local:9003"]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 3.4 Allocation Model
|
|
109
|
+
|
|
110
|
+
Three allocation categories: compute (CPU + RAM), storage (PVC), and network (egress bytes). Each workload receives a share of node cost proportional to resource requests. Idle cost distributes across active workloads or a dedicated `__idle__` namespace via configurable rules. Cross-cloud pricing is supplied via a price configmap; on-prem environments set custom `$/CPU-hr` and `$/GB-RAM-hr` values.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 4. Cost Attribution by Dimension
|
|
115
|
+
|
|
116
|
+
| Dimension | Kubernetes mechanism | Label / attribute |
|
|
117
|
+
|-----------|---------------------|-------------------|
|
|
118
|
+
| Namespace / team | Namespace label → team ownership mapping | `namespace`, `team` |
|
|
119
|
+
| Workload | Deployment / StatefulSet / DaemonSet name | `workload`, `controller_kind` |
|
|
120
|
+
| Tenant (B2B SaaS) | `tenant.id` label on pods + W3C Baggage propagation | `tenant_id` |
|
|
121
|
+
| Feature | Custom pod label (`feature.name`) | `feature_name` |
|
|
122
|
+
| Per-request (LLM) | `gen_ai.cost.total_usd` span attribute | trace attribute, not metric label |
|
|
123
|
+
|
|
124
|
+
**Tenant attribution** is the primary B2B SaaS use case: tag every pod with `tenant.id` at deploy time, then request the appropriate label aggregation from the OpenCost Allocation API or explicitly join allocation metrics to verified ownership metadata. Pod labels alone do not create a new cost counter at `/metrics`. Cross-ref `../boundaries/multi-tenant.md §Cost Attribution` for chargeback and showback patterns. **Feature attribution** uses a custom pod label (`feature.name`); cross-ref `../boundaries/release.md` for A/B cost comparison. **Per-request attribution** for LLM workloads uses span attributes only; writing cost to a metric label at request granularity causes a cardinality explosion (see Section 10).
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 5. Unit Economics
|
|
129
|
+
|
|
130
|
+
Compute costs with matching units and attribution scope. The default OpenCost metrics support this namespace compute-cost rate (USD/hour):
|
|
131
|
+
|
|
132
|
+
```promql
|
|
133
|
+
sum by (namespace) (
|
|
134
|
+
container_cpu_allocation
|
|
135
|
+
* on(node) group_left node_cpu_hourly_cost
|
|
136
|
+
+ container_memory_allocation_bytes
|
|
137
|
+
* on(node) group_left node_ram_hourly_cost / (1024 * 1024 * 1024)
|
|
138
|
+
)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
This covers CPU and memory only. Add PVC, attributed network usage, load-balancer, shared/idle, and management costs according to the allocation model before treating the result as a total bill. For tenant/workload daily totals, use the OpenCost Allocation API's window and aggregation controls rather than assuming a workload counter exists. Source: <https://opencost.io/docs/integrations/api/>.
|
|
142
|
+
|
|
143
|
+
**Per-request cost (custom counter example, rolling 1-hour window):**
|
|
144
|
+
|
|
145
|
+
The following query requires a separately implemented monotonic `workload_cost_usd_total` counter in USD and an ownership mapping to the same workload. It is a team-defined export, not an OpenCost default metric. Verify that costs and request counts cover the same scope and time window.
|
|
146
|
+
|
|
147
|
+
```promql
|
|
148
|
+
sum(rate(workload_cost_usd_total{workload="checkout-api"}[1h]))
|
|
149
|
+
/
|
|
150
|
+
sum(rate(http_requests_total{job="checkout-api"}[1h]))
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Both rates are per second, so the result is USD/request; do not multiply only one side by 3600. An hourly cost gauge must instead be divided by requests/hour.
|
|
154
|
+
|
|
155
|
+
For gold/silver SLO cost comparisons, compare their allocated costs over the same window and attribution scope, and report the corresponding SLI measurements. Do not compare lifetime cumulative counters as a current tier-cost ratio.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 6. LLM / AI Cost Observability
|
|
160
|
+
|
|
161
|
+
Full LLM observability is out of scope for this skill. The tools for that domain are Langfuse, Arize Phoenix, LangSmith, and Braintrust (see `SKILL.md §When NOT to use`). This section covers only the intersection where LLM cost surfaces as a span attribute in the OTel pipeline.
|
|
162
|
+
|
|
163
|
+
**Token-based pricing attributes** (OTel `gen_ai.*` semconv — deprecated in the core registry since semconv 1.42 and maintained in the dedicated GenAI semconv repository; treat as unstable per `../standards.md §Semconv Stability`):
|
|
164
|
+
|
|
165
|
+
| Span attribute | Description |
|
|
166
|
+
|----------------|-------------|
|
|
167
|
+
| `gen_ai.usage.input_tokens` | Prompt tokens consumed |
|
|
168
|
+
| `gen_ai.usage.output_tokens` | Completion tokens generated |
|
|
169
|
+
| `gen_ai.cost.total_usd` | Computed cost in USD for the span (vendor-specific extension) |
|
|
170
|
+
|
|
171
|
+
**Threshold-based sampling rule:** if `gen_ai.cost.total_usd > 0.50`, always retain the span regardless of sampling rate. This prevents silent budget overruns from being dropped before they reach the backend. Cross-ref `../transport/sampling-recipes.md §Cost-aware sampling` for the tail-sampler rule configuration.
|
|
172
|
+
|
|
173
|
+
Note: `gen_ai.*` conventions moved to a dedicated GenAI semconv repository in semconv 1.42 (2026-06); the core-registry entries are deprecated. Do not use these attributes as inputs to production SLOs until they reach Stable or RC in their new home.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 7. Cross-Cloud Cost
|
|
178
|
+
|
|
179
|
+
Each cloud exposes billing data through a distinct API and export format. FOCUS (FinOps Open Cost and Usage Specification) is the data-format unification effort.
|
|
180
|
+
|
|
181
|
+
| Cloud | Billing data source | Export format | Ingestion path |
|
|
182
|
+
|-------|--------------------|----|------|
|
|
183
|
+
| AWS | Cost & Usage Report (CUR) | Parquet / CSV → S3 | Athena query → OpenCost price configmap |
|
|
184
|
+
| GCP | Billing Export | BigQuery table | BigQuery export job → OpenCost |
|
|
185
|
+
| Azure | Cost Management Export | CSV → Blob Storage | Storage export → OpenCost |
|
|
186
|
+
| On-prem | Manual price configmap | Custom `$/CPU-hr`, `$/GB-hr` | OpenCost configmap |
|
|
187
|
+
|
|
188
|
+
**FOCUS Spec** (<https://github.com/FinOps-Open-Cost-and-Usage-Spec/FOCUS_Spec>) provides a vendor-neutral column schema (`BilledCost`, `ResourceId`, `ServiceName`) for cross-cloud cost joins. When FOCUS exports are available from a cloud provider, prefer them over native formats. For the OSS multi-cluster path, run one OpenCost instance per cluster and aggregate in Thanos or Mimir by namespace and workload labels.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 8. Retention Policy
|
|
193
|
+
|
|
194
|
+
| Data type | Retention | Rationale |
|
|
195
|
+
|-----------|-----------|-----------|
|
|
196
|
+
| Raw cloud billing data (CUR / GCP export) | 2 years | Financial audit compliance (SOX, ISO 27001) |
|
|
197
|
+
| OpenCost Prometheus metrics (hourly resolution) | 2 years | Chargeback evidence per tenant |
|
|
198
|
+
| Aggregated per-tenant / per-feature cost | Long-term (cold storage) | Historical unit economics trending |
|
|
199
|
+
| Per-request span cost attributes (`gen_ai.cost.total_usd`) | 30–90 days | Operational debugging window |
|
|
200
|
+
|
|
201
|
+
Cross-ref `../meta-observability.md §Retention Matrix` for the full retention policy table covering all seven signals.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 9. Privacy & Access Control
|
|
206
|
+
|
|
207
|
+
Cost per tenant reveals revenue tier, contract value, and resource consumption patterns. Restrict access by role:
|
|
208
|
+
|
|
209
|
+
**RBAC separation:**
|
|
210
|
+
|
|
211
|
+
| Role | Dashboard access | Data access |
|
|
212
|
+
|------|-----------------|-------------|
|
|
213
|
+
| Finance | Full cost by tenant, contract | Billing export (read-only) |
|
|
214
|
+
| Platform Engineering | Cost by namespace, workload, cluster | OpenCost metrics (read-only) |
|
|
215
|
+
| Application Engineering | Cost by their own service / namespace | Filtered by namespace label |
|
|
216
|
+
| Tenant admin (self-serve) | Their own tenant cost only | Filtered by `tenant_id` claim |
|
|
217
|
+
|
|
218
|
+
Cross-ref `privacy.md §Backend RBAC` for the Grafana RBAC configuration pattern and OPA policy rules for dashboard-level tenant isolation.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 10. Anti-Cardinality Rules for Cost Labels
|
|
223
|
+
|
|
224
|
+
Follow the same principles as metric labels (cross-ref `../meta-observability.md §Cardinality Guardrails`). Cost workloads add two additional risk surfaces: per-request LLM spans and dynamic tenant growth.
|
|
225
|
+
|
|
226
|
+
| Rule | Applies to | Rationale |
|
|
227
|
+
|------|-----------|-----------|
|
|
228
|
+
| `tenant.id` allowed as metric label with top-N cap (≤ 1000) | OpenCost metrics | Bounded tenant count; use `"other"` bucket for overflow |
|
|
229
|
+
| `namespace` and `workload` always allowed | OpenCost metrics | Bounded by cluster size |
|
|
230
|
+
| `gen_ai.cost.total_usd` as span attribute only; never as metric label | LLM spans | One series per request = cardinality explosion |
|
|
231
|
+
| `feature.name` allowed as pod label; allowed as metric label with cap | OpenCost workload attribution | Feature set is bounded; gate new features through label allowlist |
|
|
232
|
+
| `request.id` never as metric label for cost | Any | Unbounded cardinality; use trace attribute only |
|
|
233
|
+
|
|
234
|
+
Per-request cost labels are safe only as trace span attributes, where cardinality is handled by the trace backend (not a TSDB). Aggregate by `tenant.id`, `namespace`, and `workload` for metric surfaces.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 11. Vendors
|
|
239
|
+
|
|
240
|
+
As of 2026-Q2. Verify current status at <https://landscape.cncf.io>.
|
|
241
|
+
|
|
242
|
+
Cross-ref `../vendor-categories.md §FinOps / Cost` for full selection guidance.
|
|
243
|
+
|
|
244
|
+
| Vendor | Type | Notes |
|
|
245
|
+
|--------|------|-------|
|
|
246
|
+
| OpenCost | OSS, CNCF Incubating | Kubernetes-native; Prometheus exposition; community-maintained |
|
|
247
|
+
| Kubecost | Commercial (IBM) | OpenCost OSS core + commercial UI, multi-cluster, recommendations |
|
|
248
|
+
| CloudZero | Commercial SaaS | Engineering-focused cost attribution; no Kubernetes agent required |
|
|
249
|
+
| Vantage | Commercial SaaS | Cross-cloud cost reporting; FOCUS spec early adopter |
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 12. Matrix Cells: Cost Column
|
|
254
|
+
|
|
255
|
+
Quick navigation for cost-column cells in `../matrix.md`:
|
|
256
|
+
|
|
257
|
+
| Layer | Boundary | Status | Detail |
|
|
258
|
+
|-------|----------|--------|--------|
|
|
259
|
+
| L3-network | multi-tenant | PARTIAL | Egress byte attribution by tenant VPC; cost proxy, not unit economics |
|
|
260
|
+
| L3-network | cross-application | PARTIAL | Cross-VPC egress cost attribution; unreliable without flow tagging |
|
|
261
|
+
| L4-transport | multi-tenant | PARTIAL | L4 byte volume per tenant as cost proxy; rolls up into compute |
|
|
262
|
+
| L4-transport | cross-application | PARTIAL | Cross-application byte volume; correlate with L7 for accuracy |
|
|
263
|
+
| mesh | multi-tenant | PARTIAL | Request-level cost attribution by tenant via mesh telemetry; feeds OpenCost |
|
|
264
|
+
| mesh | cross-application | PASS | Per-service byte/request counts from Envoy; unit cost cross-service |
|
|
265
|
+
| mesh | release | PARTIAL | Canary cost delta via per-version request counts in mesh telemetry |
|
|
266
|
+
| L7-application | multi-tenant | PASS | Primary use case: per-tenant OpenCost unit economics with `tenant.id` pod label |
|
|
267
|
+
| L7-application | cross-application | PASS | Per-service unit cost model; `gen_ai.cost.total_usd` span attribute for LLM |
|
|
268
|
+
| L7-application | slo | PASS | Gold-tier vs silver-tier cost delta; cost trade-off for SLO tier selection |
|
|
269
|
+
| L7-application | release | PASS | Canary cost delta: compare per-request cost across canary vs stable version |
|
|
270
|
+
|
|
271
|
+
L3 and L4 cost cells are PARTIAL because they produce a cost proxy (egress bytes) that informs FinOps egress billing but is insufficient for full unit-economics modeling. See `../matrix.md §C6` for the detailed caveat.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 13. Anti-Patterns
|
|
276
|
+
|
|
277
|
+
Candidates for `../anti-patterns.md §Section B Cardinality & Cost`:
|
|
278
|
+
|
|
279
|
+
| Anti-pattern | Impact | Correction |
|
|
280
|
+
|-------------|--------|------------|
|
|
281
|
+
| Cost label at per-request metric granularity | Cardinality explosion in TSDB; OOM on ingestor | Use `gen_ai.cost.total_usd` as span attribute; aggregate cost metrics by tenant/namespace/workload |
|
|
282
|
+
| No `tenant.id` pod label | Cannot attribute cost to tenants; chargeback impossible | Apply `tenant.id` at deploy time via Helm values or admission webhook |
|
|
283
|
+
| Cost dashboard with public access | Reveals tenant revenue tier and contract value | Apply Grafana RBAC; finance and engineering views are separate; no public embedding |
|
|
284
|
+
| Ignoring egress cost in FinOps | Often the largest surprise cost in multi-cloud or CDN-heavy architectures | Use the applicable egress unit-price metrics and attributed network usage or Allocation API costs; set egress budget alerts |
|
|
285
|
+
| LLM spans not tail-sampled on cost threshold | Silent budget blowup: expensive spans are dropped before alerting | Configure tail-sampler rule: if `gen_ai.cost.total_usd > 0.50`, always retain |
|
|
286
|
+
| One metric name per tenant for cost | Bypasses TSDB cardinality controls; cannot be aggregated | Use one documented cost metric/API aggregation with a bounded tenant dimension; do not invent automatic workload cost counters |
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Cross-References
|
|
291
|
+
|
|
292
|
+
| Topic | File |
|
|
293
|
+
|-------|------|
|
|
294
|
+
| Tenant cost chargeback and routing | `../boundaries/multi-tenant.md §Cost Attribution` |
|
|
295
|
+
| Canary cost delta and A/B comparison | `../boundaries/release.md` |
|
|
296
|
+
| Tail-sampler cost-aware rules | `../transport/sampling-recipes.md §Cost-aware sampling` |
|
|
297
|
+
| Cardinality guardrails and top-N cap | `../meta-observability.md §Cardinality Guardrails` |
|
|
298
|
+
| Retention matrix (all signals) | `../meta-observability.md §Retention Matrix` |
|
|
299
|
+
| Cost dashboard RBAC | `signals/privacy.md §Backend RBAC` |
|
|
300
|
+
| Vendor selection (FinOps category) | `../vendor-categories.md §FinOps / Cost` |
|
|
301
|
+
| Full 112-cell matrix with cost column | `../matrix.md` |
|
|
302
|
+
| OpenCost metric surface (metrics signal) | `signals/metrics.md §8 OpenCost Metric Surface` |
|
|
303
|
+
| LLM / gen_ai semconv stability | `../standards.md §3 OTel Semconv Stability Tiers` |
|