@jetrabbits/agentic 0.0.3 → 0.0.4
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/AGENTS.md +6 -0
- package/README.md +1 -0
- package/areas/devops/ci-cd/prompts/release-pipeline.md +69 -79
- package/areas/devops/ci-cd/rules/supply-chain-security.md +39 -19
- package/areas/devops/ci-cd/skills/github-actions-patterns/SKILL.md +6 -1
- package/areas/devops/ci-cd/skills/pipeline-security/SKILL.md +54 -119
- package/areas/devops/ci-cd/workflows/release-pipeline.md +72 -62
- package/areas/devops/kubernetes/skills/pod-troubleshooting/SKILL.md +1 -1
- package/areas/devops/observability/rules/alerting-standards.md +37 -31
- package/areas/devops/observability/rules/golden-signals.md +29 -20
- package/areas/devops/observability/skills/distributed-tracing/SKILL.md +10 -1
- package/areas/software/backend/rules/security.md +32 -12
- package/areas/software/frontend/skills/component-design/SKILL.md +13 -1
- package/areas/software/full-stack/rules/security-guide.md +48 -12
- package/areas/software/security/prompts/security-scan.md +47 -55
- package/areas/software/security/rules/dependency-policy.md +43 -8
- package/areas/software/security/skills/dependency-audit/SKILL.md +46 -25
- package/areas/software/security/skills/threat-modeling/SKILL.md +26 -0
- package/package.json +1 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
name: release-pipeline
|
|
3
3
|
type: workflow
|
|
4
4
|
trigger: /release-pipeline
|
|
5
|
-
description: Run a
|
|
5
|
+
description: Run a production release with supply-chain verification, database compatibility controls, progressive delivery, and measurable rollback criteria.
|
|
6
6
|
inputs:
|
|
7
7
|
- version (semver: v1.2.3)
|
|
8
8
|
- release_notes (optional)
|
|
9
|
+
- risk_level (low|medium|high)
|
|
9
10
|
outputs:
|
|
10
11
|
- published_release
|
|
11
12
|
- deployed_version
|
|
@@ -15,6 +16,7 @@ roles:
|
|
|
15
16
|
- developer
|
|
16
17
|
- team-lead
|
|
17
18
|
- pm
|
|
19
|
+
- qa
|
|
18
20
|
execution:
|
|
19
21
|
initiator: developer
|
|
20
22
|
related-rules:
|
|
@@ -27,89 +29,97 @@ uses-skills:
|
|
|
27
29
|
- pipeline-security
|
|
28
30
|
quality-gates:
|
|
29
31
|
- all CI gates pass on release commit
|
|
30
|
-
- image signed and SBOM attached before deploy
|
|
31
|
-
- staging deploy healthy
|
|
32
|
+
- image signed, provenance generated, and SBOM attached before deploy
|
|
33
|
+
- staging deploy healthy >= 15 min before production gate
|
|
32
34
|
- manual approval from team-lead for production
|
|
35
|
+
- rollback criteria defined before canary starts
|
|
33
36
|
---
|
|
34
37
|
|
|
35
38
|
## Steps
|
|
36
39
|
|
|
37
|
-
### 1.
|
|
40
|
+
### 1. Release Readiness and Freeze Check — `@team-lead` + `@pm`
|
|
38
41
|
- **Actions:**
|
|
39
|
-
- Confirm no active P0/P1 incidents
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
- **Done when:** all checks green; team-lead approves release to proceed
|
|
42
|
+
- Confirm no active P0/P1 incidents.
|
|
43
|
+
- Confirm release window is approved (freeze policy respected).
|
|
44
|
+
- Assign release owner, rollback owner, and incident commander.
|
|
45
|
+
- Confirm stakeholder communication plan (`#deployments`, support, customer-facing status if needed).
|
|
46
|
+
- **Done when:** readiness checklist signed by team-lead.
|
|
45
47
|
|
|
46
|
-
### 2.
|
|
48
|
+
### 2. Database Compatibility Gate — `@developer` + `@devops-engineer`
|
|
47
49
|
- **Actions:**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **Output:** git tag triggers release pipeline in CI
|
|
54
|
-
- **Done when:** CI pipeline starts on the tag event
|
|
50
|
+
- Validate schema changes follow **expand/contract** strategy.
|
|
51
|
+
- Forbid destructive migrations in same release as dependent app change.
|
|
52
|
+
- Ensure old and new app versions can run concurrently during canary.
|
|
53
|
+
- Prepare rollback-safe migration plan.
|
|
54
|
+
- **Done when:** DB compatibility checklist is green.
|
|
55
55
|
|
|
56
|
-
### 3.
|
|
56
|
+
### 3. Tag Release — `@developer`
|
|
57
|
+
```bash
|
|
58
|
+
git tag -a v${VERSION} -m "Release v${VERSION}: ${RELEASE_NOTES}"
|
|
59
|
+
git push origin v${VERSION}
|
|
60
|
+
```
|
|
61
|
+
- **Done when:** tag-triggered pipeline starts.
|
|
62
|
+
|
|
63
|
+
### 4. CI Release Pipeline (automated) — CI system
|
|
57
64
|
- **Stages:**
|
|
58
|
-
1. `validate` — lint
|
|
59
|
-
2. `build` —
|
|
60
|
-
3. `sign` — `cosign sign`
|
|
61
|
-
4. `
|
|
62
|
-
5. `
|
|
63
|
-
|
|
65
|
+
1. `validate` — lint/test/type/security checks.
|
|
66
|
+
2. `build` — immutable image digest produced.
|
|
67
|
+
3. `sign` — keyless `cosign sign` on digest.
|
|
68
|
+
4. `attest` — SLSA provenance generated.
|
|
69
|
+
5. `sbom` — CycloneDX/SPDX SBOM generated + attached.
|
|
70
|
+
6. `verify` — signature/provenance identity checks.
|
|
71
|
+
7. `publish` — publish artifact and release notes.
|
|
72
|
+
- **Done when:** pipeline green with verifiable artifact metadata.
|
|
64
73
|
|
|
65
|
-
###
|
|
74
|
+
### 5. Deploy Staging — `@devops-engineer`
|
|
66
75
|
```bash
|
|
67
76
|
helm upgrade --install order-service charts/order-service \
|
|
68
|
-
--set image.
|
|
77
|
+
--set image.digest=sha256:${DIGEST} \
|
|
69
78
|
--namespace staging \
|
|
70
|
-
--atomic --timeout
|
|
79
|
+
--atomic --timeout 10m
|
|
71
80
|
```
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
- **Done when:**
|
|
81
|
+
- Run smoke + integration critical path tests.
|
|
82
|
+
- Observe golden signals for at least 15 minutes.
|
|
83
|
+
- **Done when:** staging stable and tests pass.
|
|
75
84
|
|
|
76
|
-
###
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
85
|
+
### 6. Production Gate — `@team-lead` + `@qa`
|
|
86
|
+
- **Actions:**
|
|
87
|
+
- Confirm error budget not exhausted.
|
|
88
|
+
- Confirm rollback command and previous digest ready.
|
|
89
|
+
- Confirm canary SLO thresholds and observation duration are set.
|
|
90
|
+
- **Done when:** manual approval is recorded.
|
|
81
91
|
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
### 7. Canary Deployment — `@devops-engineer`
|
|
93
|
+
- **Sequence:**
|
|
94
|
+
- 5% traffic for 10 min.
|
|
95
|
+
- 25% traffic for 15 min.
|
|
96
|
+
- 50% traffic for 15 min (high-risk releases only).
|
|
97
|
+
- 100% traffic only if all gates pass.
|
|
98
|
+
- **Automatic rollback triggers (example baseline):**
|
|
99
|
+
- 5xx rate > 1% for 5 min,
|
|
100
|
+
- p99 latency regression > 20% for 10 min,
|
|
101
|
+
- fast burn-rate alert firing (>14.4x, 1h window).
|
|
91
102
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- **Done when:** 100% traffic on new version; no SLO breaches
|
|
103
|
+
### 8. Feature Flag Progression — `@developer` + `@qa`
|
|
104
|
+
- Keep high-risk features behind flags during rollout.
|
|
105
|
+
- Enable by cohorts (internal → 5% users → 25% → 100%).
|
|
106
|
+
- Roll back by disabling flag if service health degrades without binary rollback.
|
|
107
|
+
|
|
108
|
+
### 9. Post-Deploy Validation — `@qa` + `@pm`
|
|
109
|
+
- Run production smoke checks.
|
|
110
|
+
- Verify business KPIs (conversion, checkout success, error funnel).
|
|
111
|
+
- Publish deployment report with links to metrics, logs, and release artifact metadata.
|
|
102
112
|
|
|
103
|
-
|
|
104
|
-
- Run production smoke tests
|
|
105
|
-
- Verify key business metrics not degraded
|
|
106
|
-
- Announce release in #deployments channel
|
|
113
|
+
## Rollback
|
|
107
114
|
|
|
108
|
-
### Rollback (if needed at any step)
|
|
109
115
|
```bash
|
|
110
116
|
helm rollback order-service -n production
|
|
111
|
-
# or
|
|
117
|
+
# or redeploy previous verified digest
|
|
112
118
|
```
|
|
113
119
|
|
|
120
|
+
- Rollback is mandatory when any SLO rollback trigger is met.
|
|
121
|
+
- If DB migrations were expanded, execute rollback-safe contract plan only after traffic is stable.
|
|
122
|
+
|
|
114
123
|
## Exit
|
|
115
|
-
|
|
124
|
+
|
|
125
|
+
Release is complete when 100% traffic is healthy, post-deploy checks pass, and release report is published.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pod-troubleshooting
|
|
3
3
|
type: skill
|
|
4
|
-
description: Systematic diagnosis of pod failures — CrashLoopBackOff, OOMKilled, Pending, ImagePullBackOff, and service connectivity issues.
|
|
4
|
+
description: "Systematic diagnosis of Kubernetes pod failures — CrashLoopBackOff, OOMKilled, Pending, ImagePullBackOff, and service connectivity issues. Use when the user encounters pods not starting, container restart loops, scheduling failures, or service unreachability in a K8s cluster."
|
|
5
5
|
related-rules:
|
|
6
6
|
- resource-governance.md
|
|
7
7
|
- workload-security.md
|
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
# Rule: Alerting Standards
|
|
2
2
|
|
|
3
|
-
**Priority**: P1 — Alerts
|
|
3
|
+
**Priority**: P1 — Alerts must be actionable, SLO-aligned, and mapped to ownership.
|
|
4
4
|
|
|
5
5
|
## Alert Quality Rules
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
2. **
|
|
9
|
-
3. **
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
7
|
+
1. **Runbook required** — every alert includes `runbook_url` and service owner.
|
|
8
|
+
2. **Actionability required** — alerts without a defined human or automated action are downgraded to dashboard signals.
|
|
9
|
+
3. **Symptom-first** — page on user impact, not raw infrastructure noise.
|
|
10
|
+
|
|
11
|
+
## Severity Model
|
|
12
|
+
|
|
13
|
+
| Severity | Meaning | Response |
|
|
14
|
+
|:---|:---|:---|
|
|
15
|
+
| `critical` | Active user-impacting incident / fast error-budget burn | Page on-call immediately |
|
|
16
|
+
| `warning` | Degradation trending toward SLO breach | Notify team channel, triage in business hours or sooner |
|
|
17
|
+
| `info` | Context signal only | Dashboard or ticket, no paging |
|
|
18
|
+
|
|
19
|
+
## Multi-Window Burn-Rate Standard
|
|
20
|
+
|
|
21
|
+
4. Define at least:
|
|
22
|
+
- **fast burn** alert (e.g., ~1h window),
|
|
23
|
+
- **slow burn** alert (e.g., ~6h window).
|
|
24
|
+
5. Fast burn pages on-call; slow burn creates prioritized reliability action.
|
|
25
|
+
6. Burn-rate thresholds must map to error-budget policy and release gating.
|
|
26
|
+
|
|
27
|
+
## Anti-Fatigue and Signal Hygiene
|
|
28
|
+
|
|
29
|
+
7. Configure `for:` durations to reduce noise.
|
|
30
|
+
8. If an alert fires repeatedly without action, either improve runbook/automation or retire the alert.
|
|
31
|
+
9. Track alert precision/recall metrics during reliability reviews.
|
|
32
|
+
|
|
33
|
+
## Routing and Escalation
|
|
34
|
+
|
|
35
|
+
10. Route by service ownership and environment (prod vs non-prod).
|
|
36
|
+
11. Define escalation path and timeout for unacknowledged critical alerts.
|
|
37
|
+
12. Support maintenance windows and silence policies with audit logging.
|
|
38
|
+
|
|
39
|
+
## Auto-Remediation
|
|
40
|
+
|
|
41
|
+
13. For known-safe remediations (e.g., restart stateless worker), allow guarded auto-remediation.
|
|
42
|
+
14. Auto-remediation actions must emit events and be reversible.
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
# Rule: Golden Signals & Observability Baseline
|
|
1
|
+
# Rule: Golden Signals & SLO-First Observability Baseline
|
|
2
2
|
|
|
3
|
-
**Priority**: P1 — Services without
|
|
3
|
+
**Priority**: P1 — Services without measurable user-impact SLIs and enforceable SLO alerts cannot be promoted to production.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Required Coverage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. **Golden signals are mandatory**: latency, traffic, errors, saturation.
|
|
8
|
+
2. **User-journey SLIs are mandatory** for critical flows (e.g., checkout success, login success, payment confirmation latency).
|
|
9
|
+
3. **Instrumentation is vendor-neutral**: do not hardcode stack-specific ports/endpoints in policy; enforce metric contract and discoverability.
|
|
10
|
+
|
|
11
|
+
## Signal Baseline
|
|
12
|
+
|
|
13
|
+
| Signal | Minimum metric coverage | Alerting baseline |
|
|
8
14
|
|:---|:---|:---|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
15
|
+
| Latency | p50/p95/p99 by endpoint/operation | p99 SLO burn alert |
|
|
16
|
+
| Traffic | request rate + success volume | anomaly vs rolling baseline |
|
|
17
|
+
| Errors | error rate by class (4xx/5xx/domain) | user-impacting error budget burn |
|
|
18
|
+
| Saturation | CPU, memory, queue/concurrency, DB saturation | sustained saturation with user impact |
|
|
13
19
|
|
|
14
|
-
##
|
|
20
|
+
## SLO and Alerting Requirements
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
5. **Health endpoints** — `/health/ready` (readiness) and `/health/live` (liveness) separate.
|
|
22
|
+
4. Define at least one availability and one latency SLO per critical service.
|
|
23
|
+
5. Use multi-window multi-burn-rate alerting (fast + slow burn).
|
|
24
|
+
6. Link alert severity to error-budget policy actions.
|
|
25
|
+
7. Every alert must include runbook URL and primary owner.
|
|
21
26
|
|
|
22
|
-
##
|
|
27
|
+
## Cardinality and Cost Governance
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
8. Define metric label cardinality budget per service.
|
|
30
|
+
9. For high-cardinality telemetry, apply sampling, aggregation, or drop policy with documented rationale.
|
|
31
|
+
10. Retention tiers must be explicit and mapped to compliance + incident forensics needs.
|
|
32
|
+
|
|
33
|
+
## Trace and Log Correlation
|
|
34
|
+
|
|
35
|
+
11. Propagate trace context across service boundaries.
|
|
36
|
+
12. Ensure logs, metrics, and traces can be correlated via request/trace IDs.
|
|
37
|
+
13. Sensitive data must be redacted before ingestion.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: distributed-tracing
|
|
3
3
|
type: skill
|
|
4
|
-
description: Implement distributed tracing with OpenTelemetry, Tempo/Jaeger — instrumentation, sampling, and trace-to-log correlation.
|
|
4
|
+
description: "Implement distributed tracing with OpenTelemetry, Tempo/Jaeger — instrumentation, sampling, and trace-to-log correlation. Use when the user asks about distributed tracing, OpenTelemetry setup, span instrumentation, trace propagation, or connecting traces to logs and metrics."
|
|
5
5
|
related-rules:
|
|
6
6
|
- golden-signals.md
|
|
7
7
|
- data-retention.md
|
|
@@ -16,6 +16,15 @@ allowed-tools: Read, Write, Edit
|
|
|
16
16
|
|
|
17
17
|
When adding tracing to a service, debugging slow distributed transactions, or setting up trace → log → metric correlation.
|
|
18
18
|
|
|
19
|
+
## End-to-End Setup Workflow
|
|
20
|
+
|
|
21
|
+
1. **Deploy collector** — configure and deploy the OTel Collector as a DaemonSet (see config below)
|
|
22
|
+
2. **Instrument service** — add SDK initialization and auto-instrumentation for your framework (Python/Go examples below)
|
|
23
|
+
3. **Verify traces** — confirm traces appear in Tempo/Jaeger: `curl -s http://tempo:3200/api/search?q={}&limit=5`
|
|
24
|
+
4. **Add log correlation** — inject `trace_id` and `span_id` into log lines for Loki/Grafana linkage
|
|
25
|
+
5. **Validate linkage** — click a trace in Grafana → Explore → verify it links to the corresponding log entries
|
|
26
|
+
6. **Tune sampling** — apply tail-based sampling policies for errors and slow traces (see strategy table)
|
|
27
|
+
|
|
19
28
|
## OpenTelemetry Collector (K8s DaemonSet)
|
|
20
29
|
|
|
21
30
|
```yaml
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
# Rule: Backend Security & OWASP Standards
|
|
2
2
|
|
|
3
|
-
**Priority**: P0 — Security vulnerabilities are release blockers.
|
|
3
|
+
**Priority**: P0 — Security vulnerabilities affecting confidentiality, integrity, or availability are release blockers.
|
|
4
4
|
|
|
5
5
|
## OWASP-aligned baseline
|
|
6
6
|
|
|
7
|
-
1. **Access control**
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
1. **Access control and authorization**
|
|
8
|
+
- Default-deny endpoint access.
|
|
9
|
+
- Enforce RBAC/ABAC and object-level authorization for every resource operation.
|
|
10
|
+
- Test negative authorization paths (forbidden cross-tenant access).
|
|
10
11
|
|
|
11
|
-
2. **
|
|
12
|
-
-
|
|
13
|
-
-
|
|
12
|
+
2. **Authentication and session/token lifecycle**
|
|
13
|
+
- Validate issuer, audience, expiry, and signature for tokens.
|
|
14
|
+
- Use short-lived access tokens and revocable refresh strategy.
|
|
15
|
+
- Detect and alert on anomalous auth patterns.
|
|
14
16
|
|
|
15
|
-
3. **
|
|
16
|
-
-
|
|
17
|
-
-
|
|
17
|
+
3. **Cryptography and secrets**
|
|
18
|
+
- Use modern algorithms (Argon2id/bcrypt for password hashing).
|
|
19
|
+
- Secrets only from dedicated manager (Vault/AWS/GCP/Azure secret stores).
|
|
20
|
+
- Define key/secret rotation and emergency revocation procedures.
|
|
18
21
|
|
|
19
|
-
4. **
|
|
20
|
-
-
|
|
22
|
+
4. **Injection and input safety**
|
|
23
|
+
- Parameterized queries only; no string-concatenated SQL.
|
|
24
|
+
- Strict DTO/schema validation at boundaries.
|
|
25
|
+
- Block mass assignment with explicit writable-field allowlists.
|
|
26
|
+
|
|
27
|
+
5. **Critical web attack defenses**
|
|
28
|
+
- SSRF protections for outbound HTTP integrations.
|
|
29
|
+
- Safe deserialization only; reject untrusted executable payload formats.
|
|
30
|
+
- File upload protection: type validation, scanning, quarantine storage.
|
|
31
|
+
|
|
32
|
+
6. **Service identity and least privilege**
|
|
33
|
+
- Prefer workload identity/mTLS for service-to-service auth.
|
|
34
|
+
- Avoid static credentials in runtime environments.
|
|
35
|
+
- Separate service accounts per environment and per bounded context.
|
|
36
|
+
|
|
37
|
+
7. **Security telemetry and audit**
|
|
38
|
+
- Log auth events, privilege changes, and sensitive config access.
|
|
39
|
+
- Mask/redact sensitive fields in logs and traces.
|
|
40
|
+
- Propagate correlation IDs for incident reconstruction.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: component-design
|
|
3
3
|
type: skill
|
|
4
|
-
description: Design reusable React
|
|
4
|
+
description: "Design reusable React components with compound patterns, controlled/uncontrolled hybrids, typed prop APIs, async state handling, and ARIA accessibility. Use when the user creates, refactors, or reviews React components, or mentions props, hooks, .tsx files, component APIs, or accessible UI patterns."
|
|
5
5
|
related-rules:
|
|
6
6
|
- architecture.md
|
|
7
7
|
- accessibility.md
|
|
@@ -12,6 +12,18 @@ allowed-tools: Read, Write, Edit, Bash
|
|
|
12
12
|
|
|
13
13
|
> **Expertise:** Compound components, controlled/uncontrolled, render props, component API design, accessibility requirements.
|
|
14
14
|
|
|
15
|
+
## When to load
|
|
16
|
+
|
|
17
|
+
When creating, refactoring, or reviewing React components — especially when choosing between compound, controlled/uncontrolled, or headless patterns, designing typed prop APIs, or implementing accessible interactive widgets.
|
|
18
|
+
|
|
19
|
+
## Component Design Workflow
|
|
20
|
+
|
|
21
|
+
1. **Choose pattern** — use the decision tree below to select the right component pattern
|
|
22
|
+
2. **Define typed props** — follow the Props API Design Rules (explicit variants, no boolean explosion)
|
|
23
|
+
3. **Implement all states** — loading, error, empty, success for any async data
|
|
24
|
+
4. **Add accessibility** — use the ARIA requirements table to add correct roles and keyboard support
|
|
25
|
+
5. **Verify** — confirm keyboard navigation works, screen reader announces states, and TypeScript compiles with `--strict`
|
|
26
|
+
|
|
15
27
|
## Pattern Selection Guide
|
|
16
28
|
|
|
17
29
|
```
|
|
@@ -1,22 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
trigger: model_decision
|
|
3
3
|
glob: security-guide
|
|
4
|
-
description: enforce
|
|
4
|
+
description: enforce cloud-native security controls: authZ, secure service identity, secrets lifecycle, and high-risk input protections
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Security Rule
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Priority**: P0 — Security regressions in authentication, authorization, data protection, or high-risk input handling block release.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Validate all external input (API, DB, files).
|
|
13
|
-
- Use Bearer Auth in headers.
|
|
14
|
-
- Apply the least privilege for DB, API, files.
|
|
15
|
-
- Encrypt sensitive data in transit and at rest.
|
|
16
|
-
- Audit and sanitize logs to avoid secrets leakage.
|
|
11
|
+
## Mandatory Controls
|
|
17
12
|
|
|
18
|
-
**
|
|
13
|
+
1. **AuthN/AuthZ baseline**
|
|
14
|
+
- Default-deny authorization at route and resource level.
|
|
15
|
+
- Enforce object-level access checks (prevent IDOR/BOLA).
|
|
16
|
+
- Short-lived tokens with rotation and revocation strategy.
|
|
19
17
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
18
|
+
2. **Service-to-service identity**
|
|
19
|
+
- Use workload identity / mTLS where possible.
|
|
20
|
+
- No long-lived static credentials between services.
|
|
21
|
+
- Scope service permissions to least privilege.
|
|
22
|
+
|
|
23
|
+
3. **Input and output hardening**
|
|
24
|
+
- Validate all external input with strict schema and type constraints.
|
|
25
|
+
- Prevent mass assignment via explicit allowlists of writable fields.
|
|
26
|
+
- Apply output encoding/sanitization where user-generated content is rendered.
|
|
27
|
+
|
|
28
|
+
4. **High-risk attack classes to address explicitly**
|
|
29
|
+
- SSRF protections (deny internal metadata ranges, allowlist outbound domains).
|
|
30
|
+
- Insecure deserialization prevention (safe parsers, signed payloads where needed).
|
|
31
|
+
- Unsafe file upload controls (MIME + extension + antivirus + storage isolation).
|
|
32
|
+
|
|
33
|
+
5. **Secrets lifecycle**
|
|
34
|
+
- Secrets stored only in secret manager/vault.
|
|
35
|
+
- Rotation cadence defined per secret class.
|
|
36
|
+
- Emergency revocation runbook required.
|
|
37
|
+
|
|
38
|
+
6. **Data and transport protection**
|
|
39
|
+
- Encrypt in transit (TLS 1.2+ minimum) and at rest.
|
|
40
|
+
- Avoid logging secrets, tokens, or sensitive PII.
|
|
41
|
+
|
|
42
|
+
7. **Auditability**
|
|
43
|
+
- Security-relevant actions (auth, privilege changes, key operations) must be audit logged.
|
|
44
|
+
- Logs should be tamper-evident and correlated with request/user/service identity.
|
|
45
|
+
|
|
46
|
+
## Release Security Checklist (required)
|
|
47
|
+
|
|
48
|
+
- Threat model updated for new trust boundaries/data flows.
|
|
49
|
+
- AuthZ checks validated by tests on critical endpoints.
|
|
50
|
+
- Secret exposure checks run in CI and deployment logs.
|
|
51
|
+
- Dependency risks triaged with exploitability status.
|
|
52
|
+
|
|
53
|
+
## Violations
|
|
54
|
+
|
|
55
|
+
- Hardcoded secrets or tokens in code/config.
|
|
56
|
+
- Missing object-level authorization.
|
|
57
|
+
- Unvalidated/deserialized untrusted payloads.
|
|
58
|
+
- Service credentials shared across environments without isolation.
|