agcel 1.0.1
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/.agent/workflows/api-gen.md +59 -0
- package/.agent/workflows/architect.md +44 -0
- package/.agent/workflows/brainstorm.md +223 -0
- package/.agent/workflows/build.md +38 -0
- package/.agent/workflows/changelog.md +51 -0
- package/.agent/workflows/checkpoint.md +138 -0
- package/.agent/workflows/commit.md +223 -0
- package/.agent/workflows/debug.md +57 -0
- package/.agent/workflows/deploy.md +76 -0
- package/.agent/workflows/doc.md +247 -0
- package/.agent/workflows/execute-plan.md +225 -0
- package/.agent/workflows/feature.md +255 -0
- package/.agent/workflows/fix.md +323 -0
- package/.agent/workflows/help.md +63 -0
- package/.agent/workflows/index.md +148 -0
- package/.agent/workflows/load.md +112 -0
- package/.agent/workflows/mode.md +170 -0
- package/.agent/workflows/optimize.md +53 -0
- package/.agent/workflows/plan.md +337 -0
- package/.agent/workflows/pr.md +74 -0
- package/.agent/workflows/product-plan.md +36 -0
- package/.agent/workflows/production-deploy.md +39 -0
- package/.agent/workflows/refactor.md +63 -0
- package/.agent/workflows/research.md +116 -0
- package/.agent/workflows/review.md +344 -0
- package/.agent/workflows/security-scan.md +56 -0
- package/.agent/workflows/ship.md +221 -0
- package/.agent/workflows/spawn.md +177 -0
- package/.agent/workflows/status.md +59 -0
- package/.agent/workflows/tdd.md +139 -0
- package/.agent/workflows/test.md +340 -0
- package/.agent/workflows/verify.md +35 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/commands/init.js +142 -0
- package/dist/commands/install.js +98 -0
- package/dist/commands/list.js +49 -0
- package/dist/commands/restart.js +17 -0
- package/dist/commands/start.js +41 -0
- package/dist/commands/status.js +24 -0
- package/dist/commands/stop.js +29 -0
- package/dist/commands/uninstall.js +78 -0
- package/dist/index.js +58 -0
- package/dist/server/index.js +174 -0
- package/dist/utils/index.js +63 -0
- package/package.json +54 -0
- package/skills/api-security-best-practices/SKILL.md +291 -0
- package/skills/api-security-best-practices/references/examples.md +617 -0
- package/skills/architecture/SKILL.md +59 -0
- package/skills/architecture/context-discovery.md +43 -0
- package/skills/architecture/examples.md +94 -0
- package/skills/architecture/pattern-selection.md +68 -0
- package/skills/architecture/patterns-reference.md +50 -0
- package/skills/architecture/trade-off-analysis.md +77 -0
- package/skills/aws-serverless/SKILL.md +327 -0
- package/skills/brainstorming/SKILL.md +234 -0
- package/skills/c4-context/SKILL.md +154 -0
- package/skills/ci-cd-engineer/SKILL.md +50 -0
- package/skills/code-auditing/SKILL.md +55 -0
- package/skills/copywriting/SKILL.md +248 -0
- package/skills/database-engineer/SKILL.md +47 -0
- package/skills/doc-coauthoring/SKILL.md +379 -0
- package/skills/docker-expert/SKILL.md +412 -0
- package/skills/langgraph/SKILL.md +291 -0
- package/skills/postgresql/SKILL.md +73 -0
- package/skills/pricing-strategy/SKILL.md +360 -0
- package/skills/product-manager/SKILL.md +57 -0
- package/skills/prompt-engineer/README.md +659 -0
- package/skills/prompt-engineer/SKILL.md +256 -0
- package/skills/python-patterns/SKILL.md +445 -0
- package/skills/qa-engineer/SKILL.md +42 -0
- package/skills/rag-engineer/SKILL.md +94 -0
- package/skills/react-patterns/SKILL.md +202 -0
- package/skills/secure-refactoring/SKILL.md +54 -0
- package/skills/security-documentation/SKILL.md +53 -0
- package/skills/senior-architect/SKILL.md +213 -0
- package/skills/senior-architect/references/architecture_patterns.md +103 -0
- package/skills/senior-architect/references/system_design_workflows.md +103 -0
- package/skills/senior-architect/references/tech_decision_guide.md +103 -0
- package/skills/senior-architect/scripts/architecture_diagram_generator.py +114 -0
- package/skills/senior-architect/scripts/dependency_analyzer.py +114 -0
- package/skills/senior-architect/scripts/project_architect.py +114 -0
- package/skills/seo-audit/SKILL.md +491 -0
- package/skills/sql-injection-testing/SKILL.md +452 -0
- package/skills/test-driven-development/SKILL.md +375 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +123 -0
- package/skills/testing-patterns/SKILL.md +263 -0
- package/skills/typescript-expert/SKILL.md +202 -0
- package/skills/typescript-expert/references/advanced-topics.md +252 -0
- package/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/skills/typescript-expert/references/utility-types.ts +335 -0
- package/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/skills/ui-ux-designer/SKILL.md +46 -0
- package/skills/vercel-deployment/SKILL.md +83 -0
- package/skills/vulnerability-scanner/SKILL.md +280 -0
- package/skills/vulnerability-scanner/checklists.md +121 -0
- package/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/skills/writing-plans/SKILL.md +120 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
TypeScript Project Diagnostic Script
|
|
4
|
+
Analyzes TypeScript projects for configuration, performance, and common issues.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
import os
|
|
10
|
+
import json
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
def run_cmd(cmd: str) -> str:
|
|
14
|
+
"""Run shell command and return output."""
|
|
15
|
+
try:
|
|
16
|
+
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
|
17
|
+
return result.stdout + result.stderr
|
|
18
|
+
except Exception as e:
|
|
19
|
+
return str(e)
|
|
20
|
+
|
|
21
|
+
def check_versions():
|
|
22
|
+
"""Check TypeScript and Node versions."""
|
|
23
|
+
print("\n📦 Versions:")
|
|
24
|
+
print("-" * 40)
|
|
25
|
+
|
|
26
|
+
ts_version = run_cmd("npx tsc --version 2>/dev/null").strip()
|
|
27
|
+
node_version = run_cmd("node -v 2>/dev/null").strip()
|
|
28
|
+
|
|
29
|
+
print(f" TypeScript: {ts_version or 'Not found'}")
|
|
30
|
+
print(f" Node.js: {node_version or 'Not found'}")
|
|
31
|
+
|
|
32
|
+
def check_tsconfig():
|
|
33
|
+
"""Analyze tsconfig.json settings."""
|
|
34
|
+
print("\n⚙️ TSConfig Analysis:")
|
|
35
|
+
print("-" * 40)
|
|
36
|
+
|
|
37
|
+
tsconfig_path = Path("tsconfig.json")
|
|
38
|
+
if not tsconfig_path.exists():
|
|
39
|
+
print("⚠️ tsconfig.json not found")
|
|
40
|
+
return
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
with open(tsconfig_path) as f:
|
|
44
|
+
config = json.load(f)
|
|
45
|
+
|
|
46
|
+
compiler_opts = config.get("compilerOptions", {})
|
|
47
|
+
|
|
48
|
+
# Check strict mode
|
|
49
|
+
if compiler_opts.get("strict"):
|
|
50
|
+
print("✅ Strict mode enabled")
|
|
51
|
+
else:
|
|
52
|
+
print("⚠️ Strict mode NOT enabled")
|
|
53
|
+
|
|
54
|
+
# Check important flags
|
|
55
|
+
flags = {
|
|
56
|
+
"noUncheckedIndexedAccess": "Unchecked index access protection",
|
|
57
|
+
"noImplicitOverride": "Implicit override protection",
|
|
58
|
+
"skipLibCheck": "Skip lib check (performance)",
|
|
59
|
+
"incremental": "Incremental compilation"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
for flag, desc in flags.items():
|
|
63
|
+
status = "✅" if compiler_opts.get(flag) else "⚪"
|
|
64
|
+
print(f" {status} {desc}: {compiler_opts.get(flag, 'not set')}")
|
|
65
|
+
|
|
66
|
+
# Check module settings
|
|
67
|
+
print(f"\n Module: {compiler_opts.get('module', 'not set')}")
|
|
68
|
+
print(f" Module Resolution: {compiler_opts.get('moduleResolution', 'not set')}")
|
|
69
|
+
print(f" Target: {compiler_opts.get('target', 'not set')}")
|
|
70
|
+
|
|
71
|
+
except json.JSONDecodeError:
|
|
72
|
+
print("❌ Invalid JSON in tsconfig.json")
|
|
73
|
+
|
|
74
|
+
def check_tooling():
|
|
75
|
+
"""Detect TypeScript tooling ecosystem."""
|
|
76
|
+
print("\n🛠️ Tooling Detection:")
|
|
77
|
+
print("-" * 40)
|
|
78
|
+
|
|
79
|
+
pkg_path = Path("package.json")
|
|
80
|
+
if not pkg_path.exists():
|
|
81
|
+
print("⚠️ package.json not found")
|
|
82
|
+
return
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
with open(pkg_path) as f:
|
|
86
|
+
pkg = json.load(f)
|
|
87
|
+
|
|
88
|
+
all_deps = {**pkg.get("dependencies", {}), **pkg.get("devDependencies", {})}
|
|
89
|
+
|
|
90
|
+
tools = {
|
|
91
|
+
"biome": "Biome (linter/formatter)",
|
|
92
|
+
"eslint": "ESLint",
|
|
93
|
+
"prettier": "Prettier",
|
|
94
|
+
"vitest": "Vitest (testing)",
|
|
95
|
+
"jest": "Jest (testing)",
|
|
96
|
+
"turborepo": "Turborepo (monorepo)",
|
|
97
|
+
"turbo": "Turbo (monorepo)",
|
|
98
|
+
"nx": "Nx (monorepo)",
|
|
99
|
+
"lerna": "Lerna (monorepo)"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
for tool, desc in tools.items():
|
|
103
|
+
for dep in all_deps:
|
|
104
|
+
if tool in dep.lower():
|
|
105
|
+
print(f" ✅ {desc}")
|
|
106
|
+
break
|
|
107
|
+
|
|
108
|
+
except json.JSONDecodeError:
|
|
109
|
+
print("❌ Invalid JSON in package.json")
|
|
110
|
+
|
|
111
|
+
def check_monorepo():
|
|
112
|
+
"""Check for monorepo configuration."""
|
|
113
|
+
print("\n📦 Monorepo Check:")
|
|
114
|
+
print("-" * 40)
|
|
115
|
+
|
|
116
|
+
indicators = [
|
|
117
|
+
("pnpm-workspace.yaml", "PNPM Workspace"),
|
|
118
|
+
("lerna.json", "Lerna"),
|
|
119
|
+
("nx.json", "Nx"),
|
|
120
|
+
("turbo.json", "Turborepo")
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
found = False
|
|
124
|
+
for file, name in indicators:
|
|
125
|
+
if Path(file).exists():
|
|
126
|
+
print(f" ✅ {name} detected")
|
|
127
|
+
found = True
|
|
128
|
+
|
|
129
|
+
if not found:
|
|
130
|
+
print(" ⚪ No monorepo configuration detected")
|
|
131
|
+
|
|
132
|
+
def check_type_errors():
|
|
133
|
+
"""Run quick type check."""
|
|
134
|
+
print("\n🔍 Type Check:")
|
|
135
|
+
print("-" * 40)
|
|
136
|
+
|
|
137
|
+
result = run_cmd("npx tsc --noEmit 2>&1 | head -20")
|
|
138
|
+
if "error TS" in result:
|
|
139
|
+
errors = result.count("error TS")
|
|
140
|
+
print(f" ❌ {errors}+ type errors found")
|
|
141
|
+
print(result[:500])
|
|
142
|
+
else:
|
|
143
|
+
print(" ✅ No type errors")
|
|
144
|
+
|
|
145
|
+
def check_any_usage():
|
|
146
|
+
"""Check for any type usage."""
|
|
147
|
+
print("\n⚠️ 'any' Type Usage:")
|
|
148
|
+
print("-" * 40)
|
|
149
|
+
|
|
150
|
+
result = run_cmd("grep -r ': any' --include='*.ts' --include='*.tsx' src/ 2>/dev/null | wc -l")
|
|
151
|
+
count = result.strip()
|
|
152
|
+
if count and count != "0":
|
|
153
|
+
print(f" ⚠️ Found {count} occurrences of ': any'")
|
|
154
|
+
sample = run_cmd("grep -rn ': any' --include='*.ts' --include='*.tsx' src/ 2>/dev/null | head -5")
|
|
155
|
+
if sample:
|
|
156
|
+
print(sample)
|
|
157
|
+
else:
|
|
158
|
+
print(" ✅ No explicit 'any' types found")
|
|
159
|
+
|
|
160
|
+
def check_type_assertions():
|
|
161
|
+
"""Check for type assertions."""
|
|
162
|
+
print("\n⚠️ Type Assertions (as):")
|
|
163
|
+
print("-" * 40)
|
|
164
|
+
|
|
165
|
+
result = run_cmd("grep -r ' as ' --include='*.ts' --include='*.tsx' src/ 2>/dev/null | grep -v 'import' | wc -l")
|
|
166
|
+
count = result.strip()
|
|
167
|
+
if count and count != "0":
|
|
168
|
+
print(f" ⚠️ Found {count} type assertions")
|
|
169
|
+
else:
|
|
170
|
+
print(" ✅ No type assertions found")
|
|
171
|
+
|
|
172
|
+
def check_performance():
|
|
173
|
+
"""Check type checking performance."""
|
|
174
|
+
print("\n⏱️ Type Check Performance:")
|
|
175
|
+
print("-" * 40)
|
|
176
|
+
|
|
177
|
+
result = run_cmd("npx tsc --extendedDiagnostics --noEmit 2>&1 | grep -E 'Check time|Files:|Lines:|Nodes:'")
|
|
178
|
+
if result.strip():
|
|
179
|
+
for line in result.strip().split('\n'):
|
|
180
|
+
print(f" {line}")
|
|
181
|
+
else:
|
|
182
|
+
print(" ⚠️ Could not measure performance")
|
|
183
|
+
|
|
184
|
+
def main():
|
|
185
|
+
print("=" * 50)
|
|
186
|
+
print("🔍 TypeScript Project Diagnostic Report")
|
|
187
|
+
print("=" * 50)
|
|
188
|
+
|
|
189
|
+
check_versions()
|
|
190
|
+
check_tsconfig()
|
|
191
|
+
check_tooling()
|
|
192
|
+
check_monorepo()
|
|
193
|
+
check_any_usage()
|
|
194
|
+
check_type_assertions()
|
|
195
|
+
check_type_errors()
|
|
196
|
+
check_performance()
|
|
197
|
+
|
|
198
|
+
print("\n" + "=" * 50)
|
|
199
|
+
print("✅ Diagnostic Complete")
|
|
200
|
+
print("=" * 50)
|
|
201
|
+
|
|
202
|
+
if __name__ == "__main__":
|
|
203
|
+
main()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-ux-designer
|
|
3
|
+
description: Create user flows, wireframes, and high-fidelity designs with a focus on usability and aesthetics
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UI/UX Designer
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Your role is to ensure the product is intuitive, accessible, and visually appealing. You translate requirements into visual and interactive designs.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
- Designing new screens or components
|
|
15
|
+
- improving user flow and navigation
|
|
16
|
+
- Establishing a design system (colors, typography, spacing)
|
|
17
|
+
- Conducting accessibility audits (WCAG)
|
|
18
|
+
|
|
19
|
+
## Core Responsibilities
|
|
20
|
+
|
|
21
|
+
1. **User Flow Mapping**: Diagramming how a user moves through the application.
|
|
22
|
+
2. **Wireframing**: Low-fidelity layout sketches.
|
|
23
|
+
3. **Visual Design**: Selecting colors, fonts, and styling consistent with brand.
|
|
24
|
+
4. **Component Design**: Defining states (hover, active, disabled) for UI elements.
|
|
25
|
+
|
|
26
|
+
## Design Checklist
|
|
27
|
+
|
|
28
|
+
### Usability
|
|
29
|
+
- [ ] Navigation is consistent and predictable.
|
|
30
|
+
- [ ] Primary actions are prominent.
|
|
31
|
+
- [ ] Feedback is provided for all user interactions (e.g., loading states).
|
|
32
|
+
|
|
33
|
+
### Accessibility
|
|
34
|
+
- [ ] Color contrast meets WCAG AA standards.
|
|
35
|
+
- [ ] Interactive elements have a minimum touch target (e.g., 44x44px).
|
|
36
|
+
- [ ] Images have alt text.
|
|
37
|
+
- [ ] Keyboard navigation is supported.
|
|
38
|
+
|
|
39
|
+
### Aesthetics
|
|
40
|
+
- [ ] Consistent use of whitespace.
|
|
41
|
+
- [ ] Visual hierarchy guides the eye.
|
|
42
|
+
- [ ] Typography is legible and scalable.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Gap Analysis Rule
|
|
46
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-deployment
|
|
3
|
+
description: "Expert knowledge for deploying to Vercel with Next.js Use when: vercel, deploy, deployment, hosting, production."
|
|
4
|
+
source: vibeship-spawner-skills (Apache 2.0)
|
|
5
|
+
risk: safe
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Vercel Deployment
|
|
9
|
+
|
|
10
|
+
You are a Vercel deployment expert. You understand the platform's
|
|
11
|
+
capabilities, limitations, and best practices for deploying Next.js
|
|
12
|
+
applications at scale.
|
|
13
|
+
|
|
14
|
+
## When to Use This Skill
|
|
15
|
+
|
|
16
|
+
Use this skill when:
|
|
17
|
+
- Deploying to Vercel
|
|
18
|
+
- Working with Vercel deployment
|
|
19
|
+
- Hosting applications on Vercel
|
|
20
|
+
- Deploying to production on Vercel
|
|
21
|
+
- Configuring Vercel for Next.js applications
|
|
22
|
+
|
|
23
|
+
Your core principles:
|
|
24
|
+
1. Environment variables - different for dev/preview/production
|
|
25
|
+
2. Edge vs Serverless - choose the right runtime
|
|
26
|
+
3. Build optimization - minimize cold starts and bundle size
|
|
27
|
+
4. Preview deployments - use for testing before production
|
|
28
|
+
5. Monitoring - set up analytics and error tracking
|
|
29
|
+
|
|
30
|
+
## Capabilities
|
|
31
|
+
|
|
32
|
+
- vercel
|
|
33
|
+
- deployment
|
|
34
|
+
- edge-functions
|
|
35
|
+
- serverless
|
|
36
|
+
- environment-variables
|
|
37
|
+
|
|
38
|
+
## Requirements
|
|
39
|
+
|
|
40
|
+
- nextjs-app-router
|
|
41
|
+
|
|
42
|
+
## Patterns
|
|
43
|
+
|
|
44
|
+
### Environment Variables Setup
|
|
45
|
+
|
|
46
|
+
Properly configure environment variables for all environments
|
|
47
|
+
|
|
48
|
+
### Edge vs Serverless Functions
|
|
49
|
+
|
|
50
|
+
Choose the right runtime for your API routes
|
|
51
|
+
|
|
52
|
+
### Build Optimization
|
|
53
|
+
|
|
54
|
+
Optimize build for faster deployments and smaller bundles
|
|
55
|
+
|
|
56
|
+
## Anti-Patterns
|
|
57
|
+
|
|
58
|
+
### ❌ Secrets in NEXT_PUBLIC_
|
|
59
|
+
|
|
60
|
+
### ❌ Same Database for Preview
|
|
61
|
+
|
|
62
|
+
### ❌ No Build Cache
|
|
63
|
+
|
|
64
|
+
## ⚠️ Sharp Edges
|
|
65
|
+
|
|
66
|
+
| Issue | Severity | Solution |
|
|
67
|
+
|-------|----------|----------|
|
|
68
|
+
| NEXT_PUBLIC_ exposes secrets to the browser | critical | Only use NEXT_PUBLIC_ for truly public values: |
|
|
69
|
+
| Preview deployments using production database | high | Set up separate databases for each environment: |
|
|
70
|
+
| Serverless function too large, slow cold starts | high | Reduce function size: |
|
|
71
|
+
| Edge runtime missing Node.js APIs | high | Check API compatibility before using edge: |
|
|
72
|
+
| Function timeout causes incomplete operations | medium | Handle long operations properly: |
|
|
73
|
+
| Environment variable missing at runtime but present at build | medium | Understand when env vars are read: |
|
|
74
|
+
| CORS errors calling API routes from different domain | medium | Add CORS headers to API routes: |
|
|
75
|
+
| Page shows stale data after deployment | medium | Control caching behavior: |
|
|
76
|
+
|
|
77
|
+
## Related Skills
|
|
78
|
+
|
|
79
|
+
Works well with: `nextjs-app-router`, `supabase-backend`
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Gap Analysis Rule
|
|
83
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|
|
@@ -0,0 +1,280 @@
|
|
|
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?"
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
## Gap Analysis Rule
|
|
280
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|