@h1dr0n/skill-pool 0.1.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/LICENSE +21 -0
- package/README.md +296 -0
- package/bin/cli.js +157 -0
- package/package.json +41 -0
- package/skills/api/agents/backend-specialist.md +69 -0
- package/skills/api/agents/database-optimizer.md +176 -0
- package/skills/api/manifest.yaml +20 -0
- package/skills/api/rules/auth-security.md +45 -0
- package/skills/api/skills/api-patterns/SKILL.md +81 -0
- package/skills/api/skills/api-patterns/api-style.md +42 -0
- package/skills/api/skills/api-patterns/auth.md +24 -0
- package/skills/api/skills/api-patterns/documentation.md +26 -0
- package/skills/api/skills/api-patterns/graphql.md +41 -0
- package/skills/api/skills/api-patterns/rate-limiting.md +31 -0
- package/skills/api/skills/api-patterns/response.md +37 -0
- package/skills/api/skills/api-patterns/rest.md +40 -0
- package/skills/api/skills/api-patterns/scripts/api_validator.py +211 -0
- package/skills/api/skills/api-patterns/security-testing.md +122 -0
- package/skills/api/skills/api-patterns/trpc.md +41 -0
- package/skills/api/skills/api-patterns/versioning.md +22 -0
- package/skills/api/skills/database-patterns.md +126 -0
- package/skills/api/skills/deployment-patterns.md +105 -0
- package/skills/api/skills/docker-patterns.md +135 -0
- package/skills/common/agents/code-reviewer.md +78 -0
- package/skills/common/agents/planner.md +80 -0
- package/skills/common/agents/security-reviewer.md +82 -0
- package/skills/common/agents/software-architect.md +81 -0
- package/skills/common/manifest.yaml +25 -0
- package/skills/common/rules/coding-style.md +39 -0
- package/skills/common/rules/git-workflow.md +33 -0
- package/skills/common/rules/security.md +25 -0
- package/skills/common/skills/architecture/SKILL.md +55 -0
- package/skills/common/skills/architecture/context-discovery.md +43 -0
- package/skills/common/skills/architecture/examples.md +94 -0
- package/skills/common/skills/architecture/pattern-selection.md +68 -0
- package/skills/common/skills/architecture/patterns-reference.md +50 -0
- package/skills/common/skills/architecture/trade-off-analysis.md +77 -0
- package/skills/common/skills/brainstorming/SKILL.md +163 -0
- package/skills/common/skills/brainstorming/dynamic-questioning.md +350 -0
- package/skills/common/skills/clean-code.md +99 -0
- package/skills/common/skills/code-review-checklist.md +86 -0
- package/skills/common/skills/plan-writing/SKILL.md +152 -0
- package/skills/common/skills/skill-feedback.md +94 -0
- package/skills/common/skills/tdd-workflow.md +130 -0
- package/skills/common/skills/verification-loop.md +112 -0
- package/skills/cpp/agents/cpp-build-resolver.md +90 -0
- package/skills/cpp/agents/cpp-reviewer.md +72 -0
- package/skills/cpp/manifest.yaml +15 -0
- package/skills/cpp/skills/cpp-coding-standards.md +722 -0
- package/skills/cpp/skills/cpp-testing.md +323 -0
- package/skills/devops/agents/devops-automator.md +376 -0
- package/skills/devops/agents/sre.md +90 -0
- package/skills/devops/manifest.yaml +20 -0
- package/skills/devops/skills/deployment-patterns.md +427 -0
- package/skills/devops/skills/deployment-procedures/SKILL.md +241 -0
- package/skills/devops/skills/docker-patterns.md +364 -0
- package/skills/devops/skills/e2e-testing.md +326 -0
- package/skills/devops/skills/github-ops.md +144 -0
- package/skills/django/manifest.yaml +16 -0
- package/skills/django/skills/django-patterns.md +734 -0
- package/skills/django/skills/django-security.md +593 -0
- package/skills/django/skills/django-tdd.md +729 -0
- package/skills/django/skills/django-verification.md +469 -0
- package/skills/dotnet/agents/csharp-reviewer.md +101 -0
- package/skills/dotnet/manifest.yaml +14 -0
- package/skills/dotnet/skills/csharp-testing.md +321 -0
- package/skills/dotnet/skills/dotnet-patterns.md +321 -0
- package/skills/go/agents/code-reviewer.md +76 -0
- package/skills/go/agents/go-build-resolver.md +94 -0
- package/skills/go/agents/go-reviewer.md +76 -0
- package/skills/go/manifest.yaml +17 -0
- package/skills/go/rules/go-style.md +55 -0
- package/skills/go/skills/golang-patterns.md +674 -0
- package/skills/go/skills/golang-testing.md +720 -0
- package/skills/java/agents/java-build-resolver.md +153 -0
- package/skills/java/agents/java-reviewer.md +92 -0
- package/skills/java/manifest.yaml +18 -0
- package/skills/java/skills/java-coding-standards.md +147 -0
- package/skills/java/skills/jpa-patterns.md +151 -0
- package/skills/java/skills/springboot-patterns.md +314 -0
- package/skills/java/skills/springboot-security.md +272 -0
- package/skills/kotlin/agents/kotlin-build-resolver.md +118 -0
- package/skills/kotlin/agents/kotlin-reviewer.md +159 -0
- package/skills/kotlin/manifest.yaml +17 -0
- package/skills/kotlin/skills/kotlin-coroutines-flows.md +284 -0
- package/skills/kotlin/skills/kotlin-patterns.md +711 -0
- package/skills/kotlin/skills/kotlin-testing.md +824 -0
- package/skills/laravel/manifest.yaml +15 -0
- package/skills/laravel/skills/laravel-patterns.md +409 -0
- package/skills/laravel/skills/laravel-security.md +279 -0
- package/skills/laravel/skills/laravel-tdd.md +277 -0
- package/skills/laravel/skills/laravel-verification.md +173 -0
- package/skills/mobile/agents/dart-build-resolver.md +201 -0
- package/skills/mobile/agents/flutter-reviewer.md +243 -0
- package/skills/mobile/manifest.yaml +19 -0
- package/skills/mobile/skills/android-clean-architecture.md +339 -0
- package/skills/mobile/skills/dart-flutter-patterns.md +563 -0
- package/skills/mobile/skills/swiftui-patterns.md +259 -0
- package/skills/nestjs/manifest.yaml +13 -0
- package/skills/nestjs/skills/nestjs-patterns.md +230 -0
- package/skills/perl/manifest.yaml +13 -0
- package/skills/perl/skills/perl-patterns.md +504 -0
- package/skills/perl/skills/perl-security.md +503 -0
- package/skills/perl/skills/perl-testing.md +475 -0
- package/skills/python/agents/python-reviewer.md +98 -0
- package/skills/python/manifest.yaml +18 -0
- package/skills/python/rules/python-style.md +69 -0
- package/skills/python/skills/python-patterns/SKILL.md +441 -0
- package/skills/python/skills/python-patterns.md +90 -0
- package/skills/python/skills/python-testing.md +81 -0
- package/skills/rust/agents/rust-build-resolver.md +148 -0
- package/skills/rust/agents/rust-reviewer.md +94 -0
- package/skills/rust/manifest.yaml +16 -0
- package/skills/rust/rules/rust-style.md +107 -0
- package/skills/rust/skills/rust-patterns.md +499 -0
- package/skills/rust/skills/rust-testing.md +500 -0
- package/skills/security/agents/accessibility-auditor.md +316 -0
- package/skills/security/agents/security-reviewer.md +108 -0
- package/skills/security/manifest.yaml +19 -0
- package/skills/security/skills/red-team-tactics/SKILL.md +199 -0
- package/skills/security/skills/security-bounty-hunter.md +99 -0
- package/skills/security/skills/security-review.md +495 -0
- package/skills/security/skills/security-scan.md +165 -0
- package/skills/security/skills/vulnerability-scanner/SKILL.md +276 -0
- package/skills/security/skills/vulnerability-scanner/checklists.md +121 -0
- package/skills/security/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/skills/swift/manifest.yaml +16 -0
- package/skills/swift/skills/swift-actor-persistence.md +142 -0
- package/skills/swift/skills/swift-concurrency.md +216 -0
- package/skills/swift/skills/swift-protocol-di-testing.md +190 -0
- package/skills/swift/skills/swiftui-patterns.md +259 -0
- package/skills/unity/agents/game-designer.md +167 -0
- package/skills/unity/agents/unity-architect.md +52 -0
- package/skills/unity/agents/unity-editor-tool-developer.md +310 -0
- package/skills/unity/agents/unity-multiplayer-engineer.md +321 -0
- package/skills/unity/agents/unity-shader-graph-artist.md +269 -0
- package/skills/unity/manifest.yaml +21 -0
- package/skills/unity/rules/csharp-patterns.md +48 -0
- package/skills/unity/rules/unity-specific.md +53 -0
- package/skills/unity/skills/systematic-debugging.md +92 -0
- package/skills/unity/skills/unity-architecture.md +173 -0
- package/skills/unreal/agents/level-designer.md +208 -0
- package/skills/unreal/agents/technical-artist.md +229 -0
- package/skills/unreal/agents/unreal-multiplayer-architect.md +313 -0
- package/skills/unreal/agents/unreal-systems-engineer.md +310 -0
- package/skills/unreal/agents/unreal-technical-artist.md +256 -0
- package/skills/unreal/agents/unreal-world-builder.md +273 -0
- package/skills/unreal/manifest.yaml +21 -0
- package/skills/unreal/skills/unreal-patterns.md +183 -0
- package/skills/web/agents/frontend-specialist.md +71 -0
- package/skills/web/agents/ui-designer.md +383 -0
- package/skills/web/agents/ux-architect.md +469 -0
- package/skills/web/manifest.yaml +22 -0
- package/skills/web/rules/accessibility.md +54 -0
- package/skills/web/rules/css-performance.md +52 -0
- package/skills/web/skills/e2e-testing.md +132 -0
- package/skills/web/skills/frontend-design/SKILL.md +452 -0
- package/skills/web/skills/frontend-design/animation-guide.md +331 -0
- package/skills/web/skills/frontend-design/color-system.md +311 -0
- package/skills/web/skills/frontend-design/decision-trees.md +418 -0
- package/skills/web/skills/frontend-design/motion-graphics.md +306 -0
- package/skills/web/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/skills/web/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/skills/web/skills/frontend-design/typography-system.md +345 -0
- package/skills/web/skills/frontend-design/ux-psychology.md +1116 -0
- package/skills/web/skills/frontend-design/visual-effects.md +383 -0
- package/skills/web/skills/react-nextjs.md +135 -0
- package/skills/web/skills/tailwind-patterns/SKILL.md +269 -0
- package/src/adapters/antigravity.js +164 -0
- package/src/adapters/claude.js +188 -0
- package/src/adapters/cursor.js +161 -0
- package/src/adapters/index.js +67 -0
- package/src/adapters/windsurf.js +158 -0
- package/src/commands/add.js +266 -0
- package/src/commands/create.js +127 -0
- package/src/commands/diff.js +78 -0
- package/src/commands/info.js +88 -0
- package/src/commands/init.js +224 -0
- package/src/commands/install.js +90 -0
- package/src/commands/list.js +54 -0
- package/src/commands/remove.js +101 -0
- package/src/commands/targets.js +32 -0
- package/src/commands/update.js +57 -0
- package/src/core/manifest.js +57 -0
- package/src/core/plugins.js +86 -0
- package/src/core/resolver.js +84 -0
- package/src/core/tracker.js +49 -0
- package/src/utils/fs.js +80 -0
- package/src/utils/git.js +52 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-scan
|
|
3
|
+
description: Scan your Claude Code configuration (.claude/ directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield. Checks CLAUDE.md, settings.json, MCP servers, hooks, and agent definitions.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Security Scan Skill
|
|
8
|
+
|
|
9
|
+
Audit your Claude Code configuration for security issues using [AgentShield](https://github.com/affaan-m/agentshield).
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
- Setting up a new Claude Code project
|
|
14
|
+
- After modifying `.claude/settings.json`, `CLAUDE.md`, or MCP configs
|
|
15
|
+
- Before committing configuration changes
|
|
16
|
+
- When onboarding to a new repository with existing Claude Code configs
|
|
17
|
+
- Periodic security hygiene checks
|
|
18
|
+
|
|
19
|
+
## What It Scans
|
|
20
|
+
|
|
21
|
+
| File | Checks |
|
|
22
|
+
|------|--------|
|
|
23
|
+
| `CLAUDE.md` | Hardcoded secrets, auto-run instructions, prompt injection patterns |
|
|
24
|
+
| `settings.json` | Overly permissive allow lists, missing deny lists, dangerous bypass flags |
|
|
25
|
+
| `mcp.json` | Risky MCP servers, hardcoded env secrets, npx supply chain risks |
|
|
26
|
+
| `hooks/` | Command injection via interpolation, data exfiltration, silent error suppression |
|
|
27
|
+
| `agents/*.md` | Unrestricted tool access, prompt injection surface, missing model specs |
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
AgentShield must be installed. Check and install if needed:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Check if installed
|
|
35
|
+
npx ecc-agentshield --version
|
|
36
|
+
|
|
37
|
+
# Install globally (recommended)
|
|
38
|
+
npm install -g ecc-agentshield
|
|
39
|
+
|
|
40
|
+
# Or run directly via npx (no install needed)
|
|
41
|
+
npx ecc-agentshield scan .
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Basic Scan
|
|
47
|
+
|
|
48
|
+
Run against the current project's `.claude/` directory:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Scan current project
|
|
52
|
+
npx ecc-agentshield scan
|
|
53
|
+
|
|
54
|
+
# Scan a specific path
|
|
55
|
+
npx ecc-agentshield scan --path /path/to/.claude
|
|
56
|
+
|
|
57
|
+
# Scan with minimum severity filter
|
|
58
|
+
npx ecc-agentshield scan --min-severity medium
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Output Formats
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Terminal output (default) — colored report with grade
|
|
65
|
+
npx ecc-agentshield scan
|
|
66
|
+
|
|
67
|
+
# JSON — for CI/CD integration
|
|
68
|
+
npx ecc-agentshield scan --format json
|
|
69
|
+
|
|
70
|
+
# Markdown — for documentation
|
|
71
|
+
npx ecc-agentshield scan --format markdown
|
|
72
|
+
|
|
73
|
+
# HTML — self-contained dark-theme report
|
|
74
|
+
npx ecc-agentshield scan --format html > security-report.html
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Auto-Fix
|
|
78
|
+
|
|
79
|
+
Apply safe fixes automatically (only fixes marked as auto-fixable):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx ecc-agentshield scan --fix
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This will:
|
|
86
|
+
- Replace hardcoded secrets with environment variable references
|
|
87
|
+
- Tighten wildcard permissions to scoped alternatives
|
|
88
|
+
- Never modify manual-only suggestions
|
|
89
|
+
|
|
90
|
+
### Opus 4.6 Deep Analysis
|
|
91
|
+
|
|
92
|
+
Run the adversarial three-agent pipeline for deeper analysis:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Requires ANTHROPIC_API_KEY
|
|
96
|
+
export ANTHROPIC_API_KEY=your-key
|
|
97
|
+
npx ecc-agentshield scan --opus --stream
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This runs:
|
|
101
|
+
1. **Attacker (Red Team)** — finds attack vectors
|
|
102
|
+
2. **Defender (Blue Team)** — recommends hardening
|
|
103
|
+
3. **Auditor (Final Verdict)** — synthesizes both perspectives
|
|
104
|
+
|
|
105
|
+
### Initialize Secure Config
|
|
106
|
+
|
|
107
|
+
Scaffold a new secure `.claude/` configuration from scratch:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx ecc-agentshield init
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Creates:
|
|
114
|
+
- `settings.json` with scoped permissions and deny list
|
|
115
|
+
- `CLAUDE.md` with security best practices
|
|
116
|
+
- `mcp.json` placeholder
|
|
117
|
+
|
|
118
|
+
### GitHub Action
|
|
119
|
+
|
|
120
|
+
Add to your CI pipeline:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
- uses: affaan-m/agentshield@v1
|
|
124
|
+
with:
|
|
125
|
+
path: '.'
|
|
126
|
+
min-severity: 'medium'
|
|
127
|
+
fail-on-findings: true
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Severity Levels
|
|
131
|
+
|
|
132
|
+
| Grade | Score | Meaning |
|
|
133
|
+
|-------|-------|---------|
|
|
134
|
+
| A | 90-100 | Secure configuration |
|
|
135
|
+
| B | 75-89 | Minor issues |
|
|
136
|
+
| C | 60-74 | Needs attention |
|
|
137
|
+
| D | 40-59 | Significant risks |
|
|
138
|
+
| F | 0-39 | Critical vulnerabilities |
|
|
139
|
+
|
|
140
|
+
## Interpreting Results
|
|
141
|
+
|
|
142
|
+
### Critical Findings (fix immediately)
|
|
143
|
+
- Hardcoded API keys or tokens in config files
|
|
144
|
+
- `Bash(*)` in the allow list (unrestricted shell access)
|
|
145
|
+
- Command injection in hooks via `${file}` interpolation
|
|
146
|
+
- Shell-running MCP servers
|
|
147
|
+
|
|
148
|
+
### High Findings (fix before production)
|
|
149
|
+
- Auto-run instructions in CLAUDE.md (prompt injection vector)
|
|
150
|
+
- Missing deny lists in permissions
|
|
151
|
+
- Agents with unnecessary Bash access
|
|
152
|
+
|
|
153
|
+
### Medium Findings (recommended)
|
|
154
|
+
- Silent error suppression in hooks (`2>/dev/null`, `|| true`)
|
|
155
|
+
- Missing PreToolUse security hooks
|
|
156
|
+
- `npx -y` auto-install in MCP server configs
|
|
157
|
+
|
|
158
|
+
### Info Findings (awareness)
|
|
159
|
+
- Missing descriptions on MCP servers
|
|
160
|
+
- Prohibitive instructions correctly flagged as good practice
|
|
161
|
+
|
|
162
|
+
## Links
|
|
163
|
+
|
|
164
|
+
- **GitHub**: [github.com/affaan-m/agentshield](https://github.com/affaan-m/agentshield)
|
|
165
|
+
- **npm**: [npmjs.com/package/ecc-agentshield](https://www.npmjs.com/package/ecc-agentshield)
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vulnerability-scanner
|
|
3
|
+
description: Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Vulnerability Scanner
|
|
8
|
+
|
|
9
|
+
> Think like an attacker, defend like an expert. 2025 threat landscape awareness.
|
|
10
|
+
|
|
11
|
+
## 🔧 Runtime Scripts
|
|
12
|
+
|
|
13
|
+
**Execute for automated validation:**
|
|
14
|
+
|
|
15
|
+
| Script | Purpose | Usage |
|
|
16
|
+
|--------|---------|-------|
|
|
17
|
+
| `scripts/security_scan.py` | Validate security principles applied | `python scripts/security_scan.py <project_path>` |
|
|
18
|
+
|
|
19
|
+
## 📋 Reference Files
|
|
20
|
+
|
|
21
|
+
| File | Purpose |
|
|
22
|
+
|------|---------|
|
|
23
|
+
| [checklists.md](checklists.md) | OWASP Top 10, Auth, API, Data protection checklists |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. Security Expert Mindset
|
|
28
|
+
|
|
29
|
+
### Core Principles
|
|
30
|
+
|
|
31
|
+
| Principle | Application |
|
|
32
|
+
|-----------|-------------|
|
|
33
|
+
| **Assume Breach** | Design as if attacker already inside |
|
|
34
|
+
| **Zero Trust** | Never trust, always verify |
|
|
35
|
+
| **Defense in Depth** | Multiple layers, no single point |
|
|
36
|
+
| **Least Privilege** | Minimum required access only |
|
|
37
|
+
| **Fail Secure** | On error, deny access |
|
|
38
|
+
|
|
39
|
+
### Threat Modeling Questions
|
|
40
|
+
|
|
41
|
+
Before scanning, ask:
|
|
42
|
+
1. What are we protecting? (Assets)
|
|
43
|
+
2. Who would attack? (Threat actors)
|
|
44
|
+
3. How would they attack? (Attack vectors)
|
|
45
|
+
4. What's the impact? (Business risk)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. OWASP Top 10:2025
|
|
50
|
+
|
|
51
|
+
### Risk Categories
|
|
52
|
+
|
|
53
|
+
| Rank | Category | Think About |
|
|
54
|
+
|------|----------|-------------|
|
|
55
|
+
| **A01** | Broken Access Control | Who can access what? IDOR, SSRF |
|
|
56
|
+
| **A02** | Security Misconfiguration | Defaults, headers, exposed services |
|
|
57
|
+
| **A03** | Software Supply Chain 🆕 | Dependencies, CI/CD, build integrity |
|
|
58
|
+
| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |
|
|
59
|
+
| **A05** | Injection | User input → system commands |
|
|
60
|
+
| **A06** | Insecure Design | Flawed architecture |
|
|
61
|
+
| **A07** | Authentication Failures | Session, credential management |
|
|
62
|
+
| **A08** | Integrity Failures | Unsigned updates, tampered data |
|
|
63
|
+
| **A09** | Logging & Alerting | Blind spots, no monitoring |
|
|
64
|
+
| **A10** | Exceptional Conditions 🆕 | Error handling, fail-open states |
|
|
65
|
+
|
|
66
|
+
### 2025 Key Changes
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
2021 → 2025 Shifts:
|
|
70
|
+
├── SSRF merged into A01 (Access Control)
|
|
71
|
+
├── A02 elevated (Cloud/Container configs)
|
|
72
|
+
├── A03 NEW: Supply Chain (major focus)
|
|
73
|
+
├── A10 NEW: Exceptional Conditions
|
|
74
|
+
└── Focus shift: Root causes > Symptoms
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 3. Supply Chain Security (A03)
|
|
80
|
+
|
|
81
|
+
### Attack Surface
|
|
82
|
+
|
|
83
|
+
| Vector | Risk | Question to Ask |
|
|
84
|
+
|--------|------|-----------------|
|
|
85
|
+
| **Dependencies** | Malicious packages | Do we audit new deps? |
|
|
86
|
+
| **Lock files** | Integrity attacks | Are they committed? |
|
|
87
|
+
| **Build pipeline** | CI/CD compromise | Who can modify? |
|
|
88
|
+
| **Registry** | Typosquatting | Verified sources? |
|
|
89
|
+
|
|
90
|
+
### Defense Principles
|
|
91
|
+
|
|
92
|
+
- Verify package integrity (checksums)
|
|
93
|
+
- Pin versions, audit updates
|
|
94
|
+
- Use private registries for critical deps
|
|
95
|
+
- Sign and verify artifacts
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 4. Attack Surface Mapping
|
|
100
|
+
|
|
101
|
+
### What to Map
|
|
102
|
+
|
|
103
|
+
| Category | Elements |
|
|
104
|
+
|----------|----------|
|
|
105
|
+
| **Entry Points** | APIs, forms, file uploads |
|
|
106
|
+
| **Data Flows** | Input → Process → Output |
|
|
107
|
+
| **Trust Boundaries** | Where auth/authz checked |
|
|
108
|
+
| **Assets** | Secrets, PII, business data |
|
|
109
|
+
|
|
110
|
+
### Prioritization Matrix
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
Risk = Likelihood × Impact
|
|
114
|
+
|
|
115
|
+
High Impact + High Likelihood → CRITICAL
|
|
116
|
+
High Impact + Low Likelihood → HIGH
|
|
117
|
+
Low Impact + High Likelihood → MEDIUM
|
|
118
|
+
Low Impact + Low Likelihood → LOW
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 5. Risk Prioritization
|
|
124
|
+
|
|
125
|
+
### CVSS + Context
|
|
126
|
+
|
|
127
|
+
| Factor | Weight | Question |
|
|
128
|
+
|--------|--------|----------|
|
|
129
|
+
| **CVSS Score** | Base severity | How severe is the vuln? |
|
|
130
|
+
| **EPSS Score** | Exploit likelihood | Is it being exploited? |
|
|
131
|
+
| **Asset Value** | Business context | What's at risk? |
|
|
132
|
+
| **Exposure** | Attack surface | Internet-facing? |
|
|
133
|
+
|
|
134
|
+
### Prioritization Decision Tree
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Is it actively exploited (EPSS >0.5)?
|
|
138
|
+
├── YES → CRITICAL: Immediate action
|
|
139
|
+
└── NO → Check CVSS
|
|
140
|
+
├── CVSS ≥9.0 → HIGH
|
|
141
|
+
├── CVSS 7.0-8.9 → Consider asset value
|
|
142
|
+
└── CVSS <7.0 → Schedule for later
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 6. Exceptional Conditions (A10 - New)
|
|
148
|
+
|
|
149
|
+
### Fail-Open vs Fail-Closed
|
|
150
|
+
|
|
151
|
+
| Scenario | Fail-Open (BAD) | Fail-Closed (GOOD) |
|
|
152
|
+
|----------|-----------------|---------------------|
|
|
153
|
+
| Auth error | Allow access | Deny access |
|
|
154
|
+
| Parsing fails | Accept input | Reject input |
|
|
155
|
+
| Timeout | Retry forever | Limit + abort |
|
|
156
|
+
|
|
157
|
+
### What to Check
|
|
158
|
+
|
|
159
|
+
- Exception handlers that catch-all and ignore
|
|
160
|
+
- Missing error handling on security operations
|
|
161
|
+
- Race conditions in auth/authz
|
|
162
|
+
- Resource exhaustion scenarios
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 7. Scanning Methodology
|
|
167
|
+
|
|
168
|
+
### Phase-Based Approach
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
1. RECONNAISSANCE
|
|
172
|
+
└── Understand the target
|
|
173
|
+
├── Technology stack
|
|
174
|
+
├── Entry points
|
|
175
|
+
└── Data flows
|
|
176
|
+
|
|
177
|
+
2. DISCOVERY
|
|
178
|
+
└── Identify potential issues
|
|
179
|
+
├── Configuration review
|
|
180
|
+
├── Dependency analysis
|
|
181
|
+
└── Code pattern search
|
|
182
|
+
|
|
183
|
+
3. ANALYSIS
|
|
184
|
+
└── Validate and prioritize
|
|
185
|
+
├── False positive elimination
|
|
186
|
+
├── Risk scoring
|
|
187
|
+
└── Attack chain mapping
|
|
188
|
+
|
|
189
|
+
4. REPORTING
|
|
190
|
+
└── Actionable findings
|
|
191
|
+
├── Clear reproduction steps
|
|
192
|
+
├── Business impact
|
|
193
|
+
└── Remediation guidance
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 8. Code Pattern Analysis
|
|
199
|
+
|
|
200
|
+
### High-Risk Patterns
|
|
201
|
+
|
|
202
|
+
| Pattern | Risk | Look For |
|
|
203
|
+
|---------|------|----------|
|
|
204
|
+
| **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |
|
|
205
|
+
| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |
|
|
206
|
+
| **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |
|
|
207
|
+
| **Path manipulation** | Traversal | User input in file paths |
|
|
208
|
+
| **Disabled security** | Various | `verify=False`, `--insecure` |
|
|
209
|
+
|
|
210
|
+
### Secret Patterns
|
|
211
|
+
|
|
212
|
+
| Type | Indicators |
|
|
213
|
+
|------|-----------|
|
|
214
|
+
| API Keys | `api_key`, `apikey`, high entropy |
|
|
215
|
+
| Tokens | `token`, `bearer`, `jwt` |
|
|
216
|
+
| Credentials | `password`, `secret`, `key` |
|
|
217
|
+
| Cloud | `AWS_`, `AZURE_`, `GCP_` prefixes |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 9. Cloud Security Considerations
|
|
222
|
+
|
|
223
|
+
### Shared Responsibility
|
|
224
|
+
|
|
225
|
+
| Layer | You Own | Provider Owns |
|
|
226
|
+
|-------|---------|---------------|
|
|
227
|
+
| Data | ✅ | ❌ |
|
|
228
|
+
| Application | ✅ | ❌ |
|
|
229
|
+
| OS/Runtime | Depends | Depends |
|
|
230
|
+
| Infrastructure | ❌ | ✅ |
|
|
231
|
+
|
|
232
|
+
### Cloud-Specific Checks
|
|
233
|
+
|
|
234
|
+
- IAM: Least privilege applied?
|
|
235
|
+
- Storage: Public buckets?
|
|
236
|
+
- Network: Security groups tightened?
|
|
237
|
+
- Secrets: Using secrets manager?
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 10. Anti-Patterns
|
|
242
|
+
|
|
243
|
+
| ❌ Don't | ✅ Do |
|
|
244
|
+
|----------|-------|
|
|
245
|
+
| Scan without understanding | Map attack surface first |
|
|
246
|
+
| Alert on every CVE | Prioritize by exploitability + asset |
|
|
247
|
+
| Ignore false positives | Maintain verified baseline |
|
|
248
|
+
| Fix symptoms only | Address root causes |
|
|
249
|
+
| Scan once before deploy | Continuous scanning |
|
|
250
|
+
| Trust third-party deps blindly | Verify integrity, audit code |
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## 11. Reporting Principles
|
|
255
|
+
|
|
256
|
+
### Finding Structure
|
|
257
|
+
|
|
258
|
+
Each finding should answer:
|
|
259
|
+
1. **What?** - Clear vulnerability description
|
|
260
|
+
2. **Where?** - Exact location (file, line, endpoint)
|
|
261
|
+
3. **Why?** - Root cause explanation
|
|
262
|
+
4. **Impact?** - Business consequence
|
|
263
|
+
5. **How to fix?** - Specific remediation
|
|
264
|
+
|
|
265
|
+
### Severity Classification
|
|
266
|
+
|
|
267
|
+
| Severity | Criteria |
|
|
268
|
+
|----------|----------|
|
|
269
|
+
| **Critical** | RCE, auth bypass, mass data exposure |
|
|
270
|
+
| **High** | Data exposure, privilege escalation |
|
|
271
|
+
| **Medium** | Limited scope, requires conditions |
|
|
272
|
+
| **Low** | Informational, best practice |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
> **Remember:** Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Security Checklists
|
|
2
|
+
|
|
3
|
+
> Quick reference checklists for security audits. Use alongside vulnerability-scanner principles.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## OWASP Top 10 Audit Checklist
|
|
8
|
+
|
|
9
|
+
### A01: Broken Access Control
|
|
10
|
+
- [ ] Authorization on all protected routes
|
|
11
|
+
- [ ] Deny by default
|
|
12
|
+
- [ ] Rate limiting implemented
|
|
13
|
+
- [ ] CORS properly configured
|
|
14
|
+
|
|
15
|
+
### A02: Cryptographic Failures
|
|
16
|
+
- [ ] Passwords hashed (bcrypt/argon2, cost 12+)
|
|
17
|
+
- [ ] Sensitive data encrypted at rest
|
|
18
|
+
- [ ] TLS 1.2+ for all connections
|
|
19
|
+
- [ ] No secrets in code/logs
|
|
20
|
+
|
|
21
|
+
### A03: Injection
|
|
22
|
+
- [ ] Parameterized queries
|
|
23
|
+
- [ ] Input validation on all user data
|
|
24
|
+
- [ ] Output encoding for XSS
|
|
25
|
+
- [ ] No eval() or dynamic code execution
|
|
26
|
+
|
|
27
|
+
### A04: Insecure Design
|
|
28
|
+
- [ ] Threat modeling done
|
|
29
|
+
- [ ] Security requirements defined
|
|
30
|
+
- [ ] Business logic validated
|
|
31
|
+
|
|
32
|
+
### A05: Security Misconfiguration
|
|
33
|
+
- [ ] Unnecessary features disabled
|
|
34
|
+
- [ ] Error messages sanitized
|
|
35
|
+
- [ ] Security headers configured
|
|
36
|
+
- [ ] Default credentials changed
|
|
37
|
+
|
|
38
|
+
### A06: Vulnerable Components
|
|
39
|
+
- [ ] Dependencies up to date
|
|
40
|
+
- [ ] No known vulnerabilities
|
|
41
|
+
- [ ] Unused dependencies removed
|
|
42
|
+
|
|
43
|
+
### A07: Authentication Failures
|
|
44
|
+
- [ ] MFA available
|
|
45
|
+
- [ ] Session invalidation on logout
|
|
46
|
+
- [ ] Session timeout implemented
|
|
47
|
+
- [ ] Brute force protection
|
|
48
|
+
|
|
49
|
+
### A08: Integrity Failures
|
|
50
|
+
- [ ] Dependency integrity verified
|
|
51
|
+
- [ ] CI/CD pipeline secured
|
|
52
|
+
- [ ] Update mechanism secured
|
|
53
|
+
|
|
54
|
+
### A09: Logging Failures
|
|
55
|
+
- [ ] Security events logged
|
|
56
|
+
- [ ] Logs protected
|
|
57
|
+
- [ ] No sensitive data in logs
|
|
58
|
+
- [ ] Alerting configured
|
|
59
|
+
|
|
60
|
+
### A10: SSRF
|
|
61
|
+
- [ ] URL validation implemented
|
|
62
|
+
- [ ] Allow-list for external calls
|
|
63
|
+
- [ ] Network segmentation
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Authentication Checklist
|
|
68
|
+
|
|
69
|
+
- [ ] Strong password policy
|
|
70
|
+
- [ ] Account lockout
|
|
71
|
+
- [ ] Secure password reset
|
|
72
|
+
- [ ] Session management
|
|
73
|
+
- [ ] Token expiration
|
|
74
|
+
- [ ] Logout invalidation
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## API Security Checklist
|
|
79
|
+
|
|
80
|
+
- [ ] Authentication required
|
|
81
|
+
- [ ] Authorization per endpoint
|
|
82
|
+
- [ ] Input validation
|
|
83
|
+
- [ ] Rate limiting
|
|
84
|
+
- [ ] Output sanitization
|
|
85
|
+
- [ ] Error handling
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Data Protection Checklist
|
|
90
|
+
|
|
91
|
+
- [ ] Encryption at rest
|
|
92
|
+
- [ ] Encryption in transit
|
|
93
|
+
- [ ] Key management
|
|
94
|
+
- [ ] Data minimization
|
|
95
|
+
- [ ] Secure deletion
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Security Headers
|
|
100
|
+
|
|
101
|
+
| Header | Purpose |
|
|
102
|
+
|--------|---------|
|
|
103
|
+
| **Content-Security-Policy** | XSS prevention |
|
|
104
|
+
| **X-Content-Type-Options** | MIME sniffing |
|
|
105
|
+
| **X-Frame-Options** | Clickjacking |
|
|
106
|
+
| **Strict-Transport-Security** | Force HTTPS |
|
|
107
|
+
| **Referrer-Policy** | Referrer control |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Quick Audit Commands
|
|
112
|
+
|
|
113
|
+
| Check | What to Look For |
|
|
114
|
+
|-------|------------------|
|
|
115
|
+
| Secrets in code | password, api_key, secret |
|
|
116
|
+
| Dangerous patterns | eval, innerHTML, SQL concat |
|
|
117
|
+
| Dependency issues | npm audit, snyk |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
> **Usage:** Copy relevant checklists into your PLAN.md or security report.
|