security-mcp 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +149 -127
- package/dist/cli/install.js +28 -7
- package/package.json +1 -1
- package/prompts/SECURITY_PROMPT.md +14 -10
- package/skills/{security-review → senior-security-engineer}/SKILL.md +56 -18
package/README.md
CHANGED
|
@@ -1,23 +1,56 @@
|
|
|
1
|
-
# security-mcp
|
|
1
|
+
# security-mcp -- Your AI's Built-In Security Expert
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/security-mcp)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
[](https://github.com/AbrahamOO/security-mcp/actions)
|
|
7
7
|
|
|
8
|
-
**
|
|
8
|
+
**Stop shipping vulnerable code.** security-mcp gives your AI assistant the knowledge of a Senior Security Engineer who actively **finds and fixes** security issues in your code -- not just lists them.
|
|
9
|
+
|
|
10
|
+
Works with Claude Code, GitHub Copilot, Cursor, Codex, Replit, and any MCP-compatible editor.
|
|
9
11
|
|
|
10
12
|
---
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## Who Is This For?
|
|
15
|
+
|
|
16
|
+
You don't need a security background to use this. It's built for:
|
|
17
|
+
|
|
18
|
+
- **Vibe coders** building fast and shipping faster -- who need security to just work
|
|
19
|
+
- **Indie hackers and solo founders** who can't afford a dedicated security team
|
|
20
|
+
- **Full-stack developers** who know their code works but aren't sure if it's safe
|
|
21
|
+
- **Startups and small teams** shipping web apps, mobile apps, APIs, and SaaS products
|
|
22
|
+
- **AI-assisted developers** using Claude Code, Copilot, Cursor, or Codex to write code
|
|
23
|
+
- **Anyone who's ever shipped code and wondered "wait, is this secure?"**
|
|
24
|
+
|
|
25
|
+
You write the code. Your AI + security-mcp enforces the security.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## What It Fortifies
|
|
30
|
+
|
|
31
|
+
security-mcp actively hardens every surface of your software:
|
|
32
|
+
|
|
33
|
+
| Surface | What Gets Fortified |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| **Web Apps** | XSS, CSRF, injection attacks, insecure headers, authentication flaws, session bugs |
|
|
36
|
+
| **APIs (REST, GraphQL, gRPC)** | Auth gaps, IDOR, rate limiting, input validation, CORS misconfigs, SSRF |
|
|
37
|
+
| **Mobile Apps (iOS + Android)** | Insecure storage, certificate pinning, network security, reverse engineering exposure |
|
|
38
|
+
| **Cloud Infrastructure (AWS, GCP, Azure)** | Open firewall rules, public buckets, wildcard IAM, missing encryption, exposed metadata |
|
|
39
|
+
| **AI / LLMs** | Prompt injection, jailbreaks, RAG access control, output validation, data leakage |
|
|
40
|
+
| **Code and Dependencies** | Hardcoded secrets, vulnerable packages, supply chain risks, insecure crypto |
|
|
41
|
+
| **CI/CD Pipelines** | Secrets in logs, overprivileged deploy credentials, unvalidated artifacts |
|
|
13
42
|
|
|
14
|
-
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
15
46
|
|
|
16
47
|
```bash
|
|
17
48
|
npx security-mcp install
|
|
18
49
|
```
|
|
19
50
|
|
|
20
|
-
|
|
51
|
+
That's it. The tool auto-detects your editor and writes the MCP config. Restart your editor -- done.
|
|
52
|
+
|
|
53
|
+
To target a specific editor:
|
|
21
54
|
|
|
22
55
|
```bash
|
|
23
56
|
npx security-mcp install --claude-code
|
|
@@ -25,83 +58,105 @@ npx security-mcp install --cursor
|
|
|
25
58
|
npx security-mcp install --vscode
|
|
26
59
|
```
|
|
27
60
|
|
|
28
|
-
Preview
|
|
61
|
+
Preview without writing anything:
|
|
29
62
|
|
|
30
63
|
```bash
|
|
31
64
|
npx security-mcp install --dry-run
|
|
32
65
|
```
|
|
33
66
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
In **Claude Code**, invoke the skill directly:
|
|
67
|
+
In **Claude Code**, activate the security engineer:
|
|
37
68
|
|
|
38
69
|
```text
|
|
39
|
-
/security-
|
|
70
|
+
/senior-security-engineer
|
|
40
71
|
```
|
|
41
72
|
|
|
73
|
+
Your AI will now **find and fix** security issues instead of just mentioning them.
|
|
74
|
+
|
|
42
75
|
---
|
|
43
76
|
|
|
44
|
-
##
|
|
77
|
+
## How It Works
|
|
45
78
|
|
|
46
|
-
`security-mcp
|
|
79
|
+
When you invoke `/senior-security-engineer` or call any security-mcp MCP tool, your AI shifts into the role of a Senior Security Engineer. It will:
|
|
47
80
|
|
|
48
|
-
|
|
81
|
+
1. **Scan your code** for vulnerabilities, misconfigurations, and security anti-patterns
|
|
82
|
+
2. **Fix what it finds** -- not just flag it; it rewrites the insecure code with the secure version
|
|
83
|
+
3. **Enforce policies** -- set up input validation, auth middleware, security headers, and rate limiting
|
|
84
|
+
4. **Block dangerous patterns** -- refuse to implement code that introduces known vulnerabilities
|
|
85
|
+
5. **Explain everything in plain English** -- no security jargon required
|
|
49
86
|
|
|
50
|
-
|
|
87
|
+
### MCP Tools (Your AI Uses These Automatically)
|
|
51
88
|
|
|
52
89
|
| Tool | What It Does |
|
|
53
90
|
| --- | --- |
|
|
54
|
-
| `security.get_system_prompt` |
|
|
55
|
-
| `security.threat_model` | Generates a complete
|
|
56
|
-
| `security.checklist` | Returns
|
|
57
|
-
| `security.generate_policy` |
|
|
58
|
-
| `security.run_pr_gate` |
|
|
59
|
-
| `repo.read_file` | Reads
|
|
60
|
-
| `repo.search` | Searches
|
|
91
|
+
| `security.get_system_prompt` | Loads the full security directive into your AI session -- activates the Senior Security Engineer mode |
|
|
92
|
+
| `security.threat_model` | Generates a complete threat model for any feature before a single line of code is written |
|
|
93
|
+
| `security.checklist` | Returns a hardened pre-ship checklist specific to your surface (web, API, mobile, AI, cloud) |
|
|
94
|
+
| `security.generate_policy` | Writes a `security-policy.json` for your project that the gate enforces on every PR |
|
|
95
|
+
| `security.run_pr_gate` | Scans your current code diff and **blocks merge** if it introduces CRITICAL or HIGH vulnerabilities |
|
|
96
|
+
| `repo.read_file` | Reads files from your workspace for analysis |
|
|
97
|
+
| `repo.search` | Searches your codebase for vulnerable patterns |
|
|
61
98
|
|
|
62
|
-
###
|
|
99
|
+
### Security Gate (Blocks Bad Code from Shipping)
|
|
63
100
|
|
|
64
|
-
|
|
101
|
+
```bash
|
|
102
|
+
npx security-mcp ci:pr-gate
|
|
103
|
+
```
|
|
65
104
|
|
|
66
|
-
|
|
67
|
-
- **`threat-model-template`** - Accepts a `feature` argument and returns a ready-to-fill threat model template.
|
|
105
|
+
Add this to your CI pipeline. It scans every PR and **blocks the merge** if it finds:
|
|
68
106
|
|
|
69
|
-
|
|
107
|
+
- Hardcoded secrets or credentials
|
|
108
|
+
- Known vulnerable dependencies (CRITICAL/HIGH CVEs)
|
|
109
|
+
- Dangerous IaC patterns (open firewall rules, world-readable storage, wildcard IAM)
|
|
110
|
+
- Auth gaps, SSRF, CSRF exposure
|
|
111
|
+
- AI/LLM output that isn't properly bounded or validated
|
|
70
112
|
|
|
71
|
-
|
|
113
|
+
---
|
|
72
114
|
|
|
73
|
-
|
|
74
|
-
- MITRE ATT&CK (Enterprise, Cloud, Mobile) coverage table
|
|
75
|
-
- MITRE D3FEND countermeasure mapping
|
|
76
|
-
- MITRE ATLAS adversarial ML threat coverage
|
|
77
|
-
- Zero Trust architecture enforcement (NIST 800-207)
|
|
78
|
-
- Cloud security rules (GCP, AWS, Azure) with absolute prohibitions
|
|
79
|
-
- Container and Kubernetes hardening (CIS Benchmark Level 2)
|
|
80
|
-
- Supply chain security (SLSA L3, SBOM, Sigstore)
|
|
81
|
-
- DevSecOps pipeline gates (SAST, SCA, IaC, DAST)
|
|
82
|
-
- Input validation - three-layer defense for every field type
|
|
83
|
-
- AI/LLM security (prompt injection defense, RAG access control, output validation)
|
|
84
|
-
- PCI DSS 4.0 payment flow controls
|
|
85
|
-
- GDPR/CCPA/HIPAA data flow compliance
|
|
86
|
-
- Vulnerability SLAs (CRITICAL: 24h, HIGH: 7d, MEDIUM: 30d)
|
|
87
|
-
- Pre-release security checklist (Section 22E)
|
|
115
|
+
## What Gets Fixed Automatically
|
|
88
116
|
|
|
89
|
-
|
|
117
|
+
When your AI has security-mcp active, it will **fix these automatically** -- not just warn about them:
|
|
90
118
|
|
|
91
|
-
|
|
119
|
+
### Secrets and Authentication
|
|
92
120
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
- Moves hardcoded secrets to environment variables / secret managers
|
|
122
|
+
- Implements proper JWT validation (signature, expiry, issuer, audience)
|
|
123
|
+
- Adds rate limiting and account lockout to auth endpoints
|
|
124
|
+
- Enforces MFA requirements and session timeout policies
|
|
125
|
+
- Implements Argon2id password hashing (not MD5, not SHA-1)
|
|
126
|
+
|
|
127
|
+
### Input Validation and Injection
|
|
128
|
+
|
|
129
|
+
- Adds server-side schema validation (Zod / Yup) to every API route
|
|
130
|
+
- Blocks SQL injection, XSS, command injection, path traversal, SSRF
|
|
131
|
+
- Sanitizes file uploads (validates magic bytes, strips filenames, scans for malware)
|
|
132
|
+
- Normalizes and validates all user inputs with allowlist rules
|
|
133
|
+
|
|
134
|
+
### Network and Cloud
|
|
135
|
+
|
|
136
|
+
- Removes `0.0.0.0/0` ingress rules and replaces with source-restricted rules
|
|
137
|
+
- Locks down S3/GCS/Azure Blob buckets that are world-readable
|
|
138
|
+
- Removes wildcard IAM permissions and replaces with least-privilege policies
|
|
139
|
+
- Enforces TLS 1.3 and rejects weak cipher suites
|
|
96
140
|
|
|
97
|
-
|
|
98
|
-
|
|
141
|
+
### Web Security
|
|
142
|
+
|
|
143
|
+
- Sets mandatory security headers (CSP, HSTS, X-Frame-Options, Permissions-Policy)
|
|
144
|
+
- Removes inline JavaScript; enforces nonce-based CSP
|
|
145
|
+
- Fixes CORS configurations that allow `*` on authenticated endpoints
|
|
146
|
+
- Adds CSRF protection to all state-mutating endpoints
|
|
147
|
+
|
|
148
|
+
### AI / LLM Security
|
|
149
|
+
|
|
150
|
+
- Separates user content from system prompts (prevents prompt injection)
|
|
151
|
+
- Adds output schema validation so models can't return arbitrary dangerous content
|
|
152
|
+
- Enforces access control on RAG document retrieval
|
|
153
|
+
- Adds rate limiting specific to AI endpoints
|
|
99
154
|
|
|
100
155
|
---
|
|
101
156
|
|
|
102
157
|
## Supported Editors
|
|
103
158
|
|
|
104
|
-
| Editor |
|
|
159
|
+
| Editor | Install Command | Config Location |
|
|
105
160
|
| --- | --- | --- |
|
|
106
161
|
| Claude Code | `npx security-mcp install --claude-code` | `~/.claude/settings.json` |
|
|
107
162
|
| Cursor (global) | `npx security-mcp install --cursor` | `~/.cursor/mcp.json` |
|
|
@@ -110,44 +165,36 @@ auth and authorization gaps, SSRF and CSRF exposure, and AI/LLM output bounding.
|
|
|
110
165
|
| GitHub Copilot | Manual config (see below) | `.vscode/settings.json` |
|
|
111
166
|
| Codex | Manual config (see below) | Editor config |
|
|
112
167
|
| Replit | Manual config (see below) | `.replit` config |
|
|
113
|
-
| Any MCP-compatible | `npx security-mcp config`
|
|
168
|
+
| Any MCP-compatible | `npx security-mcp config` | Paste into editor config |
|
|
114
169
|
|
|
115
170
|
---
|
|
116
171
|
|
|
117
|
-
## Security Frameworks
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
- OWASP
|
|
123
|
-
- OWASP
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
- MITRE ATT&CK Mobile
|
|
127
|
-
- MITRE
|
|
128
|
-
- MITRE
|
|
129
|
-
-
|
|
130
|
-
- NIST 800-
|
|
131
|
-
- NIST
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
- ISO/IEC 42001:2023 (AI Management)
|
|
140
|
-
- GDPR / CCPA / HIPAA
|
|
141
|
-
- CIS Benchmarks Level 2
|
|
142
|
-
- CSA CCM v4
|
|
143
|
-
- SLSA Level 3
|
|
144
|
-
- FedRAMP Moderate
|
|
145
|
-
- CVSS v4.0 + EPSS
|
|
146
|
-
- CWE/SANS Top 25
|
|
172
|
+
## Security Frameworks Applied (Automatically)
|
|
173
|
+
|
|
174
|
+
You don't need to know what these are. They're the standards that the world's top security teams use.
|
|
175
|
+
security-mcp applies all of them on your behalf:
|
|
176
|
+
|
|
177
|
+
- OWASP Top 10 (Web + API) -- the most common attack patterns
|
|
178
|
+
- OWASP ASVS Level 2/3 -- application security verification
|
|
179
|
+
- OWASP MASVS -- mobile app security
|
|
180
|
+
- OWASP Top 10 for LLMs -- AI-specific vulnerabilities
|
|
181
|
+
- MITRE ATT&CK Enterprise, Cloud, and Mobile -- real attacker playbooks
|
|
182
|
+
- MITRE D3FEND -- defensive countermeasures mapped to every attack
|
|
183
|
+
- MITRE ATLAS -- adversarial ML/AI attack techniques
|
|
184
|
+
- NIST 800-53 Rev 5 -- the US government's security control catalog
|
|
185
|
+
- NIST 800-207 -- Zero Trust Architecture
|
|
186
|
+
- NIST AI RMF -- AI risk management
|
|
187
|
+
- PCI DSS 4.0 -- payment card security (if you handle payments)
|
|
188
|
+
- SOC 2 Type II -- cloud service security (if you serve enterprise customers)
|
|
189
|
+
- ISO 27001:2022 -- international security management standard
|
|
190
|
+
- GDPR / CCPA / HIPAA -- data privacy compliance
|
|
191
|
+
- SLSA Level 3 -- supply chain security
|
|
192
|
+
- CIS Benchmarks Level 2 -- hardened configurations for cloud and containers
|
|
193
|
+
- CVSS v4.0 + EPSS -- vulnerability scoring and exploit probability
|
|
147
194
|
|
|
148
195
|
---
|
|
149
196
|
|
|
150
|
-
## Manual Configuration
|
|
197
|
+
## Manual Editor Configuration
|
|
151
198
|
|
|
152
199
|
### Claude Code (`~/.claude/settings.json`)
|
|
153
200
|
|
|
@@ -188,7 +235,7 @@ auth and authorization gaps, SSRF and CSRF exposure, and AI/LLM output bounding.
|
|
|
188
235
|
}
|
|
189
236
|
```
|
|
190
237
|
|
|
191
|
-
Print the
|
|
238
|
+
Print the config snippet for any editor:
|
|
192
239
|
|
|
193
240
|
```bash
|
|
194
241
|
npx security-mcp config
|
|
@@ -196,26 +243,22 @@ npx security-mcp config
|
|
|
196
243
|
|
|
197
244
|
---
|
|
198
245
|
|
|
199
|
-
## Security Policy
|
|
246
|
+
## Security Policy (CI/CD Gate)
|
|
200
247
|
|
|
201
|
-
Copy the default
|
|
248
|
+
Copy the default policy into your project:
|
|
202
249
|
|
|
203
250
|
```bash
|
|
204
251
|
cp node_modules/security-mcp/defaults/security-policy.json .mcp/policies/security-policy.json
|
|
205
252
|
cp node_modules/security-mcp/defaults/evidence-map.json .mcp/mappings/evidence-map.json
|
|
206
253
|
```
|
|
207
254
|
|
|
208
|
-
Or generate
|
|
255
|
+
Or generate one tailored to your project:
|
|
209
256
|
|
|
210
257
|
```text
|
|
211
258
|
Ask your AI: "Run security.generate_policy with surfaces=[web, api, ai] and cloud=aws"
|
|
212
259
|
```
|
|
213
260
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
## CI/CD Integration
|
|
217
|
-
|
|
218
|
-
Add the security gate to your GitHub Actions workflow:
|
|
261
|
+
Add the gate to GitHub Actions:
|
|
219
262
|
|
|
220
263
|
```yaml
|
|
221
264
|
name: Security Gate
|
|
@@ -236,49 +279,28 @@ jobs:
|
|
|
236
279
|
with:
|
|
237
280
|
node-version: '20'
|
|
238
281
|
|
|
239
|
-
- name:
|
|
282
|
+
- name: Block insecure code from merging
|
|
240
283
|
run: npx -y security-mcp ci:pr-gate
|
|
241
284
|
env:
|
|
242
285
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
243
286
|
```
|
|
244
287
|
|
|
245
|
-
The gate exits non-zero on CRITICAL or HIGH findings, blocking the PR merge.
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Threat Modeling
|
|
250
|
-
|
|
251
|
-
Ask your AI to generate a threat model for any feature:
|
|
252
|
-
|
|
253
|
-
```text
|
|
254
|
-
Run security.threat_model with feature="user authentication with OAuth 2.0" and surfaces=["web", "api"]
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
The tool returns a complete STRIDE + PASTA + ATT&CK + D3FEND template covering:
|
|
258
|
-
|
|
259
|
-
- Asset inventory and trust boundaries
|
|
260
|
-
- STRIDE analysis per component and trust boundary
|
|
261
|
-
- ATT&CK technique mapping with D3FEND countermeasures
|
|
262
|
-
- NIST 800-53 Rev 5 control IDs
|
|
263
|
-
- Residual risk register with owner and review date
|
|
264
|
-
- Pre-release security checklist
|
|
265
|
-
|
|
266
288
|
---
|
|
267
289
|
|
|
268
|
-
##
|
|
290
|
+
## The 10 Rules That Are Never Broken
|
|
269
291
|
|
|
270
|
-
|
|
292
|
+
No matter what your AI is asked to do, these rules are enforced without exception:
|
|
271
293
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
294
|
+
1. No `0.0.0.0/0` firewall rules -- ever
|
|
295
|
+
2. All internal services talk over private VPC only (no public internet)
|
|
296
|
+
3. Secrets live in a secret manager only -- never in code, env files, or logs
|
|
297
|
+
4. TLS 1.3 for everything in transit -- 1.0 and 1.1 are blocked
|
|
298
|
+
5. Passwords hashed with Argon2id or bcrypt (cost 14+) -- no MD5, no SHA-1
|
|
299
|
+
6. Every API input validated server-side with a schema -- no exceptions
|
|
300
|
+
7. No inline JavaScript -- CSP nonce-based only
|
|
301
|
+
8. Admin interfaces require FIDO2/WebAuthn passkey -- not just a password
|
|
302
|
+
9. Threat model written before building any auth, payment, or AI feature
|
|
303
|
+
10. Zero Trust: every request authenticated and authorized regardless of origin
|
|
282
304
|
|
|
283
305
|
---
|
|
284
306
|
|
|
@@ -286,9 +308,9 @@ The security persona enforces these rules without exception:
|
|
|
286
308
|
|
|
287
309
|
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
288
310
|
|
|
289
|
-
##
|
|
311
|
+
## Responsible Disclosure
|
|
290
312
|
|
|
291
|
-
See [SECURITY.md](SECURITY.md)
|
|
313
|
+
See [SECURITY.md](SECURITY.md).
|
|
292
314
|
|
|
293
315
|
## License
|
|
294
316
|
|
package/dist/cli/install.js
CHANGED
|
@@ -102,11 +102,32 @@ function writeVsCodeSettings(configPath, dryRun) {
|
|
|
102
102
|
}
|
|
103
103
|
return configPath;
|
|
104
104
|
}
|
|
105
|
+
function installPolicy(dryRun) {
|
|
106
|
+
const policySrc = join(PKG_ROOT, "defaults", "security-policy.json");
|
|
107
|
+
const policyDest = join(process.cwd(), ".mcp", "policies", "security-policy.json");
|
|
108
|
+
const evidenceSrc = join(PKG_ROOT, "defaults", "evidence-map.json");
|
|
109
|
+
const evidenceDest = join(process.cwd(), ".mcp", "mappings", "evidence-map.json");
|
|
110
|
+
for (const { src, dest } of [{ src: policySrc, dest: policyDest }, { src: evidenceSrc, dest: evidenceDest }]) {
|
|
111
|
+
if (!existsSync(src)) {
|
|
112
|
+
process.stdout.write(` [skip] ${src} not found in package\n`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (existsSync(dest)) {
|
|
116
|
+
process.stdout.write(` [skip] already exists: ${dest}\n`);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (!dryRun) {
|
|
120
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
121
|
+
copyFileSync(src, dest);
|
|
122
|
+
}
|
|
123
|
+
process.stdout.write(` ${dryRun ? "[dry-run] would copy" : "installed"}: ${dest}\n`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
105
126
|
function installSkill(dryRun) {
|
|
106
|
-
const skillSrc = join(PKG_ROOT, "skills", "security-
|
|
107
|
-
const skillDest = resolveHome("~/.claude/skills/security-
|
|
127
|
+
const skillSrc = join(PKG_ROOT, "skills", "senior-security-engineer", "SKILL.md");
|
|
128
|
+
const skillDest = resolveHome("~/.claude/skills/senior-security-engineer/SKILL.md");
|
|
108
129
|
if (!existsSync(skillSrc)) {
|
|
109
|
-
process.stdout.write(" [skip] skills/security-
|
|
130
|
+
process.stdout.write(" [skip] skills/senior-security-engineer/SKILL.md not found in package\n");
|
|
110
131
|
return;
|
|
111
132
|
}
|
|
112
133
|
if (!dryRun) {
|
|
@@ -148,14 +169,14 @@ export async function runInstall(opts) {
|
|
|
148
169
|
process.stdout.write("\nInstalling Claude Code skill...\n");
|
|
149
170
|
installSkill(dryRun);
|
|
150
171
|
}
|
|
172
|
+
process.stdout.write("\nInstalling security policy...\n");
|
|
173
|
+
installPolicy(dryRun);
|
|
151
174
|
process.stdout.write("\n");
|
|
152
175
|
process.stdout.write(dryRun
|
|
153
176
|
? "Dry-run complete. Re-run without --dry-run to apply.\n"
|
|
154
177
|
: "Done! Restart your editor to activate the security-mcp server.\n");
|
|
155
178
|
process.stdout.write("\nNext steps:\n");
|
|
156
179
|
process.stdout.write(" 1. Restart your editor.\n");
|
|
157
|
-
process.stdout.write(' 2. In Claude Code, type /security-
|
|
158
|
-
process.stdout.write(' 3. Ask your AI: "Run security.run_pr_gate" to check your current diff.\n');
|
|
159
|
-
process.stdout.write(" 4. Copy defaults/security-policy.json to .mcp/policies/security-policy.json\n");
|
|
160
|
-
process.stdout.write(" and customize it for your project.\n\n");
|
|
180
|
+
process.stdout.write(' 2. In Claude Code, type /senior-security-engineer to activate the security persona.\n');
|
|
181
|
+
process.stdout.write(' 3. Ask your AI: "Run security.run_pr_gate" to check your current diff.\n\n');
|
|
161
182
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "security-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "AI security MCP server and enforcement gate for Claude Code, Cursor, GitHub Copilot, Codex, Replit, and any MCP-compatible editor. Applies OWASP, MITRE ATT&CK, NIST, Zero Trust, PCI DSS, SOC 2, and ISO 27001.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,26 +8,30 @@ afterthoughts**.
|
|
|
8
8
|
|
|
9
9
|
## ROLE
|
|
10
10
|
|
|
11
|
-
You are a **
|
|
12
|
-
|
|
13
|
-
skeleton every feature is built on.
|
|
11
|
+
You are a **Senior Security Engineer**. Your operating ratio is **90% fixing, 10% advisory**.
|
|
12
|
+
You do not list vulnerabilities and walk away - you write the fix, implement the control, and enforce
|
|
13
|
+
the policy. Security is not a layer added at the end - it is the skeleton every feature is built on.
|
|
14
|
+
|
|
15
|
+
**90% action:** Write the secure code. Implement the validation, middleware, and policies directly.
|
|
16
|
+
Set up encryption, access controls, and secret management. Produce production-ready fixes every time.
|
|
17
|
+
|
|
18
|
+
**10% explanation:** Briefly note what was wrong, what attack it prevents, and the relevant framework
|
|
19
|
+
control (OWASP, ATT&CK, NIST) in one line. Then move on.
|
|
14
20
|
|
|
15
21
|
Your mandate:
|
|
16
22
|
|
|
23
|
+
- **Actively rewrite insecure code** - fix it; do not leave it in place with a warning comment
|
|
24
|
+
- **Set and enforce security policies** - write the policy, the validation, the middleware, the gate
|
|
17
25
|
- Enforce **secure-by-default design** at architecture, implementation, and deployment levels
|
|
18
|
-
-
|
|
19
|
-
infrastructure-as-code (IaC), and dependencies
|
|
20
|
-
- **Block and roll back risky changes** unless explicitly approved with a documented risk-acceptance
|
|
21
|
-
record
|
|
26
|
+
- **Block and roll back risky changes** unless explicitly approved with a documented risk-acceptance record
|
|
22
27
|
- Model every feature from the attacker's point of view before writing a single line of code
|
|
23
28
|
- Treat every unanswered security question as a **critical blocker** - not a backlog item
|
|
24
29
|
- Think like APT-level adversaries (nation-state, ransomware groups, insider threats) on every decision
|
|
25
|
-
- Never accept "good enough" security - chase defense-in-depth, least privilege, and
|
|
26
|
-
zero-implicit-trust exhaustively
|
|
30
|
+
- Never accept "good enough" security - chase defense-in-depth, least privilege, and zero-implicit-trust
|
|
27
31
|
|
|
28
32
|
You do not take shortcuts. You do not make exceptions without full traceability. You do not allow
|
|
29
33
|
internet-exposed surfaces with overly permissive rules (`0.0.0.0/0`). You mandate VPC-native, private
|
|
30
|
-
connectivity everywhere.
|
|
34
|
+
connectivity everywhere. **You write the fix. Every time. No exceptions.**
|
|
31
35
|
|
|
32
36
|
---
|
|
33
37
|
|
|
@@ -1,41 +1,79 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: security-
|
|
3
|
-
description:
|
|
2
|
+
name: senior-security-engineer
|
|
3
|
+
description: Activates a Senior Security Engineer that actively fortifies your code, APIs, mobile apps, cloud infra (AWS/GCP/Azure), and AI/LLMs. 90% fixing -- writes the secure code, sets the policies, enforces controls. 10% advisory. Built on OWASP, MITRE ATT&CK, NIST 800-53, PCI DSS 4.0, SOC 2, and 20+ frameworks. No security background needed.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Bash
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Security
|
|
8
|
+
# Senior Security Engineer - Active Fortification (Web, API, Mobile, Cloud, AI/LLM)
|
|
9
9
|
|
|
10
|
-
You are activating the **
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
You are activating the **Senior Security Engineer** persona via security-mcp.
|
|
11
|
+
Your operating ratio is **90% fixing, 10% advisory**. You write the fix. You implement the control.
|
|
12
|
+
You do not leave insecure code in place with a warning.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
## ROLE
|
|
17
17
|
|
|
18
|
-
You are a **
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
You are a **Senior Security Engineer**. Your primary job is to actively write secure code, fix
|
|
19
|
+
vulnerabilities, implement security controls, and harden every surface -- code, APIs, cloud
|
|
20
|
+
infrastructure (AWS, GCP, Azure), mobile apps (iOS + Android), and AI/LLM integrations.
|
|
21
|
+
|
|
22
|
+
### Operating Principle: 90% Fixing, 10% Advisory
|
|
23
|
+
|
|
24
|
+
**90% of your output is action:**
|
|
25
|
+
|
|
26
|
+
- Write the secure version of any insecure code you find immediately
|
|
27
|
+
- Implement the validation, middleware, rate limiting, headers, and policies directly in code
|
|
28
|
+
- Set up the access controls, secret management, and encryption configurations
|
|
29
|
+
- Produce working, production-ready secure code -- not pseudocode, not suggestions
|
|
30
|
+
|
|
31
|
+
**10% of your output is explanation:**
|
|
32
|
+
|
|
33
|
+
- Briefly explain what was wrong and why (in plain language any developer can understand)
|
|
34
|
+
- Note the attack vector that was prevented
|
|
35
|
+
- Reference the relevant framework control (OWASP, ATT&CK, NIST) in one line
|
|
36
|
+
|
|
37
|
+
**When you see a vulnerability, you do exactly this:**
|
|
38
|
+
|
|
39
|
+
1. Show the insecure code (2-3 lines of context max)
|
|
40
|
+
2. Write the fixed, secure version -- complete and ready to use
|
|
41
|
+
3. One-line explanation: what it was, what attack it prevents
|
|
42
|
+
4. Done. Move to the next issue.
|
|
43
|
+
|
|
44
|
+
**You do NOT:**
|
|
45
|
+
|
|
46
|
+
- Write long advisory reports when a code fix is needed
|
|
47
|
+
- List vulnerabilities without fixing them
|
|
48
|
+
- Recommend that the developer "consider" doing something security-related
|
|
49
|
+
- Leave insecure code in place with a warning comment attached
|
|
50
|
+
|
|
51
|
+
### Surfaces You Actively Fortify
|
|
52
|
+
|
|
53
|
+
- **Web apps**: XSS, CSRF, injection, insecure headers, auth flaws, session vulnerabilities
|
|
54
|
+
- **APIs (REST, GraphQL, gRPC)**: Auth gaps, IDOR, rate limiting, input validation, SSRF, CORS
|
|
55
|
+
- **Mobile (iOS + Android)**: Insecure storage, cert pinning, ATS/NSC configs, debuggable releases
|
|
56
|
+
- **Cloud (AWS, GCP, Azure)**: Open firewall rules, public buckets, wildcard IAM, missing encryption
|
|
57
|
+
- **AI/LLMs**: Prompt injection, jailbreaks, RAG access control, output validation, data leakage
|
|
58
|
+
- **Code and dependencies**: Hardcoded secrets, vulnerable packages, insecure crypto, supply chain
|
|
59
|
+
- **CI/CD pipelines**: Secrets in logs, overprivileged credentials, unvalidated build artifacts
|
|
21
60
|
|
|
22
61
|
Your mandate:
|
|
23
62
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
- Model every feature from the attacker's point of view before writing a single line of code
|
|
30
|
-
- Treat every unanswered security question as a **critical blocker** - not a backlog item
|
|
63
|
+
- **Actively rewrite insecure code** -- fix it with the correct secure implementation every time
|
|
64
|
+
- **Set and enforce security policies** -- write the policy, the validation, the middleware, the gate
|
|
65
|
+
- **Block and roll back risky changes** -- unless explicitly approved with a documented risk-acceptance record
|
|
66
|
+
- Model every feature from the attacker's point of view **before writing a single line of code**
|
|
67
|
+
- Treat every unanswered security question as a **critical blocker** -- not a backlog item
|
|
31
68
|
- Think like APT-level adversaries (nation-state, ransomware groups, insider threats) on every decision
|
|
32
|
-
- Never accept "good enough" security
|
|
33
|
-
zero-implicit-trust exhaustively
|
|
69
|
+
- Never accept "good enough" security -- chase defense-in-depth, least privilege, and zero-implicit-trust
|
|
34
70
|
|
|
35
71
|
You do not take shortcuts. You do not make exceptions without full traceability. You do not allow
|
|
36
72
|
internet-exposed surfaces with overly permissive rules (`0.0.0.0/0`). You mandate VPC-native, private
|
|
37
73
|
connectivity everywhere.
|
|
38
74
|
|
|
75
|
+
**You write the fix. Every time. No exceptions.**
|
|
76
|
+
|
|
39
77
|
---
|
|
40
78
|
|
|
41
79
|
## 1) NON-NEGOTIABLE SECURITY + COMPLIANCE FRAMEWORKS
|