@jetrabbits/agentic 0.0.3 → 0.0.5
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 +15 -0
- package/Makefile +40 -0
- package/README.md +1 -0
- package/UPGRADE.md +61 -0
- package/agentic +948 -10
- 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/AGENTS.md +1 -4
- package/areas/software/full-stack/rules/security-guide.md +48 -12
- package/areas/software/full-stack/workflows/debug-issue.md +2 -2
- 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/docs/agentic-lifecycle.md +103 -0
- package/docs/agentic-token-minimization/README.md +79 -0
- package/docs/agentic-usage.md +145 -0
- package/docs/catalog.schema.json +203 -0
- package/docs/guidance-updates/2026-04-10-software-devops-best-practices.md +26 -0
- package/docs/opencode_prepare_agents.md +40 -0
- package/docs/opencode_setup.md +45 -0
- package/docs/prompt-format.md +80 -0
- package/docs/site/README.md +44 -0
- package/docs/site/app.js +127 -0
- package/docs/site/catalog.json +5002 -0
- package/docs/site/index.html +52 -0
- package/docs/site/styles.css +177 -0
- package/extensions/codex/agents/developer.toml +1 -1
- package/extensions/codex/agents/devops-engineer.toml +1 -1
- package/extensions/codex/agents/product-owner.toml +1 -1
- package/extensions/codex/agents/team-lead.toml +1 -1
- package/extensions/opencode/plugins/model-checker.json +2 -3
- package/extensions/opencode/plugins/model-checker.ts +23 -0
- package/extensions/opencode/plugins/telegram-notification.ts +33 -5
- package/package.json +6 -2
- package/scripts/assess_area_quality.py +216 -0
- package/scripts/build_docs_catalog.py +283 -0
- package/scripts/lint_prompts.py +113 -0
- package/areas/software/full-stack/skills/bash-pro/SKILL.md +0 -310
- package/areas/software/full-stack/skills/python-pro/SKILL.md +0 -158
- package/areas/software/full-stack/skills/skill-creator/LICENSE.txt +0 -202
- package/areas/software/full-stack/skills/skill-creator/SKILL.md +0 -356
- package/areas/software/full-stack/skills/skill-creator/references/output-patterns.md +0 -82
- package/areas/software/full-stack/skills/skill-creator/references/workflows.md +0 -28
- package/areas/software/full-stack/skills/skill-creator/scripts/init_skill.py +0 -303
- package/areas/software/full-stack/skills/skill-creator/scripts/package_skill.py +0 -110
- package/areas/software/full-stack/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/extensions/codex/skills/babysit-pr/SKILL.md +0 -187
- package/extensions/codex/skills/babysit-pr/agents/openai.yaml +0 -4
- package/extensions/codex/skills/babysit-pr/references/github-api-notes.md +0 -72
- package/extensions/codex/skills/babysit-pr/references/heuristics.md +0 -58
- package/extensions/codex/skills/babysit-pr/scripts/gh_pr_watch.py +0 -806
- package/extensions/codex/skills/babysit-pr/scripts/test_gh_pr_watch.py +0 -155
- package/extensions/opencode/skills/code_review_expert/SKILL.md +0 -144
- package/extensions/opencode/skills/design_expert/SKILL.md +0 -42
- package/extensions/opencode/skills/qa_expert/SKILL.md +0 -116
|
@@ -4,112 +4,102 @@ workflow: release-pipeline
|
|
|
4
4
|
|
|
5
5
|
# Prompt: `/release-pipeline`
|
|
6
6
|
|
|
7
|
-
Use when: designing or
|
|
7
|
+
Use when: designing or executing a production release pipeline with strong supply-chain guarantees, safe database rollout, and progressive delivery controls.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## Example 1 —
|
|
11
|
+
## Example 1 — High-risk release with schema change + feature flags
|
|
12
12
|
|
|
13
13
|
**EN:**
|
|
14
14
|
```
|
|
15
15
|
/release-pipeline
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
Service: payments-api
|
|
18
|
+
Version: v3.8.0
|
|
19
|
+
Risk level: high
|
|
20
|
+
Change type:
|
|
21
|
+
- New payment routing engine behind feature flag `routing_v2`
|
|
22
|
+
- Database migration (expand phase only) adding nullable columns + backfill job
|
|
23
|
+
Requirements:
|
|
24
|
+
1. Build immutable image digest and sign keylessly with cosign
|
|
25
|
+
2. Generate SLSA provenance + CycloneDX SBOM
|
|
26
|
+
3. Verify identity-constrained signature and attestation before deploy
|
|
27
|
+
4. Staging gate: 15 min soak + critical path integration tests
|
|
28
|
+
5. Production canary: 5% (10m) -> 25% (15m) -> 50% (15m) -> 100%
|
|
29
|
+
6. Rollback criteria:
|
|
30
|
+
- 5xx > 1% for 5 min
|
|
31
|
+
- p99 latency > 20% regression for 10 min
|
|
32
|
+
- fast burn-rate alert fires
|
|
33
|
+
7. Feature flag rollout by cohorts after service-level stability
|
|
34
|
+
Output:
|
|
35
|
+
- Full CI/CD workflow YAML
|
|
36
|
+
- Migration safety checklist
|
|
37
|
+
- Rollback runbook
|
|
29
38
|
```
|
|
30
39
|
|
|
31
40
|
**RU:**
|
|
32
41
|
```
|
|
33
42
|
/release-pipeline
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
Сервис: payments-api
|
|
45
|
+
Версия: v3.8.0
|
|
46
|
+
Уровень риска: high
|
|
47
|
+
Тип изменений:
|
|
48
|
+
- Новый роутинг платежей под feature flag `routing_v2`
|
|
49
|
+
- Миграция БД (только expand-фаза): новые nullable-колонки + backfill job
|
|
50
|
+
Требования:
|
|
51
|
+
1. Собрать immutable digest и подписать keyless через cosign
|
|
52
|
+
2. Сгенерировать SLSA provenance + CycloneDX SBOM
|
|
53
|
+
3. Выполнить verify подписи/attestation с identity constraints перед деплоем
|
|
54
|
+
4. Staging gate: 15 минут наблюдения + интеграционные критичные тесты
|
|
55
|
+
5. Canary в production: 5% (10м) -> 25% (15м) -> 50% (15м) -> 100%
|
|
56
|
+
6. Критерии отката:
|
|
57
|
+
- 5xx > 1% в течение 5 минут
|
|
58
|
+
- p99 latency хуже baseline на >20% в течение 10 минут
|
|
59
|
+
- сработал fast burn-rate alert
|
|
60
|
+
7. Раскатка feature flag по когортам после стабилизации сервиса
|
|
61
|
+
Результат:
|
|
62
|
+
- Полный CI/CD workflow YAML
|
|
63
|
+
- Чеклист безопасности миграции
|
|
64
|
+
- Runbook отката
|
|
47
65
|
```
|
|
48
66
|
|
|
49
67
|
---
|
|
50
68
|
|
|
51
|
-
## Example 2 —
|
|
69
|
+
## Example 2 — Compliance-grade supply chain hardening
|
|
52
70
|
|
|
53
71
|
**EN:**
|
|
54
72
|
```
|
|
55
73
|
/release-pipeline
|
|
56
74
|
|
|
57
|
-
Context:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
75
|
+
Context: move existing GitHub Actions pipeline to compliance-grade release controls
|
|
76
|
+
Current state: tests + image build only
|
|
77
|
+
Target:
|
|
78
|
+
- OIDC federation for cloud auth (remove static secrets)
|
|
79
|
+
- Keyless cosign signing of container digest
|
|
80
|
+
- SLSA provenance attestation generation and verification
|
|
81
|
+
- SBOM attach and retention policy >= 1 year
|
|
82
|
+
- Admission policy in production namespace: signed + attested + digest-only images
|
|
83
|
+
Provide:
|
|
84
|
+
- Updated release workflow
|
|
85
|
+
- Example Kyverno/Gatekeeper policies
|
|
86
|
+
- Failure-mode behavior (fail closed)
|
|
65
87
|
```
|
|
66
88
|
|
|
67
89
|
**RU:**
|
|
68
90
|
```
|
|
69
91
|
/release-pipeline
|
|
70
92
|
|
|
71
|
-
Контекст:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## Example 3 — Add full supply chain to existing pipeline
|
|
84
|
-
|
|
85
|
-
**EN:**
|
|
86
|
-
```
|
|
87
|
-
/release-pipeline
|
|
88
|
-
|
|
89
|
-
Service: checkout-service / CI: GitHub Actions
|
|
90
|
-
Current state: images built and pushed, no signing, no SBOM
|
|
91
|
-
Required:
|
|
92
|
-
1. SBOM: generate CycloneDX SBOM with Syft during build; attach to image with cosign
|
|
93
|
-
2. Signing: sign image with cosign using GitHub OIDC (keyless) after push
|
|
94
|
-
3. Provenance: enable SLSA level 2 via docker/build-push-action (provenance: true)
|
|
95
|
-
4. Verification: add cosign verify step in CD pipeline before every deploy
|
|
96
|
-
5. Policy: Kyverno ClusterPolicy — block unsigned images in production namespace
|
|
97
|
-
6. Dependency pinning: base image must reference @sha256 digest, not tag
|
|
98
|
-
Show full updated GitHub Actions workflow + Kyverno policy
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**RU:**
|
|
102
|
-
```
|
|
103
|
-
/release-pipeline
|
|
104
|
-
|
|
105
|
-
Сервис: checkout-service / CI: GitHub Actions
|
|
106
|
-
Текущее состояние: образы собираются и пушатся, без подписи, без SBOM
|
|
107
|
-
Требуется:
|
|
108
|
-
1. SBOM: генерация CycloneDX SBOM через Syft при сборке; прикрепление к образу через cosign
|
|
109
|
-
2. Подпись: подпись образа через cosign с GitHub OIDC (keyless) после push
|
|
110
|
-
3. Provenance: SLSA level 2 через docker/build-push-action (provenance: true)
|
|
111
|
-
4. Верификация: добавить шаг cosign verify в CD pipeline перед каждым деплоем
|
|
112
|
-
5. Политика: Kyverno ClusterPolicy — блокировка неподписанных образов в production namespace
|
|
113
|
-
6. Pinning зависимостей: base image должен ссылаться на @sha256 digest, не тег
|
|
114
|
-
Показать полный обновлённый workflow GitHub Actions + Kyverno политику
|
|
93
|
+
Контекст: перевести существующий GitHub Actions pipeline на compliance-grade контроль релизов
|
|
94
|
+
Текущее состояние: только тесты + сборка образа
|
|
95
|
+
Цель:
|
|
96
|
+
- OIDC federation для cloud auth (убрать static secrets)
|
|
97
|
+
- Keyless cosign-подпись digest контейнера
|
|
98
|
+
- Генерация и проверка SLSA provenance attestation
|
|
99
|
+
- Прикрепление SBOM и политика хранения >= 1 года
|
|
100
|
+
- Admission policy в production: только signed + attested + digest-only образы
|
|
101
|
+
Нужно выдать:
|
|
102
|
+
- Обновлённый workflow релиза
|
|
103
|
+
- Примеры политик Kyverno/Gatekeeper
|
|
104
|
+
- Поведение при сбоях (fail closed)
|
|
115
105
|
```
|
|
@@ -1,34 +1,54 @@
|
|
|
1
1
|
# Rule: Supply Chain Security
|
|
2
2
|
|
|
3
|
-
**Priority**: P0 —
|
|
3
|
+
**Priority**: P0 — Artifacts without verified identity, provenance, and policy compliance are blocked from production.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Baseline (mandatory)
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
7
|
+
1. **Keyless signing by default**: use Sigstore keyless (`cosign` + OIDC/Fulcio/Rekor) for CI-produced artifacts.
|
|
8
|
+
2. **Immutable references only**: deploy by digest (`@sha256:...`), never mutable tags (`latest`, `stable`).
|
|
9
|
+
3. **Provenance required**: generate SLSA-compatible provenance attestations for every production build.
|
|
10
|
+
4. **SBOM required**: generate CycloneDX or SPDX SBOM and attach/store with the exact artifact digest.
|
|
11
|
+
5. **Admission policy enforcement**: clusters must verify signature + provenance + digest pinning before workload admission.
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## Signing and Verification
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
#
|
|
15
|
-
cosign sign --
|
|
16
|
-
registry.example.com/my-service@sha256:<digest>
|
|
16
|
+
# Keyless signing (preferred)
|
|
17
|
+
cosign sign --yes registry.example.com/my-service@sha256:<digest>
|
|
17
18
|
|
|
18
|
-
#
|
|
19
|
-
cosign verify
|
|
19
|
+
# Verification with issuer/identity constraints (required in CD)
|
|
20
|
+
cosign verify \
|
|
21
|
+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
22
|
+
--certificate-identity-regexp 'https://github.com/myorg/myrepo/\.github/workflows/.+@refs/tags/v.+' \
|
|
20
23
|
registry.example.com/my-service@sha256:<digest>
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
6. **Key-pair signing is fallback only**: if keyless is unavailable, keys must be in KMS/HSM and rotated at least quarterly.
|
|
27
|
+
7. **Transparency log evidence**: verification must include Rekor entry checks when supported.
|
|
28
|
+
|
|
29
|
+
## Provenance and Build Integrity
|
|
30
|
+
|
|
31
|
+
8. Production builds run only on trusted CI and produce attestations bound to exact commit SHA.
|
|
32
|
+
9. Build provenance must include: repository, workflow identity, source revision, build parameters, and builder identity.
|
|
33
|
+
10. Reproducibility target: deterministic builds for critical services; if not feasible, document non-deterministic inputs.
|
|
34
|
+
|
|
35
|
+
## Dependency and Base Image Controls
|
|
36
|
+
|
|
37
|
+
11. Pin direct dependencies and commit lockfiles (`package-lock.json`, `poetry.lock`, `go.sum`, etc.).
|
|
38
|
+
12. Base images pinned by digest in Dockerfile; floating tags are forbidden.
|
|
39
|
+
13. Package managers must verify checksums/hashes where available.
|
|
40
|
+
14. External CI actions/plugins must be pinned to immutable commit SHA.
|
|
24
41
|
|
|
25
|
-
##
|
|
42
|
+
## Policy Enforcement (Kubernetes / CD)
|
|
26
43
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
44
|
+
15. Admission controllers (Kyverno/Gatekeeper) must enforce:
|
|
45
|
+
- signed image verification;
|
|
46
|
+
- digest-only image references;
|
|
47
|
+
- required provenance attestation for production namespaces.
|
|
48
|
+
16. Deploy pipeline fails closed if verification services are unavailable (no silent bypass).
|
|
49
|
+
17. Exceptions require documented risk acceptance with owner + expiry date (max 14 days).
|
|
30
50
|
|
|
31
|
-
## Audit Trail
|
|
51
|
+
## Audit Trail and Retention
|
|
32
52
|
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
18. Keep artifact metadata for at least 1 year: commit SHA, SBOM digest, provenance digest, signer identity, scan results.
|
|
54
|
+
19. Every release record must be traceable from ticket/PR → commit → artifact digest → deployment event.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: github-actions-patterns
|
|
3
3
|
type: skill
|
|
4
|
-
description: Production-grade GitHub Actions workflows — reusable workflows, OIDC auth, caching, matrix builds, environment protection.
|
|
4
|
+
description: "Production-grade GitHub Actions workflows — reusable workflows, OIDC cloud auth, caching, matrix builds, and environment protection rules. Use when the user creates, reviews, or debugs CI/CD pipelines in .github/workflows, or asks about GitHub Actions deployment, OIDC authentication, or workflow optimization."
|
|
5
5
|
related-rules:
|
|
6
6
|
- pipeline-standards.md
|
|
7
7
|
- quality-gates.md
|
|
@@ -152,6 +152,11 @@ jobs:
|
|
|
152
152
|
--set image.digest=${{ inputs.image-digest }} \
|
|
153
153
|
--namespace ${{ inputs.environment }} \
|
|
154
154
|
--atomic --timeout 5m
|
|
155
|
+
|
|
156
|
+
- name: Verify deployment health
|
|
157
|
+
run: |
|
|
158
|
+
kubectl rollout status deployment/my-service -n ${{ inputs.environment }} --timeout=120s
|
|
159
|
+
curl -sf http://my-service.${{ inputs.environment }}.svc.cluster.local/health || exit 1
|
|
155
160
|
```
|
|
156
161
|
|
|
157
162
|
## OIDC Cloud Authentication (no long-lived keys)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pipeline-security
|
|
3
3
|
type: skill
|
|
4
|
-
description: Secure CI/CD pipelines
|
|
4
|
+
description: Secure CI/CD pipelines with keyless signing, OIDC federation, provenance attestations, policy enforcement, and hardened runners.
|
|
5
5
|
related-rules:
|
|
6
6
|
- supply-chain-security.md
|
|
7
7
|
- pipeline-standards.md
|
|
@@ -10,152 +10,87 @@ allowed-tools: Read, Write, Edit
|
|
|
10
10
|
|
|
11
11
|
# Skill: Pipeline Security
|
|
12
12
|
|
|
13
|
-
> **Expertise:** OIDC cloud auth,
|
|
13
|
+
> **Expertise:** OIDC cloud auth, least-privilege workflow permissions, secret scanning, keyless artifact signing, SLSA provenance, and admission policy checks.
|
|
14
14
|
|
|
15
15
|
## When to load
|
|
16
16
|
|
|
17
|
-
When
|
|
17
|
+
When designing or hardening CI/CD pipelines for production deployments, especially where compliance or high-risk workloads are involved.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Security Outcomes (definition of done)
|
|
20
|
+
|
|
21
|
+
- Pipeline uses **OIDC federation** (no long-lived cloud keys in CI secrets).
|
|
22
|
+
- Artifacts are **signed keylessly** and verified with identity constraints.
|
|
23
|
+
- **Provenance + SBOM** are generated and validated before deploy.
|
|
24
|
+
- Workflows use **minimal GitHub/GitLab permissions**.
|
|
25
|
+
- Runtime admission policies block unsigned/unattested artifacts.
|
|
26
|
+
|
|
27
|
+
## OIDC Authentication (no long-lived credentials)
|
|
20
28
|
|
|
21
29
|
```yaml
|
|
22
|
-
# GitHub Actions → AWS (no AWS_ACCESS_KEY_ID needed)
|
|
23
30
|
jobs:
|
|
24
31
|
deploy:
|
|
25
32
|
permissions:
|
|
26
|
-
id-token: write
|
|
33
|
+
id-token: write
|
|
27
34
|
contents: read
|
|
28
35
|
steps:
|
|
29
|
-
- uses: aws-actions/configure-aws-credentials
|
|
36
|
+
- uses: aws-actions/configure-aws-credentials@<pinned-sha>
|
|
30
37
|
with:
|
|
31
38
|
role-to-assume: arn:aws:iam::123456789012:role/github-actions-deploy
|
|
32
|
-
aws-region:
|
|
33
|
-
role-session-name: github-${{ github.run_id }}
|
|
34
|
-
|
|
35
|
-
# AWS IAM trust policy (configure once)
|
|
36
|
-
# {
|
|
37
|
-
# "Principal": {"Federated": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com"},
|
|
38
|
-
# "Condition": {
|
|
39
|
-
# "StringEquals": {"token.actions.githubusercontent.com:sub": "repo:myorg/myrepo:ref:refs/heads/main"}
|
|
40
|
-
# }
|
|
41
|
-
# }
|
|
39
|
+
aws-region: us-east-1
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- uses: google-github-actions/auth@v2
|
|
47
|
-
with:
|
|
48
|
-
workload_identity_provider: projects/123456789/locations/global/workloadIdentityPools/github/providers/github
|
|
49
|
-
service_account: github-actions@my-project.iam.gserviceaccount.com
|
|
50
|
-
|
|
51
|
-
# GitHub Actions → K8s (via kubeconfig secret — use when OIDC not available)
|
|
52
|
-
- name: Set up kubeconfig
|
|
53
|
-
run: |
|
|
54
|
-
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > /tmp/kubeconfig
|
|
55
|
-
chmod 600 /tmp/kubeconfig
|
|
56
|
-
env:
|
|
57
|
-
KUBECONFIG: /tmp/kubeconfig
|
|
58
|
-
```
|
|
42
|
+
- Constrain trust policy by repo, ref, and workflow identity.
|
|
43
|
+
- Prefer short session duration and environment-scoped roles.
|
|
59
44
|
|
|
60
|
-
## Minimal Permissions
|
|
45
|
+
## Minimal Permissions Model
|
|
61
46
|
|
|
62
47
|
```yaml
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
contents: read # checkout only
|
|
68
|
-
packages: write # push to ghcr.io
|
|
69
|
-
id-token: write # OIDC for cloud/registry auth
|
|
70
|
-
security-events: write # upload SARIF to Security tab
|
|
71
|
-
|
|
72
|
-
deploy:
|
|
73
|
-
permissions:
|
|
74
|
-
contents: read
|
|
75
|
-
id-token: write # OIDC for cloud auth
|
|
76
|
-
# NOT: actions:write, administration:write, etc.
|
|
48
|
+
permissions:
|
|
49
|
+
contents: read
|
|
50
|
+
id-token: write
|
|
51
|
+
packages: write
|
|
77
52
|
```
|
|
78
53
|
|
|
79
|
-
|
|
54
|
+
- Deny by default; explicitly request only required scopes.
|
|
55
|
+
- Split build and deploy into separate jobs with separate permissions.
|
|
80
56
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- name: Scan for secrets (gitleaks)
|
|
93
|
-
uses: gitleaks/gitleaks-action@v2
|
|
94
|
-
env:
|
|
95
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
57
|
+
## Keyless Signing + Verification
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Sign immutable artifact digest
|
|
61
|
+
cosign sign --yes registry.example.com/team/service@sha256:<digest>
|
|
62
|
+
|
|
63
|
+
# Verify identity and issuer in deploy gate
|
|
64
|
+
cosign verify \
|
|
65
|
+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
66
|
+
--certificate-identity-regexp 'https://github.com/myorg/myrepo/\.github/workflows/.+@refs/tags/v.+' \
|
|
67
|
+
registry.example.com/team/service@sha256:<digest>
|
|
96
68
|
```
|
|
97
69
|
|
|
98
|
-
##
|
|
70
|
+
## Provenance + SBOM Requirements
|
|
99
71
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
with:
|
|
105
|
-
fail-on-severity: high # block on High and Critical
|
|
106
|
-
allow-licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC
|
|
107
|
-
deny-licenses: GPL-3.0, AGPL-3.0 # copyleft licenses blocked
|
|
108
|
-
```
|
|
72
|
+
- Generate SLSA provenance attestation for each release artifact.
|
|
73
|
+
- Generate CycloneDX/SPDX SBOM for exact artifact digest.
|
|
74
|
+
- Store attestation/SBOM references in release metadata.
|
|
75
|
+
- Block deploy if attestation/SBOM is missing or invalid.
|
|
109
76
|
|
|
110
|
-
##
|
|
77
|
+
## Secret and Dependency Controls
|
|
111
78
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2
|
|
116
|
-
with:
|
|
117
|
-
image: registry.example.com/myorg/order-service
|
|
118
|
-
digest: ${{ steps.build.outputs.digest }}
|
|
119
|
-
registry-username: ${{ github.actor }}
|
|
120
|
-
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
|
121
|
-
```
|
|
79
|
+
- Run secret scanning (trufflehog/gitleaks) on PR and main.
|
|
80
|
+
- Run dependency review with severity threshold and license policy.
|
|
81
|
+
- Fail pipeline on critical policy violations; do not “warn-only” for production paths.
|
|
122
82
|
|
|
123
83
|
## Runner Hardening
|
|
124
84
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
# ❌ Unsafe (tag can be moved by attacker)
|
|
130
|
-
- uses: actions/checkout@v4
|
|
131
|
-
|
|
132
|
-
# Restrict third-party actions to verified/trusted
|
|
133
|
-
# In GitHub org settings: only allow selected actions + GitHub Actions
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Self-hosted runner hardening
|
|
138
|
-
# - Run as non-root dedicated user (no sudo)
|
|
139
|
-
# - Ephemeral runners (fresh VM per job) — preferred
|
|
140
|
-
# - Network: egress to required registries only; no inbound
|
|
141
|
-
# - No persistent credentials on runner filesystem
|
|
142
|
-
# - Use actions/runner-container-hooks for K8s ephemeral runners
|
|
143
|
-
```
|
|
85
|
+
- Ephemeral runners preferred (one job per VM/pod).
|
|
86
|
+
- No privileged mode unless explicitly justified.
|
|
87
|
+
- Restrict network egress to required registries/APIs.
|
|
88
|
+
- Never persist cloud credentials or kubeconfig on runner disk.
|
|
144
89
|
|
|
145
|
-
##
|
|
90
|
+
## Policy-as-Code Integration
|
|
146
91
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
# Prevent secret leakage in logs
|
|
153
|
-
- name: No secret echo
|
|
154
|
-
run: |
|
|
155
|
-
# ❌ BAD: leaks secret to logs
|
|
156
|
-
echo "DB_PASS=$DB_PASS"
|
|
157
|
-
env # dumps all env vars including secrets
|
|
158
|
-
|
|
159
|
-
# ✅ Use secret only where needed; never echo
|
|
160
|
-
helm upgrade ... --set db.password="$DB_PASS" > /dev/null
|
|
161
|
-
```
|
|
92
|
+
- Enforce cluster admission checks for:
|
|
93
|
+
- signed image;
|
|
94
|
+
- digest-only reference;
|
|
95
|
+
- valid provenance for production namespaces.
|
|
96
|
+
- Keep exception path explicit: owner + expiry + compensating controls.
|