@kaademos/secure-sdlc 1.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/.claude/agents/ai-security-engineer.md +209 -0
- package/.claude/agents/appsec-engineer.md +131 -0
- package/.claude/agents/cloud-platform-engineer.md +119 -0
- package/.claude/agents/dev-lead.md +138 -0
- package/.claude/agents/grc-analyst.md +143 -0
- package/.claude/agents/product-manager.md +100 -0
- package/.claude/agents/release-manager.md +126 -0
- package/.claude/agents/security-champion.md +148 -0
- package/.cursor/rules/secure-sdlc.mdc +98 -0
- package/.github/workflows/secure-sdlc-gate.yml +325 -0
- package/CHANGELOG.md +49 -0
- package/CLAUDE.md +195 -0
- package/LICENSE +21 -0
- package/README.md +394 -0
- package/cli/bin/secure-sdlc.js +95 -0
- package/cli/src/commands/gate.js +129 -0
- package/cli/src/commands/init.js +219 -0
- package/cli/src/commands/install-mcp.js +121 -0
- package/cli/src/commands/kickoff.js +261 -0
- package/cli/src/commands/paths.js +33 -0
- package/cli/src/commands/review.js +53 -0
- package/cli/src/commands/status.js +122 -0
- package/cli/src/utils/banner.js +43 -0
- package/cli/src/utils/package-root.js +23 -0
- package/cli/src/utils/phase-detect.js +107 -0
- package/cli/src/utils/stack-detect.js +138 -0
- package/docs/templates/compliance-attestation.md +159 -0
- package/docs/templates/infra-security-review.md +133 -0
- package/docs/templates/release-sign-off.md +119 -0
- package/docs/templates/risk-register.md +72 -0
- package/docs/templates/sast-findings.md +110 -0
- package/docs/templates/security-requirements.md +98 -0
- package/docs/templates/test-security-report.md +143 -0
- package/docs/templates/threat-model.md +129 -0
- package/hooks/install.sh +37 -0
- package/hooks/pre-commit +208 -0
- package/hooks/pre-push +127 -0
- package/mcp/README.md +116 -0
- package/mcp/package.json +23 -0
- package/mcp/src/server.js +638 -0
- package/package.json +67 -0
- package/stacks/django.md +216 -0
- package/stacks/express.md +229 -0
- package/stacks/fastapi.md +247 -0
- package/stacks/nextjs.md +198 -0
- package/stacks/nodejs.md +28 -0
- package/stacks/rails.md +247 -0
- package/warp-workflows/README.md +25 -0
- package/warp-workflows/feature-kickoff.yaml +49 -0
- package/warp-workflows/pr-security-review.yaml +47 -0
- package/warp-workflows/release-gate.yaml +44 -0
- package/warp-workflows/sdlc-status.yaml +48 -0
- package/warp-workflows/threat-model.yaml +56 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
name: Secure SDLC Gate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main, master, develop, staging]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
release_version:
|
|
11
|
+
description: 'Release version for full gate (e.g. v1.2.0)'
|
|
12
|
+
required: false
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
pull-requests: write
|
|
18
|
+
security-events: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
# ────────────────────────────────────────────────────────────────
|
|
22
|
+
# SDLC Artefact Gate
|
|
23
|
+
# Checks that required security documents exist and are not
|
|
24
|
+
# blank templates before allowing merges to protected branches.
|
|
25
|
+
# ────────────────────────────────────────────────────────────────
|
|
26
|
+
artefact-gate:
|
|
27
|
+
name: SDLC Artefact Gate
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
|
|
35
|
+
- name: Check required security artefacts
|
|
36
|
+
id: artefact-check
|
|
37
|
+
run: |
|
|
38
|
+
set +e
|
|
39
|
+
BLOCKERS=()
|
|
40
|
+
WARNINGS=()
|
|
41
|
+
|
|
42
|
+
check_artefact() {
|
|
43
|
+
local file="$1"
|
|
44
|
+
local label="$2"
|
|
45
|
+
local required="$3"
|
|
46
|
+
|
|
47
|
+
if [ ! -f "$file" ]; then
|
|
48
|
+
if [ "$required" = "true" ]; then
|
|
49
|
+
BLOCKERS+=("MISSING: $file ($label)")
|
|
50
|
+
echo "::error file=$file::Required security artefact missing: $file"
|
|
51
|
+
else
|
|
52
|
+
WARNINGS+=("MISSING (optional): $file")
|
|
53
|
+
fi
|
|
54
|
+
return 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Check if it's an unfilled template
|
|
58
|
+
if grep -q "\[Feature Name\]\|\[YYYY-MM-DD\]\|\[Brief description" "$file" 2>/dev/null; then
|
|
59
|
+
local wc=$(wc -l < "$file")
|
|
60
|
+
# Short files with placeholder text are unfilled templates
|
|
61
|
+
if [ "$wc" -lt 200 ]; then
|
|
62
|
+
if [ "$required" = "true" ]; then
|
|
63
|
+
BLOCKERS+=("TEMPLATE UNFILLED: $file - appears to be the blank template, not a completed document")
|
|
64
|
+
echo "::error file=$file::Security artefact appears to be an unfilled template: $file"
|
|
65
|
+
fi
|
|
66
|
+
return 1
|
|
67
|
+
fi
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "✓ $file"
|
|
71
|
+
return 0
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# PLAN phase artefacts — required for all PRs to main/master
|
|
75
|
+
TARGET="${{ github.base_ref }}"
|
|
76
|
+
|
|
77
|
+
if [[ "$TARGET" == "main" || "$TARGET" == "master" ]]; then
|
|
78
|
+
check_artefact "docs/security-requirements.md" "product-manager / PLAN" "true"
|
|
79
|
+
check_artefact "docs/risk-register.md" "grc-analyst / PLAN" "true"
|
|
80
|
+
check_artefact "docs/threat-model.md" "appsec-engineer / DESIGN" "true"
|
|
81
|
+
check_artefact "docs/sast-findings.md" "appsec-engineer / BUILD" "true"
|
|
82
|
+
else
|
|
83
|
+
# For non-main branches, warn if artefacts are missing
|
|
84
|
+
check_artefact "docs/security-requirements.md" "product-manager / PLAN" "false"
|
|
85
|
+
check_artefact "docs/risk-register.md" "grc-analyst / PLAN" "false"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Always optional
|
|
89
|
+
check_artefact "docs/infra-security-review.md" "cloud-platform-engineer / DESIGN" "false"
|
|
90
|
+
|
|
91
|
+
# Report
|
|
92
|
+
if [ ${#BLOCKERS[@]} -gt 0 ]; then
|
|
93
|
+
echo ""
|
|
94
|
+
echo "::group::Gate Blockers"
|
|
95
|
+
for b in "${BLOCKERS[@]}"; do
|
|
96
|
+
echo " ✗ $b"
|
|
97
|
+
done
|
|
98
|
+
echo "::endgroup::"
|
|
99
|
+
echo "GATE_RESULT=FAIL" >> $GITHUB_OUTPUT
|
|
100
|
+
echo "BLOCKERS=${BLOCKERS[*]}" >> $GITHUB_OUTPUT
|
|
101
|
+
exit 1
|
|
102
|
+
else
|
|
103
|
+
echo "GATE_RESULT=PASS" >> $GITHUB_OUTPUT
|
|
104
|
+
echo "All required artefacts present."
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
# ────────────────────────────────────────────────────────────────
|
|
108
|
+
# Secret Scanning
|
|
109
|
+
# Detect accidentally committed secrets before they hit the repo.
|
|
110
|
+
# ────────────────────────────────────────────────────────────────
|
|
111
|
+
secret-scan:
|
|
112
|
+
name: Secret Scan
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
steps:
|
|
115
|
+
- name: Checkout
|
|
116
|
+
uses: actions/checkout@v4
|
|
117
|
+
with:
|
|
118
|
+
fetch-depth: 0
|
|
119
|
+
|
|
120
|
+
- name: Scan for secrets with Gitleaks
|
|
121
|
+
uses: gitleaks/gitleaks-action@v2
|
|
122
|
+
env:
|
|
123
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
124
|
+
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
|
|
125
|
+
continue-on-error: false
|
|
126
|
+
|
|
127
|
+
# ────────────────────────────────────────────────────────────────
|
|
128
|
+
# Dependency Security (SCA)
|
|
129
|
+
# Check for known CVEs in direct dependencies.
|
|
130
|
+
# ────────────────────────────────────────────────────────────────
|
|
131
|
+
dependency-scan:
|
|
132
|
+
name: Dependency Security Scan
|
|
133
|
+
runs-on: ubuntu-latest
|
|
134
|
+
steps:
|
|
135
|
+
- name: Checkout
|
|
136
|
+
uses: actions/checkout@v4
|
|
137
|
+
|
|
138
|
+
- name: Detect Node.js project
|
|
139
|
+
id: detect-node
|
|
140
|
+
run: |
|
|
141
|
+
if [ -f "package.json" ]; then
|
|
142
|
+
echo "IS_NODE=true" >> $GITHUB_OUTPUT
|
|
143
|
+
else
|
|
144
|
+
echo "IS_NODE=false" >> $GITHUB_OUTPUT
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
- name: Detect Python project
|
|
148
|
+
id: detect-python
|
|
149
|
+
run: |
|
|
150
|
+
if [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] || [ -f "Pipfile" ]; then
|
|
151
|
+
echo "IS_PYTHON=true" >> $GITHUB_OUTPUT
|
|
152
|
+
else
|
|
153
|
+
echo "IS_PYTHON=false" >> $GITHUB_OUTPUT
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
- name: Setup Node.js
|
|
157
|
+
if: steps.detect-node.outputs.IS_NODE == 'true'
|
|
158
|
+
uses: actions/setup-node@v4
|
|
159
|
+
with:
|
|
160
|
+
node-version: '20'
|
|
161
|
+
|
|
162
|
+
- name: npm audit (Node.js)
|
|
163
|
+
if: steps.detect-node.outputs.IS_NODE == 'true'
|
|
164
|
+
run: |
|
|
165
|
+
npm audit --audit-level=high --json > npm-audit.json || true
|
|
166
|
+
# Fail on CRITICAL vulnerabilities in direct dependencies
|
|
167
|
+
CRITICALS=$(cat npm-audit.json | python3 -c "
|
|
168
|
+
import json, sys
|
|
169
|
+
data = json.load(sys.stdin)
|
|
170
|
+
vulns = data.get('vulnerabilities', {})
|
|
171
|
+
criticals = [k for k, v in vulns.items() if v.get('severity') == 'critical' and v.get('isDirect', False)]
|
|
172
|
+
print(len(criticals))
|
|
173
|
+
" 2>/dev/null || echo "0")
|
|
174
|
+
|
|
175
|
+
if [ "$CRITICALS" -gt 0 ]; then
|
|
176
|
+
echo "::error::$CRITICALS CRITICAL CVE(s) in direct dependencies. Run: npm audit fix"
|
|
177
|
+
exit 1
|
|
178
|
+
fi
|
|
179
|
+
echo "Dependency scan: no critical CVEs in direct dependencies"
|
|
180
|
+
|
|
181
|
+
- name: Setup Python
|
|
182
|
+
if: steps.detect-python.outputs.IS_PYTHON == 'true'
|
|
183
|
+
uses: actions/setup-python@v5
|
|
184
|
+
with:
|
|
185
|
+
python-version: '3.12'
|
|
186
|
+
|
|
187
|
+
- name: pip-audit (Python)
|
|
188
|
+
if: steps.detect-python.outputs.IS_PYTHON == 'true'
|
|
189
|
+
run: |
|
|
190
|
+
pip install pip-audit --quiet
|
|
191
|
+
pip-audit --format=json --output=pip-audit.json 2>/dev/null || pip-audit || true
|
|
192
|
+
echo "Python dependency scan complete"
|
|
193
|
+
|
|
194
|
+
# ────────────────────────────────────────────────────────────────
|
|
195
|
+
# IaC Security Scan
|
|
196
|
+
# Scan Terraform, Kubernetes, Helm, and Docker for misconfigurations.
|
|
197
|
+
# ────────────────────────────────────────────────────────────────
|
|
198
|
+
iac-scan:
|
|
199
|
+
name: IaC Security Scan
|
|
200
|
+
runs-on: ubuntu-latest
|
|
201
|
+
steps:
|
|
202
|
+
- name: Checkout
|
|
203
|
+
uses: actions/checkout@v4
|
|
204
|
+
|
|
205
|
+
- name: Check for IaC files
|
|
206
|
+
id: detect-iac
|
|
207
|
+
run: |
|
|
208
|
+
if find . -name "*.tf" -o -name "*.tfvars" | grep -q .; then
|
|
209
|
+
echo "HAS_TERRAFORM=true" >> $GITHUB_OUTPUT
|
|
210
|
+
fi
|
|
211
|
+
if find . -name "*.yaml" -o -name "*.yml" | xargs grep -l "kind: Deployment\|kind: Service\|kind: ConfigMap" 2>/dev/null | grep -q .; then
|
|
212
|
+
echo "HAS_K8S=true" >> $GITHUB_OUTPUT
|
|
213
|
+
fi
|
|
214
|
+
if find . -name "Dockerfile" | grep -q .; then
|
|
215
|
+
echo "HAS_DOCKER=true" >> $GITHUB_OUTPUT
|
|
216
|
+
fi
|
|
217
|
+
|
|
218
|
+
- name: Checkov (Terraform + K8s + Docker)
|
|
219
|
+
if: steps.detect-iac.outputs.HAS_TERRAFORM == 'true' || steps.detect-iac.outputs.HAS_K8S == 'true' || steps.detect-iac.outputs.HAS_DOCKER == 'true'
|
|
220
|
+
uses: bridgecrewio/checkov-action@v12
|
|
221
|
+
with:
|
|
222
|
+
soft_fail: true
|
|
223
|
+
output_format: sarif
|
|
224
|
+
output_file_path: checkov.sarif
|
|
225
|
+
continue-on-error: true
|
|
226
|
+
|
|
227
|
+
- name: Upload Checkov SARIF
|
|
228
|
+
if: always() && (steps.detect-iac.outputs.HAS_TERRAFORM == 'true' || steps.detect-iac.outputs.HAS_K8S == 'true')
|
|
229
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
230
|
+
with:
|
|
231
|
+
sarif_file: checkov.sarif
|
|
232
|
+
continue-on-error: true
|
|
233
|
+
|
|
234
|
+
# ────────────────────────────────────────────────────────────────
|
|
235
|
+
# SAST (CodeQL)
|
|
236
|
+
# Static analysis for common vulnerability classes.
|
|
237
|
+
# ────────────────────────────────────────────────────────────────
|
|
238
|
+
sast:
|
|
239
|
+
name: SAST (CodeQL)
|
|
240
|
+
runs-on: ubuntu-latest
|
|
241
|
+
strategy:
|
|
242
|
+
fail-fast: false
|
|
243
|
+
matrix:
|
|
244
|
+
language: ['javascript-typescript', 'python']
|
|
245
|
+
steps:
|
|
246
|
+
- name: Checkout
|
|
247
|
+
uses: actions/checkout@v4
|
|
248
|
+
|
|
249
|
+
- name: Check language files exist
|
|
250
|
+
id: check-lang
|
|
251
|
+
run: |
|
|
252
|
+
LANG="${{ matrix.language }}"
|
|
253
|
+
if [ "$LANG" = "javascript-typescript" ]; then
|
|
254
|
+
find . -name "*.js" -o -name "*.ts" | grep -v node_modules | grep -q . && echo "EXISTS=true" >> $GITHUB_OUTPUT || echo "EXISTS=false" >> $GITHUB_OUTPUT
|
|
255
|
+
elif [ "$LANG" = "python" ]; then
|
|
256
|
+
find . -name "*.py" | grep -q . && echo "EXISTS=true" >> $GITHUB_OUTPUT || echo "EXISTS=false" >> $GITHUB_OUTPUT
|
|
257
|
+
else
|
|
258
|
+
echo "EXISTS=true" >> $GITHUB_OUTPUT
|
|
259
|
+
fi
|
|
260
|
+
|
|
261
|
+
- name: Initialize CodeQL
|
|
262
|
+
if: steps.check-lang.outputs.EXISTS == 'true'
|
|
263
|
+
uses: github/codeql-action/init@v3
|
|
264
|
+
with:
|
|
265
|
+
languages: ${{ matrix.language }}
|
|
266
|
+
queries: security-and-quality
|
|
267
|
+
|
|
268
|
+
- name: Autobuild
|
|
269
|
+
if: steps.check-lang.outputs.EXISTS == 'true'
|
|
270
|
+
uses: github/codeql-action/autobuild@v3
|
|
271
|
+
|
|
272
|
+
- name: Perform CodeQL Analysis
|
|
273
|
+
if: steps.check-lang.outputs.EXISTS == 'true'
|
|
274
|
+
uses: github/codeql-action/analyze@v3
|
|
275
|
+
with:
|
|
276
|
+
category: "/language:${{matrix.language}}"
|
|
277
|
+
|
|
278
|
+
# ────────────────────────────────────────────────────────────────
|
|
279
|
+
# Release Gate (on workflow_dispatch with version)
|
|
280
|
+
# Full pre-release security checklist.
|
|
281
|
+
# ────────────────────────────────────────────────────────────────
|
|
282
|
+
release-gate:
|
|
283
|
+
name: Release Security Gate
|
|
284
|
+
runs-on: ubuntu-latest
|
|
285
|
+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != ''
|
|
286
|
+
needs: [artefact-gate, secret-scan, dependency-scan, iac-scan, sast]
|
|
287
|
+
steps:
|
|
288
|
+
- name: Checkout
|
|
289
|
+
uses: actions/checkout@v4
|
|
290
|
+
|
|
291
|
+
- name: Setup Node.js
|
|
292
|
+
uses: actions/setup-node@v4
|
|
293
|
+
with:
|
|
294
|
+
node-version: '20'
|
|
295
|
+
|
|
296
|
+
- name: Run release gate
|
|
297
|
+
run: |
|
|
298
|
+
VERSION="${{ github.event.inputs.release_version }}"
|
|
299
|
+
echo "Running release gate for $VERSION"
|
|
300
|
+
|
|
301
|
+
# Check all release artefacts
|
|
302
|
+
BLOCKERS=()
|
|
303
|
+
|
|
304
|
+
for file in \
|
|
305
|
+
"docs/security-requirements.md" \
|
|
306
|
+
"docs/risk-register.md" \
|
|
307
|
+
"docs/threat-model.md" \
|
|
308
|
+
"docs/sast-findings.md" \
|
|
309
|
+
"docs/test-security-report.md"; do
|
|
310
|
+
if [ ! -f "$file" ]; then
|
|
311
|
+
BLOCKERS+=("MISSING: $file")
|
|
312
|
+
fi
|
|
313
|
+
done
|
|
314
|
+
|
|
315
|
+
if [ ${#BLOCKERS[@]} -gt 0 ]; then
|
|
316
|
+
echo "::error::Release gate FAILED for $VERSION"
|
|
317
|
+
for b in "${BLOCKERS[@]}"; do
|
|
318
|
+
echo "::error::$b"
|
|
319
|
+
done
|
|
320
|
+
exit 1
|
|
321
|
+
fi
|
|
322
|
+
|
|
323
|
+
echo "Release gate PASSED for $VERSION"
|
|
324
|
+
echo "Generate formal sign-off with:"
|
|
325
|
+
echo " claude --agent release-manager 'Run pre-release security checklist for $VERSION'"
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **npm package** `@kaademos/secure-sdlc` (root `package.json`) — global install via `npm install -g @kaademos/secure-sdlc`, `npx @kaademos/secure-sdlc`, semver releases;
|
|
13
|
+
- **`secure-sdlc paths`** — prints `PACKAGE_ROOT` and MCP server path after install
|
|
14
|
+
- **MCP server** (`mcp/`) — 10 `sdlc_*` tools for Cursor, Windsurf, Zed, Continue, and other MCP hosts
|
|
15
|
+
- **CLI** (`cli/`) — `secure-sdlc` commands: `init`, `kickoff`, `status`, `gate`, `review`, `install-mcp`, `paths`
|
|
16
|
+
- **Cursor rules** (`.cursor/rules/secure-sdlc.mdc`) — always-on security context and MCP tool triggers
|
|
17
|
+
- **GitHub Actions** (`.github/workflows/secure-sdlc-gate.yml`) — artefact gate, Gitleaks, CodeQL, Checkov, dependency audits
|
|
18
|
+
- **Git hooks** (`hooks/`) — `pre-commit` (secrets, anti-patterns), `pre-push` (protected-branch checks), `install.sh`
|
|
19
|
+
- **Warp workflows** (`warp-workflows/`) — feature kickoff, PR review, threat model, release gate, status
|
|
20
|
+
- **Stack profiles** (`stacks/`) — Next.js, FastAPI, Django, Express, Rails, generic Node.js
|
|
21
|
+
- **Agents:** `security-champion`, `ai-security-engineer` (OWASP LLM Top 10–aligned)
|
|
22
|
+
- `secure-sdlc.yaml` scaffold generated by `secure-sdlc init`
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **README.md** — multi-tool setup (Claude Code, CLI, MCP), command references, integration map
|
|
26
|
+
- **CLAUDE.md** — extended roster, phase detection, `secure-sdlc.yaml`, stack profiles, AI-feature rule, MCP equivalents
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- CLI `init` / `install-mcp` repository root resolution so templates, hooks, and workflows copy from the correct path
|
|
30
|
+
|
|
31
|
+
### Earlier baseline (same release train)
|
|
32
|
+
- Six Secure SDLC sub-agents
|
|
33
|
+
- CLAUDE.md orchestrator with full lifecycle phase definitions
|
|
34
|
+
- All 8 document templates: security-requirements, risk-register, threat-model,
|
|
35
|
+
infra-security-review, sast-findings, test-security-report, release-sign-off,
|
|
36
|
+
compliance-attestation
|
|
37
|
+
- Three worked examples: login feature, REST API endpoint, file upload
|
|
38
|
+
- README with honest caveat on agent limitations
|
|
39
|
+
- CONTRIBUTING.md, LICENSE, GitHub issue and PR templates
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## How to read this file
|
|
44
|
+
|
|
45
|
+
- **Added** — new agents, templates, examples, or features
|
|
46
|
+
- **Changed** — updates to existing agent guidance or templates
|
|
47
|
+
- **Fixed** — corrections to inaccurate security guidance
|
|
48
|
+
- **Deprecated** — content that will be removed in a future version
|
|
49
|
+
- **Removed** — content that has been removed
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Secure SDLC — Multi-Agent Orchestration
|
|
2
|
+
|
|
3
|
+
This project uses a team of specialised sub-agents to enforce security throughout the entire
|
|
4
|
+
Software Development Lifecycle (SDLC). Each agent has a defined role, phase, and set of
|
|
5
|
+
responsibilities. The orchestrator (you, the main Claude Code session) coordinates them.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Agent Roster
|
|
10
|
+
|
|
11
|
+
| Agent file | Role | Primary phases |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `product-manager` | Secure requirements via ASVS | Plan |
|
|
14
|
+
| `grc-analyst` | Compliance, risk register, audit evidence | Plan → Release |
|
|
15
|
+
| `appsec-engineer` | Threat modelling, SAST/DAST, vuln triage | Design → Test |
|
|
16
|
+
| `cloud-platform-engineer` | IaC security, CSPM, secrets, hardening | Design → Release |
|
|
17
|
+
| `dev-lead` | Secure coding patterns, PR review, dependency review | Build → Test |
|
|
18
|
+
| `release-manager` | Security sign-off, go/no-go gate | Release |
|
|
19
|
+
| `security-champion` | First-line security Q&A and lightweight review | All phases |
|
|
20
|
+
| `ai-security-engineer` | AI/LLM feature security, prompt injection, agentic risks | Design → Test |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Lifecycle Phases & Handoffs
|
|
25
|
+
|
|
26
|
+
### 1. PLAN
|
|
27
|
+
- Invoke `product-manager` to elicit and document security requirements mapped to ASVS levels.
|
|
28
|
+
- Invoke `grc-analyst` to produce the initial risk register and identify applicable compliance
|
|
29
|
+
frameworks (SOC 2, ISO 27001, NIST CSF, PCI-DSS, etc.).
|
|
30
|
+
- Output: `docs/security-requirements.md`, `docs/risk-register.md`
|
|
31
|
+
|
|
32
|
+
### 2. DESIGN
|
|
33
|
+
- Invoke `appsec-engineer` to run a structured threat model (STRIDE or LINDDUN) against the
|
|
34
|
+
proposed architecture.
|
|
35
|
+
- Invoke `cloud-platform-engineer` to review infrastructure design for misconfigurations,
|
|
36
|
+
privilege escalation paths, and secrets handling.
|
|
37
|
+
- Invoke `grc-analyst` to map architecture decisions to compliance controls.
|
|
38
|
+
- Output: `docs/threat-model.md`, `docs/infra-security-review.md`
|
|
39
|
+
|
|
40
|
+
### 3. BUILD
|
|
41
|
+
- Invoke `dev-lead` on every pull request or significant code change to enforce secure coding
|
|
42
|
+
standards and review dependencies (SCA).
|
|
43
|
+
- Invoke `appsec-engineer` to triage any SAST findings and provide remediation guidance.
|
|
44
|
+
- Invoke `cloud-platform-engineer` to validate IaC changes (Terraform, Helm, etc.) and
|
|
45
|
+
check for exposed secrets.
|
|
46
|
+
- Output: inline PR comments, `docs/sast-findings.md`
|
|
47
|
+
|
|
48
|
+
### 4. TEST
|
|
49
|
+
- Invoke `appsec-engineer` to coordinate DAST, fuzz testing, and interpret penetration test
|
|
50
|
+
findings.
|
|
51
|
+
- Invoke `dev-lead` to implement fixes for confirmed vulnerabilities and run security
|
|
52
|
+
regression tests.
|
|
53
|
+
- Invoke `grc-analyst` to collect test evidence for audit artefacts.
|
|
54
|
+
- Output: `docs/test-security-report.md`, `docs/audit-evidence/`
|
|
55
|
+
|
|
56
|
+
### 5. RELEASE
|
|
57
|
+
- Invoke `release-manager` to execute the pre-release security checklist and issue a
|
|
58
|
+
go/no-go decision.
|
|
59
|
+
- Invoke `grc-analyst` for final compliance attestation.
|
|
60
|
+
- Invoke `cloud-platform-engineer` to confirm production hardening (WAF, SIEM alerts,
|
|
61
|
+
runtime protection) is in place.
|
|
62
|
+
- Output: `docs/release-security-sign-off.md`
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Orchestration Rules
|
|
67
|
+
|
|
68
|
+
1. **Never skip a phase gate.** Each phase produces artefacts that the next phase depends on.
|
|
69
|
+
If a required artefact is missing, halt and request it before proceeding.
|
|
70
|
+
|
|
71
|
+
2. **Severity thresholds block progression:**
|
|
72
|
+
- CRITICAL or HIGH unmitigated findings block the Build → Test and Test → Release gates.
|
|
73
|
+
- MEDIUM findings must have an accepted risk or remediation plan before release.
|
|
74
|
+
- LOW findings are tracked in the risk register.
|
|
75
|
+
|
|
76
|
+
3. **All findings are traceable.** Every vulnerability or risk identified by any agent must
|
|
77
|
+
be recorded in `docs/risk-register.md` with an owner, severity, and status.
|
|
78
|
+
|
|
79
|
+
4. **ASVS is the requirements anchor.** The product-manager agent maps every security
|
|
80
|
+
requirement to an ASVS control reference. All other agents reference these when providing
|
|
81
|
+
guidance.
|
|
82
|
+
|
|
83
|
+
5. **Agents collaborate, not compete.** If two agents produce conflicting guidance (e.g.
|
|
84
|
+
appsec-engineer and cloud-platform-engineer disagree on an approach), escalate to the
|
|
85
|
+
orchestrator for resolution and document the decision.
|
|
86
|
+
|
|
87
|
+
6. **AI features require the ai-security-engineer.** Any feature that calls an LLM API,
|
|
88
|
+
processes user input sent to a model, or uses agentic patterns MUST be reviewed by
|
|
89
|
+
`ai-security-engineer` in addition to the standard AppSec review. Prompt injection,
|
|
90
|
+
indirect prompt injection, and excessive agency are SDLC risks, not afterthoughts.
|
|
91
|
+
|
|
92
|
+
7. **Check `secure-sdlc.yaml` for project configuration.** If `secure-sdlc.yaml` exists
|
|
93
|
+
in the project root, use it to determine the ASVS level, applicable compliance frameworks,
|
|
94
|
+
and which CI gates are configured. If it doesn't exist, prompt the user to run
|
|
95
|
+
`secure-sdlc init` or create it manually.
|
|
96
|
+
|
|
97
|
+
8. **Phase detection.** Before starting work, check which SDLC artefacts exist in `docs/`:
|
|
98
|
+
- No artefacts → start with PLAN phase
|
|
99
|
+
- Requirements + risk register exist → proceed to DESIGN
|
|
100
|
+
- Threat model exists → proceed to BUILD
|
|
101
|
+
- SAST findings documented → proceed to TEST
|
|
102
|
+
- Test report exists → ready for RELEASE gate
|
|
103
|
+
The command `secure-sdlc status` provides a visual summary.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Quick-start Commands
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# ── Zero-friction setup ────────────────────────────────────────────────────
|
|
111
|
+
# Install Secure SDLC in your project (docs, hooks, CI, config)
|
|
112
|
+
secure-sdlc init --cursor # + Cursor MCP integration
|
|
113
|
+
|
|
114
|
+
# Interactive feature kickoff wizard
|
|
115
|
+
secure-sdlc kickoff
|
|
116
|
+
|
|
117
|
+
# Check current SDLC phase
|
|
118
|
+
secure-sdlc status
|
|
119
|
+
|
|
120
|
+
# ── Per-phase agent commands ───────────────────────────────────────────────
|
|
121
|
+
# PLAN: Start a new feature with secure requirements
|
|
122
|
+
claude --agent product-manager "Define security requirements for [feature] using ASVS L2"
|
|
123
|
+
claude --agent grc-analyst "Initialise risk register for [feature]. Map to [SOC2/GDPR/etc]"
|
|
124
|
+
|
|
125
|
+
# DESIGN: Threat model + infrastructure review
|
|
126
|
+
claude --agent appsec-engineer "Threat model [architecture] using STRIDE"
|
|
127
|
+
claude --agent cloud-platform-engineer "Review IaC for [feature]: [describe changes]"
|
|
128
|
+
|
|
129
|
+
# DESIGN (AI features): Additional AI security review
|
|
130
|
+
claude --agent ai-security-engineer "Security review AI feature: [describe model usage, inputs, tools]"
|
|
131
|
+
|
|
132
|
+
# BUILD: PR review
|
|
133
|
+
claude --agent dev-lead "Review PR #[N] for secure coding issues and dependency risks"
|
|
134
|
+
claude --agent appsec-engineer "Triage SAST findings for PR #[N]"
|
|
135
|
+
|
|
136
|
+
# Quick security questions (any phase)
|
|
137
|
+
claude --agent security-champion "Is [pattern/library/approach] safe? Context: [what you're building]"
|
|
138
|
+
|
|
139
|
+
# RELEASE: Pre-release security gate
|
|
140
|
+
secure-sdlc gate v[X.Y.Z]
|
|
141
|
+
claude --agent release-manager "Run pre-release security checklist for v[X.Y.Z]"
|
|
142
|
+
|
|
143
|
+
# ── MCP tool equivalents (for Cursor, Windsurf, and other MCP hosts) ──────
|
|
144
|
+
# sdlc_plan_feature, sdlc_threat_model, sdlc_review_pr, sdlc_review_infra,
|
|
145
|
+
# sdlc_triage_sast, sdlc_release_gate, sdlc_check_compliance,
|
|
146
|
+
# sdlc_security_champion, sdlc_ai_security_review
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Artefact Directory Layout
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
docs/
|
|
155
|
+
security-requirements.md # ASVS-mapped requirements (PM agent)
|
|
156
|
+
risk-register.md # Live risk tracking (GRC agent)
|
|
157
|
+
threat-model.md # STRIDE/threat model (AppSec agent)
|
|
158
|
+
infra-security-review.md # IaC & cloud review (Cloud/Platform agent)
|
|
159
|
+
sast-findings.md # Static analysis findings (AppSec + Dev Lead)
|
|
160
|
+
test-security-report.md # DAST, pentest summary (AppSec agent)
|
|
161
|
+
release-security-sign-off.md # Final gate (Release Manager)
|
|
162
|
+
audit-evidence/ # Compliance artefacts (GRC agent)
|
|
163
|
+
|
|
164
|
+
secure-sdlc.yaml # Project security configuration
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Stack-Specific Guidance
|
|
168
|
+
|
|
169
|
+
If the project uses one of these stacks, reference the relevant profile in `stacks/`:
|
|
170
|
+
|
|
171
|
+
| Stack | Profile |
|
|
172
|
+
|---|---|
|
|
173
|
+
| Next.js (App Router) | `stacks/nextjs.md` |
|
|
174
|
+
| FastAPI | `stacks/fastapi.md` |
|
|
175
|
+
| Django | `stacks/django.md` |
|
|
176
|
+
| Express.js | `stacks/express.md` |
|
|
177
|
+
| Ruby on Rails | `stacks/rails.md` |
|
|
178
|
+
|
|
179
|
+
Stack profiles contain framework-specific vulnerability patterns, secure coding examples,
|
|
180
|
+
and recommended libraries. Reference them when the dev-lead or appsec-engineer agents
|
|
181
|
+
provide stack-specific guidance.
|
|
182
|
+
|
|
183
|
+
## Multi-Tool Integration
|
|
184
|
+
|
|
185
|
+
This agent team is available through multiple integration points:
|
|
186
|
+
|
|
187
|
+
| Tool | Integration |
|
|
188
|
+
|---|---|
|
|
189
|
+
| Claude Code | `.claude/agents/` sub-agents (this repository) |
|
|
190
|
+
| Cursor | MCP server (`mcp/`) + Cursor rules (`.cursor/rules/`) |
|
|
191
|
+
| Windsurf / Zed / Continue | MCP server (`mcp/`) |
|
|
192
|
+
| Any terminal | CLI (`cli/`) — `secure-sdlc init|kickoff|review|gate|status` |
|
|
193
|
+
| Warp terminal | Workflows (`warp-workflows/`) |
|
|
194
|
+
| GitHub Actions | CI workflow (`.github/workflows/secure-sdlc-gate.yml`) |
|
|
195
|
+
| Git | Hooks (`hooks/pre-commit`, `hooks/pre-push`) |
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 kaademos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|