mindforge-cc 10.0.3 → 11.0.0
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/.mindforge/MINDFORGE-V2-SCHEMA.json +43 -10
- package/.mindforge/config.json +30 -2
- package/.mindforge/engine/cross-model-eval.md +74 -0
- package/.mindforge/engine/proactive/signal-detector.md +60 -0
- package/.mindforge/engine/proactive/suggestion-engine.md +100 -0
- package/.mindforge/personas/agent-architect.md +57 -0
- package/.mindforge/personas/agent-evaluator.md +162 -0
- package/.mindforge/personas/agent-memory-designer.md +157 -0
- package/.mindforge/personas/agent-ops-engineer.md +120 -0
- package/.mindforge/personas/agent-orchestrator.md +112 -0
- package/.mindforge/personas/ai-economist.md +57 -0
- package/.mindforge/personas/ai-safety-engineer.md +57 -0
- package/.mindforge/personas/analytics-engineer.md +57 -0
- package/.mindforge/personas/anti-pattern-hunter.md +61 -0
- package/.mindforge/personas/api-gateway-designer.md +132 -0
- package/.mindforge/personas/auth-engineer.md +112 -0
- package/.mindforge/personas/build-engineer.md +57 -0
- package/.mindforge/personas/business-analyst.md +56 -0
- package/.mindforge/personas/cache-architect.md +100 -0
- package/.mindforge/personas/causal-scientist.md +57 -0
- package/.mindforge/personas/cdn-architect.md +118 -0
- package/.mindforge/personas/change-agent.md +104 -0
- package/.mindforge/personas/code-narrator.md +52 -0
- package/.mindforge/personas/codegen-specialist.md +68 -0
- package/.mindforge/personas/communication-architect.md +102 -0
- package/.mindforge/personas/compliance-engineer.md +96 -0
- package/.mindforge/personas/consensus-engineer.md +116 -0
- package/.mindforge/personas/contract-tester.md +60 -192
- package/.mindforge/personas/data-architect.md +108 -0
- package/.mindforge/personas/data-mesh-architect.md +57 -0
- package/.mindforge/personas/data-pipeline-architect.md +120 -0
- package/.mindforge/personas/de-sloppifier.md +60 -0
- package/.mindforge/personas/debt-manager.md +66 -0
- package/.mindforge/personas/decision-architect.md +82 -51
- package/.mindforge/personas/deployment-captain.md +74 -0
- package/.mindforge/personas/design-system-lead.md +112 -0
- package/.mindforge/personas/dmux-orchestrator.md +75 -0
- package/.mindforge/personas/dx-engineer.md +96 -0
- package/.mindforge/personas/ecommerce-engineer.md +57 -0
- package/.mindforge/personas/edge-engineer.md +94 -0
- package/.mindforge/personas/edtech-architect.md +106 -0
- package/.mindforge/personas/embedding-architect.md +57 -0
- package/.mindforge/personas/environment-engineer.md +57 -0
- package/.mindforge/personas/eval-judge.md +55 -0
- package/.mindforge/personas/event-architect.md +102 -0
- package/.mindforge/personas/experiment-designer.md +138 -0
- package/.mindforge/personas/feature-store-engineer.md +57 -0
- package/.mindforge/personas/finops-analyst.md +66 -0
- package/.mindforge/personas/fintech-architect.md +57 -0
- package/.mindforge/personas/flutter-engineer.md +104 -0
- package/.mindforge/personas/gaming-engineer.md +57 -0
- package/.mindforge/personas/graphql-designer.md +73 -0
- package/.mindforge/personas/healthcare-engineer.md +57 -0
- package/.mindforge/personas/hiring-strategist.md +105 -0
- package/.mindforge/personas/hitl-architect.md +165 -0
- package/.mindforge/personas/i18n-architect.md +69 -0
- package/.mindforge/personas/iot-architect.md +105 -0
- package/.mindforge/personas/knowledge-curator.md +139 -0
- package/.mindforge/personas/knowledge-engineer.md +57 -0
- package/.mindforge/personas/lakehouse-architect.md +57 -0
- package/.mindforge/personas/llm-orchestrator.md +57 -0
- package/.mindforge/personas/logistics-architect.md +106 -0
- package/.mindforge/personas/market-analyst.md +53 -0
- package/.mindforge/personas/marketplace-engineer.md +105 -0
- package/.mindforge/personas/mcp-designer.md +54 -0
- package/.mindforge/personas/meeting-designer.md +104 -0
- package/.mindforge/personas/mentorship-lead.md +106 -0
- package/.mindforge/personas/migration-architect.md +57 -0
- package/.mindforge/personas/ml-ops-engineer.md +101 -0
- package/.mindforge/personas/mobile-architect.md +105 -0
- package/.mindforge/personas/mobile-security-engineer.md +106 -0
- package/.mindforge/personas/multi-tenancy-architect.md +71 -0
- package/.mindforge/personas/multimodal-engineer.md +57 -0
- package/.mindforge/personas/offline-specialist.md +105 -0
- package/.mindforge/personas/onboarding-navigator.md +63 -0
- package/.mindforge/personas/payments-engineer.md +135 -0
- package/.mindforge/personas/pipeline-engineer.md +115 -0
- package/.mindforge/personas/platform-engineer.md +97 -0
- package/.mindforge/personas/platform-lead.md +57 -0
- package/.mindforge/personas/privacy-engineer.md +57 -0
- package/.mindforge/personas/product-owner.md +56 -0
- package/.mindforge/personas/productivity-analyst.md +57 -0
- package/.mindforge/personas/prompt-architect.md +101 -0
- package/.mindforge/personas/proofreader.md +53 -0
- package/.mindforge/personas/pwa-architect.md +105 -0
- package/.mindforge/personas/quality-scorer.md +63 -0
- package/.mindforge/personas/react-native-engineer.md +106 -0
- package/.mindforge/personas/resilience-engineer.md +69 -0
- package/.mindforge/personas/rfc-architect.md +64 -0
- package/.mindforge/personas/saga-orchestrator.md +80 -0
- package/.mindforge/personas/secrets-engineer.md +57 -0
- package/.mindforge/personas/skill-smith.md +79 -0
- package/.mindforge/personas/sre-lead.md +107 -0
- package/.mindforge/personas/stream-engineer.md +57 -0
- package/.mindforge/personas/streaming-engineer.md +64 -0
- package/.mindforge/personas/swarm-templates.json +674 -44
- package/.mindforge/personas/system-designer.md +57 -0
- package/.mindforge/personas/team-coach.md +120 -0
- package/.mindforge/personas/tech-lead-coach.md +103 -0
- package/.mindforge/personas/technical-writer-lead.md +111 -0
- package/.mindforge/personas/vibe-checker.md +75 -0
- package/.mindforge/personas/worktree-manager.md +56 -0
- package/.mindforge/personas/zero-trust-engineer.md +113 -0
- package/.mindforge/skills/a11y-testing/SKILL.md +143 -0
- package/.mindforge/skills/agent-evaluation-framework/SKILL.md +227 -0
- package/.mindforge/skills/agent-memory-design/SKILL.md +199 -0
- package/.mindforge/skills/agent-orchestration-patterns/SKILL.md +129 -0
- package/.mindforge/skills/agent-tool-selection/SKILL.md +204 -0
- package/.mindforge/skills/ai-agent-deployment/SKILL.md +176 -0
- package/.mindforge/skills/ai-cost-management/SKILL.md +57 -0
- package/.mindforge/skills/ai-safety-alignment/SKILL.md +53 -0
- package/.mindforge/skills/analytics-instrumentation/SKILL.md +172 -0
- package/.mindforge/skills/api-gateway-patterns/SKILL.md +177 -0
- package/.mindforge/skills/api-marketplace/SKILL.md +56 -0
- package/.mindforge/skills/api-versioning/SKILL.md +100 -0
- package/.mindforge/skills/app-store-deployment/SKILL.md +44 -0
- package/.mindforge/skills/architecture-tradeoff-analysis/SKILL.md +97 -0
- package/.mindforge/skills/audit-logging/SKILL.md +140 -0
- package/.mindforge/skills/auth-patterns/SKILL.md +148 -0
- package/.mindforge/skills/autonomous-agent-harness/SKILL.md +218 -0
- package/.mindforge/skills/autonomous-agents/SKILL.md +59 -0
- package/.mindforge/skills/build-system-optimization/SKILL.md +54 -0
- package/.mindforge/skills/build-vs-buy/SKILL.md +80 -0
- package/.mindforge/skills/bundle-optimization/SKILL.md +174 -0
- package/.mindforge/skills/business-analyst/SKILL.md +82 -0
- package/.mindforge/skills/caching-strategies/SKILL.md +132 -0
- package/.mindforge/skills/capacity-planning/SKILL.md +96 -0
- package/.mindforge/skills/causal-inference/SKILL.md +42 -0
- package/.mindforge/skills/cdn-optimization/SKILL.md +212 -0
- package/.mindforge/skills/change-management/SKILL.md +106 -0
- package/.mindforge/skills/chaos-engineering/SKILL.md +99 -0
- package/.mindforge/skills/ci-cd-pipeline/SKILL.md +118 -0
- package/.mindforge/skills/cli-design/SKILL.md +118 -0
- package/.mindforge/skills/code-generation-patterns/SKILL.md +92 -0
- package/.mindforge/skills/code-review-methodology/SKILL.md +180 -0
- package/.mindforge/skills/code-tour/SKILL.md +145 -0
- package/.mindforge/skills/codebase-onboarding/SKILL.md +95 -0
- package/.mindforge/skills/compliance-as-code/SKILL.md +195 -0
- package/.mindforge/skills/conflict-resolution/SKILL.md +87 -0
- package/.mindforge/skills/connection-pooling/SKILL.md +151 -0
- package/.mindforge/skills/container-security/SKILL.md +151 -0
- package/.mindforge/skills/context-engineering/SKILL.md +114 -0
- package/.mindforge/skills/contract-testing/SKILL.md +85 -0
- package/.mindforge/skills/cost-estimation/SKILL.md +82 -0
- package/.mindforge/skills/cqrs-event-sourcing/SKILL.md +95 -0
- package/.mindforge/skills/cross-platform-testing/SKILL.md +43 -0
- package/.mindforge/skills/data-governance/SKILL.md +42 -0
- package/.mindforge/skills/data-lakehouse/SKILL.md +42 -0
- package/.mindforge/skills/data-mesh/SKILL.md +42 -0
- package/.mindforge/skills/data-modeling/SKILL.md +107 -0
- package/.mindforge/skills/data-pipeline-design/SKILL.md +171 -0
- package/.mindforge/skills/data-privacy-engineering/SKILL.md +42 -0
- package/.mindforge/skills/database-performance/SKILL.md +174 -0
- package/.mindforge/skills/database-sharding-advanced/SKILL.md +206 -0
- package/.mindforge/skills/de-sloppify/SKILL.md +120 -0
- package/.mindforge/skills/defense-in-depth/SKILL.md +84 -0
- package/.mindforge/skills/delegation-patterns/SKILL.md +123 -0
- package/.mindforge/skills/dependency-management/SKILL.md +94 -0
- package/.mindforge/skills/deployment-workflow/SKILL.md +135 -0
- package/.mindforge/skills/design-system/SKILL.md +113 -0
- package/.mindforge/skills/developer-onboarding/SKILL.md +99 -0
- package/.mindforge/skills/developer-productivity-metrics/SKILL.md +59 -0
- package/.mindforge/skills/distributed-consensus/SKILL.md +141 -0
- package/.mindforge/skills/dmux-workflows/SKILL.md +141 -0
- package/.mindforge/skills/dns-architecture/SKILL.md +167 -0
- package/.mindforge/skills/ecommerce-architecture/SKILL.md +41 -0
- package/.mindforge/skills/edge-computing/SKILL.md +91 -0
- package/.mindforge/skills/edtech-platform/SKILL.md +41 -0
- package/.mindforge/skills/email-deliverability/SKILL.md +177 -0
- package/.mindforge/skills/embedding-systems/SKILL.md +55 -0
- package/.mindforge/skills/environment-management/SKILL.md +54 -0
- package/.mindforge/skills/error-handling-architecture/SKILL.md +118 -0
- package/.mindforge/skills/estimation-techniques/SKILL.md +113 -0
- package/.mindforge/skills/eval-harness/SKILL.md +180 -0
- package/.mindforge/skills/event-driven-architecture/SKILL.md +162 -0
- package/.mindforge/skills/experiment-design/SKILL.md +139 -0
- package/.mindforge/skills/experiment-platform/SKILL.md +43 -0
- package/.mindforge/skills/feature-engineering/SKILL.md +42 -0
- package/.mindforge/skills/feature-flag-management/SKILL.md +183 -0
- package/.mindforge/skills/fine-tuning-workflow/SKILL.md +189 -0
- package/.mindforge/skills/fintech-patterns/SKILL.md +41 -0
- package/.mindforge/skills/flutter-architecture/SKILL.md +42 -0
- package/.mindforge/skills/gaming-backend/SKILL.md +41 -0
- package/.mindforge/skills/git-workflow-design/SKILL.md +129 -0
- package/.mindforge/skills/graceful-degradation/SKILL.md +95 -0
- package/.mindforge/skills/graphql-patterns/SKILL.md +243 -0
- package/.mindforge/skills/guardrails-and-safety/SKILL.md +137 -0
- package/.mindforge/skills/healthcare-systems/SKILL.md +40 -0
- package/.mindforge/skills/hiring-engineering/SKILL.md +119 -0
- package/.mindforge/skills/human-in-the-loop-design/SKILL.md +234 -0
- package/.mindforge/skills/i18n-architecture/SKILL.md +147 -0
- package/.mindforge/skills/idempotency-patterns/SKILL.md +84 -0
- package/.mindforge/skills/incident-communication/SKILL.md +96 -0
- package/.mindforge/skills/incident-management/SKILL.md +97 -0
- package/.mindforge/skills/infrastructure-as-code/SKILL.md +98 -0
- package/.mindforge/skills/instinct-clustering/SKILL.md +190 -0
- package/.mindforge/skills/internal-developer-platform/SKILL.md +51 -0
- package/.mindforge/skills/iot-platform/SKILL.md +41 -0
- package/.mindforge/skills/k8s-deployment/SKILL.md +358 -0
- package/.mindforge/skills/knowledge-graphs/SKILL.md +56 -0
- package/.mindforge/skills/knowledge-sharing-systems/SKILL.md +112 -0
- package/.mindforge/skills/llm-cost-optimization/SKILL.md +198 -0
- package/.mindforge/skills/llm-orchestration/SKILL.md +56 -0
- package/.mindforge/skills/load-testing/SKILL.md +84 -0
- package/.mindforge/skills/logistics-optimization/SKILL.md +40 -0
- package/.mindforge/skills/market-researcher/SKILL.md +99 -0
- package/.mindforge/skills/marketplace-trust/SKILL.md +40 -0
- package/.mindforge/skills/mcp-server-patterns/SKILL.md +264 -0
- package/.mindforge/skills/media-streaming/SKILL.md +41 -0
- package/.mindforge/skills/meeting-architecture/SKILL.md +146 -0
- package/.mindforge/skills/mentoring-patterns/SKILL.md +77 -0
- package/.mindforge/skills/microservices-patterns/SKILL.md +83 -0
- package/.mindforge/skills/migration-platform/SKILL.md +61 -0
- package/.mindforge/skills/migration-strategies/SKILL.md +129 -0
- package/.mindforge/skills/ml-feature-store/SKILL.md +56 -0
- package/.mindforge/skills/ml-monitoring/SKILL.md +42 -0
- package/.mindforge/skills/mobile-performance/SKILL.md +44 -0
- package/.mindforge/skills/mobile-security/SKILL.md +45 -0
- package/.mindforge/skills/model-evaluation/SKILL.md +53 -0
- package/.mindforge/skills/monorepo-management/SKILL.md +100 -0
- package/.mindforge/skills/multi-tenancy-patterns/SKILL.md +145 -0
- package/.mindforge/skills/multi-turn-conversation-design/SKILL.md +206 -0
- package/.mindforge/skills/multimodal-ai/SKILL.md +51 -0
- package/.mindforge/skills/mutation-testing/SKILL.md +97 -0
- package/.mindforge/skills/notification-system-design/SKILL.md +168 -0
- package/.mindforge/skills/observability-stack/SKILL.md +136 -0
- package/.mindforge/skills/offline-first-design/SKILL.md +43 -0
- package/.mindforge/skills/on-call-design/SKILL.md +111 -0
- package/.mindforge/skills/pagination-patterns/SKILL.md +230 -0
- package/.mindforge/skills/payment-integration/SKILL.md +176 -0
- package/.mindforge/skills/performance-reviews/SKILL.md +140 -0
- package/.mindforge/skills/platform-observability/SKILL.md +58 -0
- package/.mindforge/skills/platform-reliability/SKILL.md +52 -0
- package/.mindforge/skills/post-incident-learning/SKILL.md +96 -0
- package/.mindforge/skills/product-manager/SKILL.md +104 -0
- package/.mindforge/skills/progressive-web-app/SKILL.md +44 -0
- package/.mindforge/skills/prompt-engineering/SKILL.md +94 -0
- package/.mindforge/skills/proofreader/SKILL.md +158 -0
- package/.mindforge/skills/push-notification-architecture/SKILL.md +45 -0
- package/.mindforge/skills/python-performance/SKILL.md +183 -0
- package/.mindforge/skills/quality-audit/SKILL.md +171 -0
- package/.mindforge/skills/queue-design/SKILL.md +85 -0
- package/.mindforge/skills/rag-architecture/SKILL.md +176 -0
- package/.mindforge/skills/rate-limiting-design/SKILL.md +94 -0
- package/.mindforge/skills/react-native-patterns/SKILL.md +42 -0
- package/.mindforge/skills/react-performance/SKILL.md +229 -0
- package/.mindforge/skills/real-time-analytics/SKILL.md +42 -0
- package/.mindforge/skills/real-time-sync/SKILL.md +83 -0
- package/.mindforge/skills/responsive-native/SKILL.md +44 -0
- package/.mindforge/skills/responsive-patterns/SKILL.md +141 -0
- package/.mindforge/skills/rfc-pipeline/SKILL.md +114 -0
- package/.mindforge/skills/saas-multi-tenant/SKILL.md +41 -0
- package/.mindforge/skills/santa-method/SKILL.md +134 -0
- package/.mindforge/skills/search-implementation/SKILL.md +98 -0
- package/.mindforge/skills/secrets-platform/SKILL.md +56 -0
- package/.mindforge/skills/secrets-rotation/SKILL.md +173 -0
- package/.mindforge/skills/self-serve-infrastructure/SKILL.md +51 -0
- package/.mindforge/skills/serverless-patterns/SKILL.md +119 -0
- package/.mindforge/skills/skill-creator-meta/SKILL.md +146 -0
- package/.mindforge/skills/sprint-retrospective-facilitation/SKILL.md +112 -0
- package/.mindforge/skills/stakeholder-communication/SKILL.md +85 -0
- package/.mindforge/skills/state-management/SKILL.md +104 -0
- package/.mindforge/skills/stream-processing/SKILL.md +43 -0
- package/.mindforge/skills/streaming-architecture/SKILL.md +81 -0
- package/.mindforge/skills/supply-chain-security/SKILL.md +145 -0
- package/.mindforge/skills/synthetic-data-generation/SKILL.md +52 -0
- package/.mindforge/skills/system-design/SKILL.md +88 -0
- package/.mindforge/skills/team-topology-design/SKILL.md +107 -0
- package/.mindforge/skills/technical-debt-management/SKILL.md +86 -0
- package/.mindforge/skills/technical-interview-design/SKILL.md +98 -0
- package/.mindforge/skills/technical-leadership/SKILL.md +75 -0
- package/.mindforge/skills/technical-writing/SKILL.md +237 -0
- package/.mindforge/skills/technology-radar/SKILL.md +88 -0
- package/.mindforge/skills/testing-anti-patterns/SKILL.md +288 -0
- package/.mindforge/skills/tool-design/SKILL.md +138 -0
- package/.mindforge/skills/typescript-advanced/SKILL.md +198 -0
- package/.mindforge/skills/using-git-worktrees/SKILL.md +139 -0
- package/.mindforge/skills/verification-loop/SKILL.md +13 -1
- package/.mindforge/skills/vibe-security/SKILL.md +165 -0
- package/.mindforge/skills/visual-regression-testing/SKILL.md +97 -0
- package/.mindforge/skills/websocket-patterns/SKILL.md +203 -0
- package/.mindforge/skills/writing-plans/SKILL.md +170 -0
- package/.mindforge/skills/writing-skills/SKILL.md +216 -0
- package/.mindforge/skills/zero-trust-architecture/SKILL.md +166 -0
- package/CHANGELOG.md +240 -0
- package/MINDFORGE.md +4 -4
- package/README.md +49 -4
- package/RELEASENOTES.md +80 -0
- package/SECURITY.md +20 -8
- package/bin/autonomous/audit-writer.js +13 -0
- package/bin/autonomous/auto-runner.js +74 -16
- package/bin/autonomous/context-refactorer.js +26 -11
- package/bin/autonomous/state-manager.js +62 -6
- package/bin/autonomous/stuck-monitor.js +46 -7
- package/bin/autonomous/wave-executor.js +66 -25
- package/bin/dashboard/api-router.js +43 -0
- package/bin/dashboard/metrics-aggregator.js +28 -1
- package/bin/dashboard/server.js +67 -4
- package/bin/dashboard/sse-bridge.js +4 -4
- package/bin/engine/feedback-loop.js +8 -0
- package/bin/engine/intelligence-interlock.js +32 -15
- package/bin/engine/logic-drift-detector.js +2 -1
- package/bin/engine/nexus-tracer.js +3 -2
- package/bin/engine/remediation-engine.js +155 -32
- package/bin/engine/self-corrective-synthesizer.js +84 -10
- package/bin/engine/sre-manager.js +12 -4
- package/bin/engine/temporal-hub.js +131 -34
- package/bin/governance/approve.js +41 -5
- package/bin/governance/impact-analyzer.js +28 -0
- package/bin/governance/policy-engine.js +10 -3
- package/bin/governance/quantum-crypto.js +32 -19
- package/bin/governance/rbac-manager.js +74 -2
- package/bin/governance/ztai-manager.js +49 -7
- package/bin/hindsight-injector.js +3 -3
- package/bin/memory/eis-client.js +71 -34
- package/bin/memory/embedding-engine.js +61 -0
- package/bin/memory/knowledge-graph.js +58 -5
- package/bin/memory/knowledge-indexer.js +53 -6
- package/bin/memory/knowledge-store.js +22 -0
- package/bin/migrations/10.7.0-to-11.0.0.js +110 -0
- package/bin/migrations/schema-versions.js +13 -0
- package/bin/models/anthropic-provider.js +45 -0
- package/bin/models/cloud-broker.js +68 -20
- package/bin/models/gemini-provider.js +51 -0
- package/bin/models/model-client.js +20 -0
- package/bin/models/model-router.js +28 -8
- package/bin/models/openai-provider.js +44 -0
- package/bin/utils/file-io.js +63 -1
- package/bin/utils/index.js +58 -0
- package/docs/getting-started.md +1 -1
- package/docs/user-guide.md +2 -2
- package/package.json +2 -2
- package/.mindforge/personas/data-privacy-engineer.md +0 -187
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-as-code
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 0.1.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: compliance as code, policy engine, OPA rego, automated compliance, audit evidence, SOC2 mapping, HIPAA control, compliance check, policy enforcement, control framework, compliance report, regulatory automation
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — Compliance as Code
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task involving automated compliance verification, policy-as-code implementation,
|
|
13
|
+
audit evidence generation, regulatory control mapping, or compliance CI integration.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before writing any code
|
|
18
|
+
1. Identify the compliance framework(s) applicable (SOC2, HIPAA, PCI-DSS, GDPR).
|
|
19
|
+
2. Map specific controls to technical policies that can be automated.
|
|
20
|
+
3. Define evidence requirements for each control.
|
|
21
|
+
|
|
22
|
+
### During implementation
|
|
23
|
+
- Write policies as code (OPA/Rego, Sentinel, Conftest).
|
|
24
|
+
- Integrate policy checks into CI pipeline (fail on violation).
|
|
25
|
+
- Generate machine-readable evidence automatically.
|
|
26
|
+
|
|
27
|
+
### After implementation
|
|
28
|
+
- Verify all mapped controls have automated verification.
|
|
29
|
+
- Set up continuous compliance dashboard with drift alerts.
|
|
30
|
+
- Document policy-to-control mapping in ARCHITECTURE.md.
|
|
31
|
+
|
|
32
|
+
## Policy Engines
|
|
33
|
+
|
|
34
|
+
### OPA (Open Policy Agent) with Rego
|
|
35
|
+
- General-purpose policy engine.
|
|
36
|
+
- Declarative policy language (Rego).
|
|
37
|
+
- Use for: infrastructure policies, API authorization, data access control.
|
|
38
|
+
- Integrations: Kubernetes (Gatekeeper), Terraform, CI pipelines, API gateways.
|
|
39
|
+
|
|
40
|
+
```rego
|
|
41
|
+
package terraform.aws
|
|
42
|
+
|
|
43
|
+
deny[msg] {
|
|
44
|
+
resource := input.resource.aws_s3_bucket[name]
|
|
45
|
+
not resource.server_side_encryption_configuration
|
|
46
|
+
msg := sprintf("S3 bucket '%s' must have encryption enabled", [name])
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### HashiCorp Sentinel
|
|
51
|
+
- Policy-as-code for Terraform Enterprise/Cloud.
|
|
52
|
+
- Enforces infrastructure policies before apply.
|
|
53
|
+
- Use for: cost controls, naming conventions, required tags, approved regions.
|
|
54
|
+
|
|
55
|
+
```hcl
|
|
56
|
+
import "tfplan"
|
|
57
|
+
|
|
58
|
+
main = rule {
|
|
59
|
+
all tfplan.resources.aws_instance as _, instances {
|
|
60
|
+
all instances as _, r {
|
|
61
|
+
r.applied.tags contains "environment"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Conftest
|
|
68
|
+
- Testing framework for structured configuration data.
|
|
69
|
+
- Uses OPA/Rego policies against YAML, JSON, HCL, Dockerfile.
|
|
70
|
+
- Use for: Kubernetes manifests, Docker configs, CI pipelines.
|
|
71
|
+
|
|
72
|
+
```rego
|
|
73
|
+
package main
|
|
74
|
+
|
|
75
|
+
deny[msg] {
|
|
76
|
+
input.kind == "Deployment"
|
|
77
|
+
not input.spec.template.spec.securityContext.runAsNonRoot
|
|
78
|
+
msg := "Containers must run as non-root"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Control Framework Mapping
|
|
83
|
+
|
|
84
|
+
### SOC2 Trust Service Criteria
|
|
85
|
+
| Control | Policy | Automated Check |
|
|
86
|
+
|---------|--------|-----------------|
|
|
87
|
+
| CC6.1 (Logical Access) | IAM least privilege | No wildcard permissions in policies |
|
|
88
|
+
| CC6.6 (System Boundaries) | Network segmentation | Security groups restrict ingress |
|
|
89
|
+
| CC7.2 (Monitoring) | Log aggregation | All services emit structured logs |
|
|
90
|
+
| CC8.1 (Change Management) | PR approval required | Branch protection rules enforced |
|
|
91
|
+
|
|
92
|
+
### HIPAA Security Rule (164.312)
|
|
93
|
+
| Control | Policy | Automated Check |
|
|
94
|
+
|---------|--------|-----------------|
|
|
95
|
+
| 164.312(a)(1) Access Control | Role-based access | RBAC policies enforced |
|
|
96
|
+
| 164.312(a)(2)(iv) Encryption | Data encrypted at rest | All storage encrypted |
|
|
97
|
+
| 164.312(b) Audit Controls | Audit logging | All PHI access logged |
|
|
98
|
+
| 164.312(e)(1) Transmission Security | TLS required | No HTTP endpoints |
|
|
99
|
+
|
|
100
|
+
### PCI-DSS
|
|
101
|
+
| Requirement | Policy | Automated Check |
|
|
102
|
+
|-------------|--------|-----------------|
|
|
103
|
+
| 2.2 System hardening | CIS benchmark | Configuration scanner passes |
|
|
104
|
+
| 3.4 Data encryption | Encryption at rest | Storage encryption verified |
|
|
105
|
+
| 6.5 Secure development | SAST/DAST | No critical findings in scan |
|
|
106
|
+
| 10.2 Audit trails | Comprehensive logging | All access events captured |
|
|
107
|
+
|
|
108
|
+
## Evidence Generation
|
|
109
|
+
|
|
110
|
+
### Automated Evidence Types
|
|
111
|
+
- **Configuration snapshots**: point-in-time state of security configs.
|
|
112
|
+
- **Policy evaluation results**: pass/fail with details for each control.
|
|
113
|
+
- **Access review reports**: who has access to what, generated automatically.
|
|
114
|
+
- **Deployment audit trails**: who deployed what, when, with what approval.
|
|
115
|
+
|
|
116
|
+
### Evidence Requirements
|
|
117
|
+
- Timestamped and immutable (stored in append-only log).
|
|
118
|
+
- Machine-readable (JSON/structured format for automated processing).
|
|
119
|
+
- Traceable (linked to specific control and policy).
|
|
120
|
+
- Continuous (generated on every change, not just at audit time).
|
|
121
|
+
|
|
122
|
+
### Example Evidence Output
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"control": "CC6.1",
|
|
126
|
+
"framework": "SOC2",
|
|
127
|
+
"policy": "no-wildcard-iam-permissions",
|
|
128
|
+
"result": "PASS",
|
|
129
|
+
"timestamp": "2024-01-15T10:30:00Z",
|
|
130
|
+
"resource": "arn:aws:iam::123456:policy/app-service",
|
|
131
|
+
"details": "No wildcard actions found in policy document",
|
|
132
|
+
"evidence_hash": "sha256:abc123..."
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## CI Pipeline Integration
|
|
137
|
+
|
|
138
|
+
### Pipeline Stage: Policy Check
|
|
139
|
+
```yaml
|
|
140
|
+
stages:
|
|
141
|
+
- name: compliance-check
|
|
142
|
+
steps:
|
|
143
|
+
- conftest test --policy policies/ deployment.yaml
|
|
144
|
+
- opa eval --data policies/ --input tfplan.json "data.terraform.deny"
|
|
145
|
+
on_failure: block_deployment
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Enforcement Levels
|
|
149
|
+
- **Advisory**: log warning, don't block (for new policies being rolled out).
|
|
150
|
+
- **Soft mandatory**: block with override option (requires approval).
|
|
151
|
+
- **Hard mandatory**: block deployment, no override (critical security controls).
|
|
152
|
+
|
|
153
|
+
### Gradual Rollout of New Policies
|
|
154
|
+
1. Deploy policy in advisory mode (2 weeks).
|
|
155
|
+
2. Review violations, adjust policy if false positives.
|
|
156
|
+
3. Promote to soft mandatory (2 weeks).
|
|
157
|
+
4. Promote to hard mandatory after all violations resolved.
|
|
158
|
+
|
|
159
|
+
## Compliance Dashboard
|
|
160
|
+
|
|
161
|
+
### Key Metrics
|
|
162
|
+
- **Compliance score**: percentage of controls with passing automated checks.
|
|
163
|
+
- **Drift count**: controls that passed previously but now fail.
|
|
164
|
+
- **Time to remediate**: average time from violation detection to fix.
|
|
165
|
+
- **Coverage**: percentage of controls with automated verification.
|
|
166
|
+
|
|
167
|
+
### Alerting
|
|
168
|
+
- Drift detected: immediate alert to security team.
|
|
169
|
+
- New violation in PR: block merge, notify developer.
|
|
170
|
+
- Compliance score drops below threshold: escalate to CISO.
|
|
171
|
+
- Evidence generation failure: alert compliance team.
|
|
172
|
+
|
|
173
|
+
## Reporting
|
|
174
|
+
|
|
175
|
+
### Continuous Compliance Report
|
|
176
|
+
- Generated on demand or on schedule (weekly/monthly).
|
|
177
|
+
- Shows: all controls, current status, evidence links, violation history.
|
|
178
|
+
- Format: PDF for auditors, JSON for automated systems.
|
|
179
|
+
|
|
180
|
+
### Audit Preparation
|
|
181
|
+
- Pre-audit checklist: verify all evidence is current and complete.
|
|
182
|
+
- Gap analysis: identify controls without automated verification.
|
|
183
|
+
- Remediation tracking: SLA for fixing violations.
|
|
184
|
+
|
|
185
|
+
## Self-check before task completion
|
|
186
|
+
|
|
187
|
+
Before marking a task done when this skill was active:
|
|
188
|
+
|
|
189
|
+
- [ ] Did I read the full SKILL.md before starting? (Not just the triggers)
|
|
190
|
+
- [ ] Is every control mapped to an automated policy?
|
|
191
|
+
- [ ] Are policies integrated into CI (blocking on violation)?
|
|
192
|
+
- [ ] Is evidence generated automatically (not manually)?
|
|
193
|
+
- [ ] Is there a compliance dashboard with drift alerting?
|
|
194
|
+
- [ ] Are enforcement levels appropriate (advisory → soft → hard)?
|
|
195
|
+
- [ ] Is the policy-to-control mapping documented?
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: conflict-resolution
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.3.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: conflict resolution engineering, technical disagreement, architecture debate, priority conflict resolution, team friction, code review conflict, design decision deadlock, tech stack disagreement, cross-team dispute, engineering opinion conflict, consensus building, disagree and commit
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Conflict Resolution
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
|
|
13
|
+
This skill activates when resolving technical disagreements, mediating architecture debates, handling priority conflicts, addressing team friction, or breaking design decision deadlocks. It applies to tech leads, engineering managers, and senior engineers who must navigate conflicts and drive teams toward resolution.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before engaging in conflict resolution
|
|
18
|
+
|
|
19
|
+
1. **Diagnose the conflict type** — Is this a technical disagreement (different approaches to the same goal), a priority conflict (what to work on first), or an interpersonal conflict (personality clash)? Different types require different interventions.
|
|
20
|
+
2. **Verify the conflict is real** — Sometimes perceived conflicts are actually misunderstandings. Ask each party to state their position and their understanding of the other party's position. Clarify before attempting resolution.
|
|
21
|
+
3. **Assess stakes and urgency** — Low-stakes conflicts (coding style preference) can be deferred or decided by convention. High-stakes conflicts (architectural choice) require immediate resolution. Triage accordingly.
|
|
22
|
+
4. **Check your neutrality** — If you have a strong opinion on the outcome, you're not a neutral mediator. Either recuse yourself or explicitly acknowledge your bias before facilitating.
|
|
23
|
+
|
|
24
|
+
### During conflict resolution
|
|
25
|
+
|
|
26
|
+
#### Technical Disagreements
|
|
27
|
+
|
|
28
|
+
- **Separate facts from opinions** — Facts: "Option A has 200ms latency." Opinions: "Option A feels cleaner." Debate facts rigorously. Acknowledge opinions but deprioritize them.
|
|
29
|
+
- **Demand evidence** — Don't let "I think" or "in my experience" dominate. Require benchmarks, prototypes, or references to real-world implementations. Speculation loses to data.
|
|
30
|
+
- **Use ADRs (Architecture Decision Records)** — Formalize the debate: each side writes a proposal with context, decision, consequences, and alternatives rejected. Writing forces rigor and surfaces unstated assumptions.
|
|
31
|
+
- **Run time-boxed experiments** — If the debate can't be resolved theoretically, prototype both approaches. Two engineers, two days, working implementation. Compare results objectively.
|
|
32
|
+
- **Escalate with recommendations** — If consensus is impossible, escalate to the tech lead or architect with a clear summary of both positions and a recommended path. Don't ask them to re-litigate the debate.
|
|
33
|
+
|
|
34
|
+
#### Architecture Debates
|
|
35
|
+
|
|
36
|
+
- **Ground in requirements** — What are the non-negotiable constraints? Performance? Scalability? Maintainability? Cost? Often debates evaporate when requirements are explicit.
|
|
37
|
+
- **Identify tradeoffs explicitly** — No architecture is strictly better. Microservices improve scalability but increase operational complexity. Monoliths simplify deployment but limit independent scaling. Name the tradeoffs.
|
|
38
|
+
- **Use the "two-way door" test** — If the decision is reversible, pick one and move on. If it's a one-way door (hard to undo), invest more time in deliberation.
|
|
39
|
+
- **Timebox the debate** — Architecture debates can spiral. Set a 1-hour limit. If no consensus, escalate or use decision frameworks (DACI, voting, tech lead decides).
|
|
40
|
+
- **Agree on success criteria** — Before implementing, define how you'll evaluate the choice in 3-6 months. If metric X doesn't improve, revert or pivot.
|
|
41
|
+
|
|
42
|
+
#### Priority Conflicts
|
|
43
|
+
|
|
44
|
+
- **Quantify impact** — Use a simple framework: Revenue Impact (High/Medium/Low), Risk Mitigation (High/Medium/Low), Strategic Alignment (High/Medium/Low). Score each project. Prioritize High-High-High over Low-Low-Low.
|
|
45
|
+
- **Surface opportunity cost** — Every "yes" to one project is a "no" to another. Make the tradeoff explicit: "If we prioritize Project A, Project B slips by 6 weeks. Is that acceptable?"
|
|
46
|
+
- **Involve stakeholders early** — Priority conflicts between engineering and product require product input. Don't let engineers decide in isolation.
|
|
47
|
+
- **Revisit priorities regularly** — Priorities change. Revisit every quarter. Don't cling to a roadmap when circumstances shift.
|
|
48
|
+
|
|
49
|
+
#### Code Review Conflicts
|
|
50
|
+
|
|
51
|
+
- **Distinguish style from substance** — Style conflicts (tabs vs spaces, single quotes vs double quotes) should be decided by linters, not humans. Substance conflicts (error handling, edge cases) require discussion.
|
|
52
|
+
- **Use "strong opinions, weakly held"** — If the reviewer feels strongly, they should explain why. If the author disagrees, they should explain their reasoning. The senior engineer or tech lead breaks the tie if necessary.
|
|
53
|
+
- **Offer alternatives, not just criticism** — Don't say "This is wrong." Say "Have you considered X? It avoids Y problem and simplifies Z."
|
|
54
|
+
- **Distinguish blocking from non-blocking feedback** — Blocking: correctness issues, security vulnerabilities, performance regressions. Non-blocking: refactoring suggestions, readability improvements. Blocking feedback must be addressed before merge. Non-blocking can be deferred to a follow-up PR.
|
|
55
|
+
|
|
56
|
+
#### Interpersonal Conflicts
|
|
57
|
+
|
|
58
|
+
- **Separate behavior from identity** — Address observable behavior, not personality. "You interrupted Sarah three times in the last meeting" is actionable. "You're rude" is a personal attack.
|
|
59
|
+
- **Hold 1:1 conversations first** — Don't surface interpersonal conflict in group settings. Speak to each party individually, understand their perspective, then bring them together.
|
|
60
|
+
- **Use "I" statements, not "you" statements** — "I felt frustrated when the deadline slipped without warning" is less defensive than "You failed to communicate the delay."
|
|
61
|
+
- **Focus on shared goals** — Remind both parties: we're all trying to ship great software. Conflict over approach is healthy. Conflict over personalities is not.
|
|
62
|
+
- **Escalate when necessary** — If conflict is causing sustained team dysfunction, escalate to your manager or HR. Don't try to play therapist.
|
|
63
|
+
|
|
64
|
+
#### Consensus Building
|
|
65
|
+
|
|
66
|
+
- **Start with alignment** — Find common ground first. "We all agree the system is too slow. The disagreement is whether to optimize queries or add caching." Starting with agreement reduces defensiveness.
|
|
67
|
+
- **Use the "disagree and commit" principle** — If consensus is impossible and time is limited, the decision-maker (tech lead, architect, manager) makes the call. Dissenters must commit fully once the decision is made, even if they disagreed.
|
|
68
|
+
- **Document dissent respectfully** — If someone strongly disagrees, allow them to document their concerns in the ADR. Future-you will appreciate knowing what tradeoffs were considered.
|
|
69
|
+
- **Revisit after implementation** — Schedule a retrospective 3-6 months later. Was the decision correct? What would we do differently next time? Learning compounds with reflection.
|
|
70
|
+
|
|
71
|
+
### After conflict resolution
|
|
72
|
+
|
|
73
|
+
- **Document the resolution** — Write down: what the conflict was, what decision was made, who made it, and what the reasoning was. Prevents re-litigating the same debate in 6 months.
|
|
74
|
+
- **Verify buy-in** — After resolution, check with each party individually: "Are you on board with this decision?" Surface any lingering resentment before it festers.
|
|
75
|
+
- **Monitor team dynamics** — Conflict can damage relationships. Check in with team members regularly. If trust is broken, actively rebuild it through transparent communication and collaboration.
|
|
76
|
+
- **Reflect on resolution effectiveness** — Did the conflict resolution process work? Was it too slow? Too rushed? Adjust your approach for next time.
|
|
77
|
+
|
|
78
|
+
## Self-check before task completion
|
|
79
|
+
|
|
80
|
+
- [ ] Conflict type is diagnosed (technical, priority, or interpersonal)
|
|
81
|
+
- [ ] Evidence and facts are used to ground technical disagreements, not opinions
|
|
82
|
+
- [ ] Tradeoffs are explicitly identified in architecture debates
|
|
83
|
+
- [ ] Priority conflicts are quantified with impact scoring (revenue, risk, strategy)
|
|
84
|
+
- [ ] Code review conflicts distinguish blocking vs non-blocking feedback
|
|
85
|
+
- [ ] Interpersonal conflicts address observable behavior, not personality
|
|
86
|
+
- [ ] Resolution is documented with decision rationale and alternatives considered
|
|
87
|
+
- [ ] Buy-in is verified with each party after resolution
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: connection-pooling
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 0.1.0
|
|
5
|
+
status: stable
|
|
6
|
+
compose: database-patterns
|
|
7
|
+
triggers: connection pooling, pool sizing, connection lifecycle, pgbouncer, connection leak, pool exhaustion, connection timeout, pool monitoring, connection reuse, max connections, idle connection, pool configuration
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Skill — Connection Pooling
|
|
11
|
+
|
|
12
|
+
## When this skill activates
|
|
13
|
+
Any task involving database connection pool configuration, pool sizing,
|
|
14
|
+
connection leak debugging, PgBouncer setup, or pool exhaustion issues.
|
|
15
|
+
|
|
16
|
+
## Mandatory actions when this skill is active
|
|
17
|
+
|
|
18
|
+
### Before writing any code
|
|
19
|
+
1. Determine the workload characteristics (connection duration, concurrency level).
|
|
20
|
+
2. Calculate optimal pool size using the sizing formula.
|
|
21
|
+
3. Identify whether application-level or external pooling is appropriate.
|
|
22
|
+
|
|
23
|
+
### During implementation
|
|
24
|
+
- Configure connection validation (test-on-borrow or background validation).
|
|
25
|
+
- Set appropriate timeouts for checkout, idle eviction, and max lifetime.
|
|
26
|
+
- Add leak detection with stack trace logging.
|
|
27
|
+
|
|
28
|
+
### After implementation
|
|
29
|
+
- Monitor pool metrics (active, idle, waiting counts).
|
|
30
|
+
- Set alerts for pool exhaustion and high wait times.
|
|
31
|
+
- Document pool configuration in ARCHITECTURE.md.
|
|
32
|
+
|
|
33
|
+
## Pool Sizing Formula
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
optimal_pool_size = (core_count * 2) + effective_disk_spindles
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- For SSD: effective_spindles = 1 (low seek time).
|
|
40
|
+
- Typical range: 20-50 connections per application instance.
|
|
41
|
+
- More connections != better performance (context switching overhead).
|
|
42
|
+
- PostgreSQL max_connections default is 100 — shared across ALL clients.
|
|
43
|
+
|
|
44
|
+
### Example Calculations
|
|
45
|
+
| Cores | Storage | Formula | Pool Size |
|
|
46
|
+
|-------|---------|---------|-----------|
|
|
47
|
+
| 4 | SSD | (4*2)+1 | 9 |
|
|
48
|
+
| 8 | SSD | (8*2)+1 | 17 |
|
|
49
|
+
| 16 | HDD (4 disks) | (16*2)+4 | 36 |
|
|
50
|
+
|
|
51
|
+
## Connection Lifecycle
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
CREATE → VALIDATE → USE → RETURN → IDLE → EVICT
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Create
|
|
58
|
+
- Establishing a new connection (expensive: TCP handshake + auth + TLS).
|
|
59
|
+
- Pool pre-creates `min_idle` connections at startup.
|
|
60
|
+
|
|
61
|
+
### Validate
|
|
62
|
+
- Test connection is still alive before handing to application.
|
|
63
|
+
- Methods: `SELECT 1`, TCP keepalive, driver-level ping.
|
|
64
|
+
- Background validation preferred over test-on-borrow (lower latency).
|
|
65
|
+
|
|
66
|
+
### Use
|
|
67
|
+
- Application borrows connection from pool.
|
|
68
|
+
- Connection is marked as "active" — not available to others.
|
|
69
|
+
- Timeout if application holds too long (leak detection trigger).
|
|
70
|
+
|
|
71
|
+
### Return
|
|
72
|
+
- Application returns connection to pool after query completes.
|
|
73
|
+
- Connection reset (clear session state, temp tables, transaction state).
|
|
74
|
+
|
|
75
|
+
### Idle
|
|
76
|
+
- Connection sits in pool waiting for next request.
|
|
77
|
+
- `idle_timeout`: evict if unused for too long (default: 10 minutes).
|
|
78
|
+
- `max_lifetime`: destroy after absolute age (default: 30 minutes).
|
|
79
|
+
|
|
80
|
+
### Evict
|
|
81
|
+
- Connection destroyed (closed at TCP level).
|
|
82
|
+
- Reasons: idle timeout, max lifetime, validation failure, pool shrinking.
|
|
83
|
+
|
|
84
|
+
## PgBouncer Modes
|
|
85
|
+
|
|
86
|
+
### Session Pooling
|
|
87
|
+
- Connection assigned to client for entire session duration.
|
|
88
|
+
- Supports all PostgreSQL features (prepared statements, LISTEN/NOTIFY).
|
|
89
|
+
- Least efficient — similar to no pooling.
|
|
90
|
+
|
|
91
|
+
### Transaction Pooling (Recommended)
|
|
92
|
+
- Connection assigned per transaction, returned after COMMIT/ROLLBACK.
|
|
93
|
+
- Most common production mode.
|
|
94
|
+
- Limitations: no prepared statements, no session-level SET commands.
|
|
95
|
+
|
|
96
|
+
### Statement Pooling
|
|
97
|
+
- Connection assigned per individual statement.
|
|
98
|
+
- Most aggressive sharing — highest connection efficiency.
|
|
99
|
+
- Limitations: no transactions, no multi-statement operations.
|
|
100
|
+
|
|
101
|
+
## Leak Detection
|
|
102
|
+
|
|
103
|
+
### Symptoms
|
|
104
|
+
- Pool exhaustion (all connections checked out, waiters queuing).
|
|
105
|
+
- Gradually increasing active connection count over time.
|
|
106
|
+
- Application hangs waiting for connection from pool.
|
|
107
|
+
|
|
108
|
+
### Detection
|
|
109
|
+
- `checkout_timeout`: fail fast if no connection available within N seconds.
|
|
110
|
+
- `leak_detection_threshold`: log stack trace if connection held > N seconds.
|
|
111
|
+
- Monitor: connections_active should correlate with request rate.
|
|
112
|
+
|
|
113
|
+
### Prevention
|
|
114
|
+
- Always use try-with-resources / context managers.
|
|
115
|
+
- Set aggressive checkout timeouts (5-10 seconds).
|
|
116
|
+
- Connection wrapper that auto-returns on GC (safety net, not primary).
|
|
117
|
+
|
|
118
|
+
## Pool Exhaustion Handling
|
|
119
|
+
|
|
120
|
+
### DO
|
|
121
|
+
- Queue with timeout (wait up to 5s for available connection).
|
|
122
|
+
- Return clear error message: "Connection pool exhausted, try again later."
|
|
123
|
+
- Alert operations team immediately.
|
|
124
|
+
- Log queue depth and wait times.
|
|
125
|
+
|
|
126
|
+
### DO NOT
|
|
127
|
+
- Create unlimited connections (will crash the database).
|
|
128
|
+
- Retry immediately in a tight loop (makes it worse).
|
|
129
|
+
- Silently wait forever (request hangs, client times out).
|
|
130
|
+
|
|
131
|
+
## Monitoring Metrics
|
|
132
|
+
|
|
133
|
+
| Metric | Alert Threshold | Description |
|
|
134
|
+
|--------|----------------|-------------|
|
|
135
|
+
| `pool.active` | > 80% of max | Connections in use |
|
|
136
|
+
| `pool.idle` | < 2 | Available connections |
|
|
137
|
+
| `pool.waiting` | > 0 for > 5s | Requests queued for connection |
|
|
138
|
+
| `pool.checkout_time_avg` | > 100ms | Time to acquire connection |
|
|
139
|
+
| `pool.timeout_count` | > 0 | Failed connection acquisitions |
|
|
140
|
+
| `pool.create_count` | Spike detection | New connections being created |
|
|
141
|
+
|
|
142
|
+
## Self-check before task completion
|
|
143
|
+
|
|
144
|
+
Before marking a task done when this skill was active:
|
|
145
|
+
|
|
146
|
+
- [ ] Did I read the full SKILL.md before starting? (Not just the triggers)
|
|
147
|
+
- [ ] Is pool size calculated using the formula (not arbitrary)?
|
|
148
|
+
- [ ] Are connection timeouts configured (checkout, idle, max lifetime)?
|
|
149
|
+
- [ ] Is leak detection enabled with stack trace logging?
|
|
150
|
+
- [ ] Are pool metrics instrumented and alerting configured?
|
|
151
|
+
- [ ] Is the pooling mode appropriate for the workload?
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: container-security
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.1.1
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: container security, image scanning, runtime policy, rootless container, secrets injection, container network policy, pod security standard, image provenance, base image hardening, container isolation, runtime detection, supply chain container
|
|
7
|
+
compose: security-review
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Skill — Container Security
|
|
11
|
+
|
|
12
|
+
## When this skill activates
|
|
13
|
+
Any task involving container image security, runtime hardening,
|
|
14
|
+
Kubernetes security policies, container secret management,
|
|
15
|
+
or supply chain integrity for containerized workloads.
|
|
16
|
+
|
|
17
|
+
## Mandatory actions when this skill is active
|
|
18
|
+
|
|
19
|
+
### Before writing any code
|
|
20
|
+
1. Select base image strategy (distroless preferred, Alpine acceptable, Ubuntu last resort).
|
|
21
|
+
2. Identify secrets required and injection mechanism (never env vars in manifests).
|
|
22
|
+
3. Define network policy requirements (default-deny baseline).
|
|
23
|
+
4. Determine Pod Security Standard level (restricted > baseline > privileged).
|
|
24
|
+
|
|
25
|
+
### During implementation
|
|
26
|
+
- Pin base images by digest (not just tag) for reproducibility.
|
|
27
|
+
- Run as non-root user (UID > 10000).
|
|
28
|
+
- Set filesystem to read-only where possible.
|
|
29
|
+
- Drop all Linux capabilities, add back only what's needed.
|
|
30
|
+
- Never store secrets in image layers or environment variables in manifests.
|
|
31
|
+
- Use multi-stage builds to exclude build tools from runtime image.
|
|
32
|
+
|
|
33
|
+
### After implementation
|
|
34
|
+
- Run Trivy/Grype scan — block on CRITICAL or HIGH CVEs.
|
|
35
|
+
- Sign image with cosign and generate SBOM.
|
|
36
|
+
- Verify Pod Security Standard compliance.
|
|
37
|
+
- Test NetworkPolicy blocks unauthorized traffic.
|
|
38
|
+
- Confirm secrets are injected at runtime (not baked in).
|
|
39
|
+
|
|
40
|
+
## Image Scanning
|
|
41
|
+
|
|
42
|
+
### CI Pipeline Integration
|
|
43
|
+
```yaml
|
|
44
|
+
# Block deployment if critical CVEs found
|
|
45
|
+
- trivy image --severity CRITICAL,HIGH --exit-code 1 $IMAGE
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Scan Frequency
|
|
49
|
+
- On every build (CI gate).
|
|
50
|
+
- Weekly scheduled scan of running images (new CVEs discovered post-deploy).
|
|
51
|
+
- Before promotion between environments.
|
|
52
|
+
|
|
53
|
+
### Vulnerability Management
|
|
54
|
+
- CRITICAL: Block deployment, fix immediately.
|
|
55
|
+
- HIGH: Block deployment, fix within 48 hours.
|
|
56
|
+
- MEDIUM: Track, fix within sprint.
|
|
57
|
+
- LOW: Backlog, fix opportunistically.
|
|
58
|
+
|
|
59
|
+
## Base Image Strategy
|
|
60
|
+
|
|
61
|
+
| Priority | Image Type | Use Case |
|
|
62
|
+
|----------|-----------|----------|
|
|
63
|
+
| 1 | `gcr.io/distroless/static` | Go binaries, no shell needed |
|
|
64
|
+
| 2 | `gcr.io/distroless/base` | C/C++ apps needing libc |
|
|
65
|
+
| 3 | `alpine:3.x` | When shell/package manager needed |
|
|
66
|
+
| 4 | `ubuntu:22.04-minimal` | Complex runtime dependencies |
|
|
67
|
+
|
|
68
|
+
### Rules
|
|
69
|
+
- Pin by digest: `FROM alpine@sha256:abc123...`
|
|
70
|
+
- Rebuild weekly to pick up base image security patches.
|
|
71
|
+
- Never use `latest` tag in production.
|
|
72
|
+
|
|
73
|
+
## Runtime Hardening
|
|
74
|
+
|
|
75
|
+
### Pod Security Standards (Kubernetes)
|
|
76
|
+
|
|
77
|
+
**Restricted (target for all workloads):**
|
|
78
|
+
```yaml
|
|
79
|
+
securityContext:
|
|
80
|
+
runAsNonRoot: true
|
|
81
|
+
runAsUser: 10001
|
|
82
|
+
readOnlyRootFilesystem: true
|
|
83
|
+
allowPrivilegeEscalation: false
|
|
84
|
+
capabilities:
|
|
85
|
+
drop: ["ALL"]
|
|
86
|
+
seccompProfile:
|
|
87
|
+
type: RuntimeDefault
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Container Isolation
|
|
91
|
+
- Use gVisor or Kata Containers for untrusted workloads.
|
|
92
|
+
- Separate namespaces for different trust levels.
|
|
93
|
+
- Resource limits (CPU, memory) to prevent DoS.
|
|
94
|
+
|
|
95
|
+
## Secrets Management
|
|
96
|
+
|
|
97
|
+
### Injection Methods (Ranked)
|
|
98
|
+
1. **External Secrets Operator** → syncs from Vault/AWS SM to K8s Secret → volume mount.
|
|
99
|
+
2. **Vault Agent Sidecar** → injects secrets into shared volume at runtime.
|
|
100
|
+
3. **CSI Secret Store Driver** → mounts secrets as files.
|
|
101
|
+
4. **Sealed Secrets** → encrypted in Git, decrypted in cluster.
|
|
102
|
+
|
|
103
|
+
### Anti-patterns (NEVER do)
|
|
104
|
+
- Secrets as environment variables in Pod spec/Deployment manifest.
|
|
105
|
+
- Secrets baked into container image.
|
|
106
|
+
- Secrets in ConfigMaps.
|
|
107
|
+
- Secrets committed to Git (even "encrypted" without proper tooling).
|
|
108
|
+
|
|
109
|
+
## Network Policies
|
|
110
|
+
|
|
111
|
+
### Default Deny Baseline
|
|
112
|
+
```yaml
|
|
113
|
+
apiVersion: networking.k8s.io/v1
|
|
114
|
+
kind: NetworkPolicy
|
|
115
|
+
metadata:
|
|
116
|
+
name: default-deny-all
|
|
117
|
+
spec:
|
|
118
|
+
podSelector: {}
|
|
119
|
+
policyTypes:
|
|
120
|
+
- Ingress
|
|
121
|
+
- Egress
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then explicitly allow required flows:
|
|
125
|
+
- Ingress: only from specific services/namespaces.
|
|
126
|
+
- Egress: only to required databases, APIs, DNS.
|
|
127
|
+
|
|
128
|
+
## Supply Chain Integrity
|
|
129
|
+
|
|
130
|
+
### Image Provenance
|
|
131
|
+
1. Sign all images with `cosign` in CI.
|
|
132
|
+
2. Generate SBOM (Software Bill of Materials) with `syft`.
|
|
133
|
+
3. Enforce signature verification in admission controller (Kyverno/OPA).
|
|
134
|
+
4. Use deterministic builds for reproducibility.
|
|
135
|
+
|
|
136
|
+
### Admission Control
|
|
137
|
+
- Reject unsigned images.
|
|
138
|
+
- Reject images from untrusted registries.
|
|
139
|
+
- Reject images with known critical CVEs.
|
|
140
|
+
- Reject pods violating security context requirements.
|
|
141
|
+
|
|
142
|
+
## Self-check
|
|
143
|
+
- [ ] Base image pinned by digest.
|
|
144
|
+
- [ ] Non-root user configured.
|
|
145
|
+
- [ ] Read-only filesystem enabled.
|
|
146
|
+
- [ ] All capabilities dropped (add back minimally).
|
|
147
|
+
- [ ] Image scanned with zero CRITICAL/HIGH CVEs.
|
|
148
|
+
- [ ] Secrets injected at runtime (not in manifest or image).
|
|
149
|
+
- [ ] NetworkPolicy default-deny applied.
|
|
150
|
+
- [ ] Image signed and SBOM generated.
|
|
151
|
+
- [ ] Pod Security Standard: restricted level.
|