@iamnishankhan/opencode-kit-grok 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.
Files changed (198) hide show
  1. package/bin/cli.js +46 -0
  2. package/kit/.opencode/AGENTS.md +392 -0
  3. package/kit/.opencode/README.md +71 -0
  4. package/kit/.opencode/USAGE.md +405 -0
  5. package/kit/.opencode/agents/backend-specialist.md +278 -0
  6. package/kit/.opencode/agents/code-archaeologist.md +114 -0
  7. package/kit/.opencode/agents/database-architect.md +233 -0
  8. package/kit/.opencode/agents/debugger.md +234 -0
  9. package/kit/.opencode/agents/devops-engineer.md +252 -0
  10. package/kit/.opencode/agents/documentation-writer.md +111 -0
  11. package/kit/.opencode/agents/explorer-agent.md +83 -0
  12. package/kit/.opencode/agents/frontend-specialist.md +606 -0
  13. package/kit/.opencode/agents/game-developer.md +169 -0
  14. package/kit/.opencode/agents/mobile-developer.md +385 -0
  15. package/kit/.opencode/agents/orchestrator.md +213 -0
  16. package/kit/.opencode/agents/penetration-tester.md +197 -0
  17. package/kit/.opencode/agents/performance-optimizer.md +194 -0
  18. package/kit/.opencode/agents/product-manager.md +120 -0
  19. package/kit/.opencode/agents/product-owner.md +103 -0
  20. package/kit/.opencode/agents/project-planner.md +418 -0
  21. package/kit/.opencode/agents/qa-automation-engineer.md +113 -0
  22. package/kit/.opencode/agents/security-auditor.md +179 -0
  23. package/kit/.opencode/agents/seo-specialist.md +119 -0
  24. package/kit/.opencode/agents/test-engineer.md +169 -0
  25. package/kit/.opencode/commands/brainstorm.md +113 -0
  26. package/kit/.opencode/commands/coordinate.md +72 -0
  27. package/kit/.opencode/commands/create.md +63 -0
  28. package/kit/.opencode/commands/debug.md +102 -0
  29. package/kit/.opencode/commands/deploy.md +175 -0
  30. package/kit/.opencode/commands/enhance.md +62 -0
  31. package/kit/.opencode/commands/orchestrate.md +241 -0
  32. package/kit/.opencode/commands/plan.md +89 -0
  33. package/kit/.opencode/commands/preview.md +80 -0
  34. package/kit/.opencode/commands/remember.md +67 -0
  35. package/kit/.opencode/commands/status.md +86 -0
  36. package/kit/.opencode/commands/test.md +143 -0
  37. package/kit/.opencode/commands/verify.md +71 -0
  38. package/kit/.opencode/memory/MEMORY.md +6 -0
  39. package/kit/.opencode/memory/feedback-history.md +9 -0
  40. package/kit/.opencode/memory/project-conventions.md +16 -0
  41. package/kit/.opencode/memory/tech-decisions.md +10 -0
  42. package/kit/.opencode/memory/user-preferences.md +9 -0
  43. package/kit/.opencode/opencode.json +15 -0
  44. package/kit/.opencode/scripts/README.md +95 -0
  45. package/kit/.opencode/scripts/auto_preview.py +149 -0
  46. package/kit/.opencode/scripts/checklist.py +75 -0
  47. package/kit/.opencode/scripts/component_registry.py +238 -0
  48. package/kit/.opencode/scripts/dependency_graph.py +73 -0
  49. package/kit/.opencode/scripts/generate_manifest.py +44 -0
  50. package/kit/.opencode/scripts/session_manager.py +120 -0
  51. package/kit/.opencode/scripts/tests/test_toolkit.py +238 -0
  52. package/kit/.opencode/scripts/validate_kit.py +397 -0
  53. package/kit/.opencode/scripts/validation_runner.py +216 -0
  54. package/kit/.opencode/scripts/verify_all.py +85 -0
  55. package/kit/.opencode/skills/api-patterns/SKILL.md +83 -0
  56. package/kit/.opencode/skills/api-patterns/api-style.md +42 -0
  57. package/kit/.opencode/skills/api-patterns/auth.md +24 -0
  58. package/kit/.opencode/skills/api-patterns/documentation.md +26 -0
  59. package/kit/.opencode/skills/api-patterns/graphql.md +41 -0
  60. package/kit/.opencode/skills/api-patterns/rate-limiting.md +31 -0
  61. package/kit/.opencode/skills/api-patterns/response.md +37 -0
  62. package/kit/.opencode/skills/api-patterns/rest.md +40 -0
  63. package/kit/.opencode/skills/api-patterns/scripts/api_validator.py +211 -0
  64. package/kit/.opencode/skills/api-patterns/security-testing.md +122 -0
  65. package/kit/.opencode/skills/api-patterns/trpc.md +41 -0
  66. package/kit/.opencode/skills/api-patterns/versioning.md +22 -0
  67. package/kit/.opencode/skills/app-builder/SKILL.md +78 -0
  68. package/kit/.opencode/skills/app-builder/agent-coordination.md +71 -0
  69. package/kit/.opencode/skills/app-builder/feature-building.md +53 -0
  70. package/kit/.opencode/skills/app-builder/project-detection.md +45 -0
  71. package/kit/.opencode/skills/app-builder/scaffolding.md +110 -0
  72. package/kit/.opencode/skills/app-builder/tech-stack.md +41 -0
  73. package/kit/.opencode/skills/app-builder/templates/SKILL.md +39 -0
  74. package/kit/.opencode/skills/app-builder/templates/astro-static/TEMPLATE.md +78 -0
  75. package/kit/.opencode/skills/app-builder/templates/chrome-extension/TEMPLATE.md +96 -0
  76. package/kit/.opencode/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  77. package/kit/.opencode/skills/app-builder/templates/electron-desktop/TEMPLATE.md +97 -0
  78. package/kit/.opencode/skills/app-builder/templates/express-api/TEMPLATE.md +89 -0
  79. package/kit/.opencode/skills/app-builder/templates/flutter-app/TEMPLATE.md +93 -0
  80. package/kit/.opencode/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +97 -0
  81. package/kit/.opencode/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -0
  82. package/kit/.opencode/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +125 -0
  83. package/kit/.opencode/skills/app-builder/templates/nextjs-static/TEMPLATE.md +174 -0
  84. package/kit/.opencode/skills/app-builder/templates/nuxt-app/TEMPLATE.md +127 -0
  85. package/kit/.opencode/skills/app-builder/templates/python-fastapi/TEMPLATE.md +94 -0
  86. package/kit/.opencode/skills/app-builder/templates/react-native-app/TEMPLATE.md +121 -0
  87. package/kit/.opencode/skills/architecture/SKILL.md +57 -0
  88. package/kit/.opencode/skills/architecture/context-discovery.md +43 -0
  89. package/kit/.opencode/skills/architecture/examples.md +94 -0
  90. package/kit/.opencode/skills/architecture/pattern-selection.md +68 -0
  91. package/kit/.opencode/skills/architecture/patterns-reference.md +50 -0
  92. package/kit/.opencode/skills/architecture/trade-off-analysis.md +77 -0
  93. package/kit/.opencode/skills/bash-linux/SKILL.md +201 -0
  94. package/kit/.opencode/skills/batch-operations/SKILL.md +105 -0
  95. package/kit/.opencode/skills/behavioral-modes/SKILL.md +253 -0
  96. package/kit/.opencode/skills/brainstorming/SKILL.md +178 -0
  97. package/kit/.opencode/skills/brainstorming/dynamic-questioning.md +350 -0
  98. package/kit/.opencode/skills/clean-code/SKILL.md +201 -0
  99. package/kit/.opencode/skills/code-review-checklist/SKILL.md +111 -0
  100. package/kit/.opencode/skills/code-review-graph/SKILL.md +305 -0
  101. package/kit/.opencode/skills/context-compression/SKILL.md +145 -0
  102. package/kit/.opencode/skills/coordinator-mode/SKILL.md +208 -0
  103. package/kit/.opencode/skills/database-design/SKILL.md +54 -0
  104. package/kit/.opencode/skills/database-design/database-selection.md +43 -0
  105. package/kit/.opencode/skills/database-design/indexing.md +39 -0
  106. package/kit/.opencode/skills/database-design/migrations.md +48 -0
  107. package/kit/.opencode/skills/database-design/optimization.md +36 -0
  108. package/kit/.opencode/skills/database-design/orm-selection.md +30 -0
  109. package/kit/.opencode/skills/database-design/schema-design.md +56 -0
  110. package/kit/.opencode/skills/database-design/scripts/schema_validator.py +172 -0
  111. package/kit/.opencode/skills/deployment-procedures/SKILL.md +243 -0
  112. package/kit/.opencode/skills/design-spec/SKILL.md +185 -0
  113. package/kit/.opencode/skills/design-spec/collection.md +106 -0
  114. package/kit/.opencode/skills/documentation-templates/SKILL.md +196 -0
  115. package/kit/.opencode/skills/frontend-architecture/SKILL.md +245 -0
  116. package/kit/.opencode/skills/frontend-design/SKILL.md +1222 -0
  117. package/kit/.opencode/skills/frontend-design/redesign.md +178 -0
  118. package/kit/.opencode/skills/frontend-design/scripts/accessibility_checker.py +145 -0
  119. package/kit/.opencode/skills/frontend-design/scripts/ux_audit.py +722 -0
  120. package/kit/.opencode/skills/frontend-design/style-brutalist.md +92 -0
  121. package/kit/.opencode/skills/frontend-design/style-minimalist.md +85 -0
  122. package/kit/.opencode/skills/game-development/2d-games/SKILL.md +118 -0
  123. package/kit/.opencode/skills/game-development/3d-games/SKILL.md +134 -0
  124. package/kit/.opencode/skills/game-development/SKILL.md +169 -0
  125. package/kit/.opencode/skills/game-development/game-art/SKILL.md +184 -0
  126. package/kit/.opencode/skills/game-development/game-audio/SKILL.md +189 -0
  127. package/kit/.opencode/skills/game-development/game-design/SKILL.md +128 -0
  128. package/kit/.opencode/skills/game-development/mobile-games/SKILL.md +107 -0
  129. package/kit/.opencode/skills/game-development/multiplayer/SKILL.md +131 -0
  130. package/kit/.opencode/skills/game-development/pc-games/SKILL.md +143 -0
  131. package/kit/.opencode/skills/game-development/vr-ar/SKILL.md +122 -0
  132. package/kit/.opencode/skills/game-development/web-games/SKILL.md +149 -0
  133. package/kit/.opencode/skills/geo-fundamentals/SKILL.md +158 -0
  134. package/kit/.opencode/skills/geo-fundamentals/scripts/geo_checker.py +273 -0
  135. package/kit/.opencode/skills/i18n-localization/SKILL.md +156 -0
  136. package/kit/.opencode/skills/i18n-localization/scripts/i18n_checker.py +223 -0
  137. package/kit/.opencode/skills/intelligent-routing/SKILL.md +337 -0
  138. package/kit/.opencode/skills/lint-and-validate/SKILL.md +47 -0
  139. package/kit/.opencode/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  140. package/kit/.opencode/skills/lint-and-validate/scripts/type_coverage.py +245 -0
  141. package/kit/.opencode/skills/mcp-builder/SKILL.md +205 -0
  142. package/kit/.opencode/skills/memory-system/SKILL.md +181 -0
  143. package/kit/.opencode/skills/mobile-design/SKILL.md +396 -0
  144. package/kit/.opencode/skills/mobile-design/decision-trees.md +516 -0
  145. package/kit/.opencode/skills/mobile-design/mobile-backend.md +491 -0
  146. package/kit/.opencode/skills/mobile-design/mobile-color-system.md +420 -0
  147. package/kit/.opencode/skills/mobile-design/mobile-debugging.md +122 -0
  148. package/kit/.opencode/skills/mobile-design/mobile-design-thinking.md +357 -0
  149. package/kit/.opencode/skills/mobile-design/mobile-navigation.md +458 -0
  150. package/kit/.opencode/skills/mobile-design/mobile-performance.md +767 -0
  151. package/kit/.opencode/skills/mobile-design/mobile-testing.md +356 -0
  152. package/kit/.opencode/skills/mobile-design/mobile-typography.md +433 -0
  153. package/kit/.opencode/skills/mobile-design/platform-android.md +666 -0
  154. package/kit/.opencode/skills/mobile-design/platform-ios.md +561 -0
  155. package/kit/.opencode/skills/mobile-design/scripts/mobile_audit.py +670 -0
  156. package/kit/.opencode/skills/mobile-design/touch-psychology.md +537 -0
  157. package/kit/.opencode/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
  158. package/kit/.opencode/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  159. package/kit/.opencode/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  160. package/kit/.opencode/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  161. package/kit/.opencode/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  162. package/kit/.opencode/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  163. package/kit/.opencode/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  164. package/kit/.opencode/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  165. package/kit/.opencode/skills/nextjs-react-expert/9-cache-components.md +103 -0
  166. package/kit/.opencode/skills/nextjs-react-expert/SKILL.md +293 -0
  167. package/kit/.opencode/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  168. package/kit/.opencode/skills/nextjs-react-expert/scripts/react_performance_checker.py +281 -0
  169. package/kit/.opencode/skills/nodejs-best-practices/SKILL.md +336 -0
  170. package/kit/.opencode/skills/parallel-agents/SKILL.md +192 -0
  171. package/kit/.opencode/skills/performance-profiling/SKILL.md +145 -0
  172. package/kit/.opencode/skills/performance-profiling/scripts/bundle_analyzer.py +120 -0
  173. package/kit/.opencode/skills/performance-profiling/scripts/lighthouse_audit.py +108 -0
  174. package/kit/.opencode/skills/plan-writing/SKILL.md +153 -0
  175. package/kit/.opencode/skills/powershell-windows/SKILL.md +169 -0
  176. package/kit/.opencode/skills/python-patterns/SKILL.md +443 -0
  177. package/kit/.opencode/skills/red-team-tactics/SKILL.md +201 -0
  178. package/kit/.opencode/skills/rust-pro/SKILL.md +177 -0
  179. package/kit/.opencode/skills/seo-fundamentals/SKILL.md +131 -0
  180. package/kit/.opencode/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  181. package/kit/.opencode/skills/server-management/SKILL.md +163 -0
  182. package/kit/.opencode/skills/simplify-code/SKILL.md +131 -0
  183. package/kit/.opencode/skills/skillify/SKILL.md +115 -0
  184. package/kit/.opencode/skills/systematic-debugging/SKILL.md +111 -0
  185. package/kit/.opencode/skills/tailwind-patterns/SKILL.md +271 -0
  186. package/kit/.opencode/skills/tdd-workflow/SKILL.md +151 -0
  187. package/kit/.opencode/skills/testing-patterns/SKILL.md +180 -0
  188. package/kit/.opencode/skills/testing-patterns/scripts/test_runner.py +219 -0
  189. package/kit/.opencode/skills/verify-changes/SKILL.md +127 -0
  190. package/kit/.opencode/skills/vulnerability-scanner/SKILL.md +278 -0
  191. package/kit/.opencode/skills/vulnerability-scanner/checklists.md +124 -0
  192. package/kit/.opencode/skills/vulnerability-scanner/scripts/dependency_analyzer.py +144 -0
  193. package/kit/.opencode/skills/vulnerability-scanner/scripts/security_scan.py +410 -0
  194. package/kit/.opencode/skills/web-design-guidelines/SKILL.md +56 -0
  195. package/kit/.opencode/skills/webapp-testing/SKILL.md +189 -0
  196. package/kit/.opencode/skills/webapp-testing/scripts/playwright_runner.py +123 -0
  197. package/lib/init.js +61 -0
  198. package/package.json +21 -0
@@ -0,0 +1,278 @@
1
+ ---
2
+ name: vulnerability-scanner
3
+ description: Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.
4
+ compatibility: opencode
5
+ metadata:
6
+ when_to_use: "\"When scanning for security vulnerabilities, checking OWASP 2025 compliance, or analyzing supply chain security.\""
7
+ version: "1.0.0"
8
+ ---
9
+ # Vulnerability Scanner
10
+
11
+ > Think like an attacker, defend like an expert. 2025 threat landscape awareness.
12
+
13
+ ## 🔧 Runtime Scripts
14
+
15
+ **Execute for automated validation:**
16
+
17
+ | Script | Purpose | Usage |
18
+ |--------|---------|-------|
19
+ | `.opencode/scripts/security_scan.py` | Validate security principles applied | `python .opencode/scripts/security_scan.py <project_path>` |
20
+
21
+ ## 📋 Reference Files
22
+
23
+ | File | Purpose |
24
+ |------|---------|
25
+ | [checklists.md](checklists.md) | OWASP Top 10, Auth, API, Data protection checklists |
26
+
27
+ ---
28
+
29
+ ## 1. Security Expert Mindset
30
+
31
+ ### Core Principles
32
+
33
+ | Principle | Application |
34
+ |-----------|-------------|
35
+ | **Assume Breach** | Design as if attacker already inside |
36
+ | **Zero Trust** | Never trust, always verify |
37
+ | **Defense in Depth** | Multiple layers, no single point |
38
+ | **Least Privilege** | Minimum required access only |
39
+ | **Fail Secure** | On error, deny access |
40
+
41
+ ### Threat Modeling Questions
42
+
43
+ Before scanning, ask:
44
+ 1. What are we protecting? (Assets)
45
+ 2. Who would attack? (Threat actors)
46
+ 3. How would they attack? (Attack vectors)
47
+ 4. What's the impact? (Business risk)
48
+
49
+ ---
50
+
51
+ ## 2. OWASP Top 10:2025
52
+
53
+ ### Risk Categories
54
+
55
+ | Rank | Category | Think About |
56
+ |------|----------|-------------|
57
+ | **A01** | Broken Access Control | Who can access what? IDOR, SSRF |
58
+ | **A02** | Security Misconfiguration | Defaults, headers, exposed services |
59
+ | **A03** | Software Supply Chain 🆕 | Dependencies, CI/CD, build integrity |
60
+ | **A04** | Cryptographic Failures | Weak crypto, exposed secrets |
61
+ | **A05** | Injection | User input → system commands |
62
+ | **A06** | Insecure Design | Flawed architecture |
63
+ | **A07** | Authentication Failures | Session, credential management |
64
+ | **A08** | Integrity Failures | Unsigned updates, tampered data |
65
+ | **A09** | Logging & Alerting | Blind spots, no monitoring |
66
+ | **A10** | Exceptional Conditions 🆕 | Error handling, fail-open states |
67
+
68
+ ### 2025 Key Changes
69
+
70
+ ```
71
+ 2021 → 2025 Shifts:
72
+ ├── SSRF merged into A01 (Access Control)
73
+ ├── A02 elevated (Cloud/Container configs)
74
+ ├── A03 NEW: Supply Chain (major focus)
75
+ ├── A10 NEW: Exceptional Conditions
76
+ └── Focus shift: Root causes > Symptoms
77
+ ```
78
+
79
+ ---
80
+
81
+ ## 3. Supply Chain Security (A03)
82
+
83
+ ### Attack Surface
84
+
85
+ | Vector | Risk | Question to Ask |
86
+ |--------|------|-----------------|
87
+ | **Dependencies** | Malicious packages | Do we audit new deps? |
88
+ | **Lock files** | Integrity attacks | Are they committed? |
89
+ | **Build pipeline** | CI/CD compromise | Who can modify? |
90
+ | **Registry** | Typosquatting | Verified sources? |
91
+
92
+ ### Defense Principles
93
+
94
+ - Verify package integrity (checksums)
95
+ - Pin versions, audit updates
96
+ - Use private registries for critical deps
97
+ - Sign and verify artifacts
98
+
99
+ ---
100
+
101
+ ## 4. Attack Surface Mapping
102
+
103
+ ### What to Map
104
+
105
+ | Category | Elements |
106
+ |----------|----------|
107
+ | **Entry Points** | APIs, forms, file uploads |
108
+ | **Data Flows** | Input → Process → Output |
109
+ | **Trust Boundaries** | Where auth/authz checked |
110
+ | **Assets** | Secrets, PII, business data |
111
+
112
+ ### Prioritization Matrix
113
+
114
+ ```
115
+ Risk = Likelihood × Impact
116
+
117
+ High Impact + High Likelihood → CRITICAL
118
+ High Impact + Low Likelihood → HIGH
119
+ Low Impact + High Likelihood → MEDIUM
120
+ Low Impact + Low Likelihood → LOW
121
+ ```
122
+
123
+ ---
124
+
125
+ ## 5. Risk Prioritization
126
+
127
+ ### CVSS + Context
128
+
129
+ | Factor | Weight | Question |
130
+ |--------|--------|----------|
131
+ | **CVSS Score** | Base severity | How severe is the vuln? |
132
+ | **EPSS Score** | Exploit likelihood | Is it being exploited? |
133
+ | **Asset Value** | Business context | What's at risk? |
134
+ | **Exposure** | Attack surface | Internet-facing? |
135
+
136
+ ### Prioritization Decision Tree
137
+
138
+ ```
139
+ Is it actively exploited (EPSS >0.5)?
140
+ ├── YES → CRITICAL: Immediate action
141
+ └── NO → Check CVSS
142
+ ├── CVSS ≥9.0 → HIGH
143
+ ├── CVSS 7.0-8.9 → Consider asset value
144
+ └── CVSS <7.0 → Schedule for later
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 6. Exceptional Conditions (A10 - New)
150
+
151
+ ### Fail-Open vs Fail-Closed
152
+
153
+ | Scenario | Fail-Open (BAD) | Fail-Closed (GOOD) |
154
+ |----------|-----------------|---------------------|
155
+ | Auth error | Allow access | Deny access |
156
+ | Parsing fails | Accept input | Reject input |
157
+ | Timeout | Retry forever | Limit + abort |
158
+
159
+ ### What to Check
160
+
161
+ - Exception handlers that catch-all and ignore
162
+ - Missing error handling on security operations
163
+ - Race conditions in auth/authz
164
+ - Resource exhaustion scenarios
165
+
166
+ ---
167
+
168
+ ## 7. Scanning Methodology
169
+
170
+ ### Phase-Based Approach
171
+
172
+ ```
173
+ 1. RECONNAISSANCE
174
+ └── Understand the target
175
+ ├── Technology stack
176
+ ├── Entry points
177
+ └── Data flows
178
+
179
+ 2. DISCOVERY
180
+ └── Identify potential issues
181
+ ├── Configuration review
182
+ ├── Dependency analysis
183
+ └── Code pattern search
184
+
185
+ 3. ANALYSIS
186
+ └── Validate and prioritize
187
+ ├── False positive elimination
188
+ ├── Risk scoring
189
+ └── Attack chain mapping
190
+
191
+ 4. REPORTING
192
+ └── Actionable findings
193
+ ├── Clear reproduction steps
194
+ ├── Business impact
195
+ └── Remediation guidance
196
+ ```
197
+
198
+ ---
199
+
200
+ ## 8. Code Pattern Analysis
201
+
202
+ ### High-Risk Patterns
203
+
204
+ | Pattern | Risk | Look For |
205
+ |---------|------|----------|
206
+ | **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |
207
+ | **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |
208
+ | **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |
209
+ | **Path manipulation** | Traversal | User input in file paths |
210
+ | **Disabled security** | Various | `verify=False`, `--insecure` |
211
+
212
+ ### Secret Patterns
213
+
214
+ | Type | Indicators |
215
+ |------|-----------|
216
+ | API Keys | `api_key`, `apikey`, high entropy |
217
+ | Tokens | `token`, `bearer`, `jwt` |
218
+ | Credentials | `password`, `secret`, `key` |
219
+ | Cloud | `AWS_`, `AZURE_`, `GCP_` prefixes |
220
+
221
+ ---
222
+
223
+ ## 9. Cloud Security Considerations
224
+
225
+ ### Shared Responsibility
226
+
227
+ | Layer | You Own | Provider Owns |
228
+ |-------|---------|---------------|
229
+ | Data | ✅ | ❌ |
230
+ | Application | ✅ | ❌ |
231
+ | OS/Runtime | Depends | Depends |
232
+ | Infrastructure | ❌ | ✅ |
233
+
234
+ ### Cloud-Specific Checks
235
+
236
+ - IAM: Least privilege applied?
237
+ - Storage: Public buckets?
238
+ - Network: Security groups tightened?
239
+ - Secrets: Using secrets manager?
240
+
241
+ ---
242
+
243
+ ## 10. Anti-Patterns
244
+
245
+ | ❌ Don't | ✅ Do |
246
+ |----------|-------|
247
+ | Scan without understanding | Map attack surface first |
248
+ | Alert on every CVE | Prioritize by exploitability + asset |
249
+ | Ignore false positives | Maintain verified baseline |
250
+ | Fix symptoms only | Address root causes |
251
+ | Scan once before deploy | Continuous scanning |
252
+ | Trust third-party deps blindly | Verify integrity, audit code |
253
+
254
+ ---
255
+
256
+ ## 11. Reporting Principles
257
+
258
+ ### Finding Structure
259
+
260
+ Each finding should answer:
261
+ 1. **What?** - Clear vulnerability description
262
+ 2. **Where?** - Exact location (file, line, endpoint)
263
+ 3. **Why?** - Root cause explanation
264
+ 4. **Impact?** - Business consequence
265
+ 5. **How to fix?** - Specific remediation
266
+
267
+ ### Severity Classification
268
+
269
+ | Severity | Criteria |
270
+ |----------|----------|
271
+ | **Critical** | RCE, auth bypass, mass data exposure |
272
+ | **High** | Data exposure, privilege escalation |
273
+ | **Medium** | Limited scope, requires conditions |
274
+ | **Low** | Informational, best practice |
275
+
276
+ ---
277
+
278
+ > **Remember:** Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"
@@ -0,0 +1,124 @@
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
+ > Aligned to OWASP Top 10:2025.
10
+
11
+ ### A01: Broken Access Control
12
+ - [ ] Authorization on all protected routes
13
+ - [ ] Deny by default
14
+ - [ ] Rate limiting implemented
15
+ - [ ] CORS properly configured
16
+
17
+ ### A02: Security Misconfiguration
18
+ - [ ] Unnecessary features disabled
19
+ - [ ] Error messages sanitized
20
+ - [ ] Security headers configured
21
+ - [ ] Default credentials changed
22
+
23
+ ### A03: Software Supply Chain Failures
24
+ - [ ] Dependencies up to date, no known vulnerabilities
25
+ - [ ] Dependency integrity verified (lockfiles, checksums)
26
+ - [ ] Unused dependencies removed
27
+ - [ ] Build/CI pipeline and third-party scripts vetted
28
+
29
+ ### A04: Cryptographic Failures
30
+ - [ ] Passwords hashed (bcrypt/argon2, cost 12+)
31
+ - [ ] Sensitive data encrypted at rest
32
+ - [ ] TLS 1.2+ for all connections
33
+ - [ ] No secrets in code/logs
34
+
35
+ ### A05: Injection
36
+ - [ ] Parameterized queries
37
+ - [ ] Input validation on all user data
38
+ - [ ] Output encoding for XSS
39
+ - [ ] No eval() or dynamic code execution
40
+
41
+ ### A06: Insecure Design
42
+ - [ ] Threat modeling done
43
+ - [ ] Security requirements defined
44
+ - [ ] Business logic validated
45
+
46
+ ### A07: Authentication Failures
47
+ - [ ] MFA available
48
+ - [ ] Session invalidation on logout
49
+ - [ ] Session timeout implemented
50
+ - [ ] Brute force protection
51
+
52
+ ### A08: Software or Data Integrity Failures
53
+ - [ ] Dependency integrity verified
54
+ - [ ] CI/CD pipeline secured
55
+ - [ ] Update mechanism secured
56
+
57
+ ### A09: Security Logging and Alerting Failures
58
+ - [ ] Security events logged
59
+ - [ ] Logs protected
60
+ - [ ] No sensitive data in logs
61
+ - [ ] Alerting configured
62
+
63
+ ### A10: Mishandling of Exceptional Conditions
64
+ - [ ] Errors handled explicitly (no silent catch/empty handlers)
65
+ - [ ] Fail closed, not open, on unexpected state
66
+ - [ ] No sensitive detail leaked in error responses
67
+
68
+ ---
69
+
70
+ ## Authentication Checklist
71
+
72
+ - [ ] Strong password policy
73
+ - [ ] Account lockout
74
+ - [ ] Secure password reset
75
+ - [ ] Session management
76
+ - [ ] Token expiration
77
+ - [ ] Logout invalidation
78
+
79
+ ---
80
+
81
+ ## API Security Checklist
82
+
83
+ - [ ] Authentication required
84
+ - [ ] Authorization per endpoint
85
+ - [ ] Input validation
86
+ - [ ] Rate limiting
87
+ - [ ] Output sanitization
88
+ - [ ] Error handling
89
+
90
+ ---
91
+
92
+ ## Data Protection Checklist
93
+
94
+ - [ ] Encryption at rest
95
+ - [ ] Encryption in transit
96
+ - [ ] Key management
97
+ - [ ] Data minimization
98
+ - [ ] Secure deletion
99
+
100
+ ---
101
+
102
+ ## Security Headers
103
+
104
+ | Header | Purpose |
105
+ |--------|---------|
106
+ | **Content-Security-Policy** | XSS prevention |
107
+ | **X-Content-Type-Options** | MIME sniffing |
108
+ | **X-Frame-Options** | Clickjacking |
109
+ | **Strict-Transport-Security** | Force HTTPS |
110
+ | **Referrer-Policy** | Referrer control |
111
+
112
+ ---
113
+
114
+ ## Quick Audit Commands
115
+
116
+ | Check | What to Look For |
117
+ |-------|------------------|
118
+ | Secrets in code | password, api_key, secret |
119
+ | Dangerous patterns | eval, innerHTML, SQL concat |
120
+ | Dependency issues | npm audit, snyk |
121
+
122
+ ---
123
+
124
+ > **Usage:** Copy relevant checklists into your PLAN.md or security report.
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env python3
2
+ """Offline dependency hygiene analyzer for common package ecosystems."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import re
8
+ import sys
9
+ from datetime import datetime, timezone
10
+ from pathlib import Path
11
+ from typing import Any
12
+
13
+ SKIP_DIRS = {"node_modules", ".git", ".agents", ".agent", ".venv", "venv", "dist", "build", ".next", "vendor"}
14
+ SEVERITY = {"none": 99, "low": 1, "medium": 2, "high": 3, "critical": 4}
15
+
16
+
17
+ def iter_named_files(root: Path, names: set[str]):
18
+ for path in root.rglob("*"):
19
+ if any(part in SKIP_DIRS for part in path.parts):
20
+ continue
21
+ if path.is_file() and path.name in names:
22
+ yield path
23
+
24
+
25
+ def add(findings: list[dict[str, Any]], severity: str, issue: str, path: Path, detail: str) -> None:
26
+ findings.append({"severity": severity, "issue": issue, "file": path.as_posix(), "detail": detail})
27
+
28
+
29
+ def analyze_package_json(path: Path, root: Path, findings: list[dict[str, Any]]) -> dict[str, Any]:
30
+ try:
31
+ data = json.loads(path.read_text("utf-8"))
32
+ except (OSError, json.JSONDecodeError) as exc:
33
+ add(findings, "high", "Invalid package.json", path.relative_to(root), str(exc))
34
+ return {"file": path.relative_to(root).as_posix(), "dependencies": 0}
35
+
36
+ deps: dict[str, str] = {}
37
+ for section in ("dependencies", "devDependencies", "peerDependencies", "optionalDependencies"):
38
+ values = data.get(section, {})
39
+ if isinstance(values, dict):
40
+ deps.update({str(k): str(v) for k, v in values.items()})
41
+
42
+ for name, spec in deps.items():
43
+ normalized = spec.strip().lower()
44
+ if normalized in {"*", "latest", "next"}:
45
+ add(findings, "high", "Unbounded dependency version", path.relative_to(root), f"{name}: {spec}")
46
+ elif normalized.startswith(("http://", "https://", "git://", "git+http://")):
47
+ add(findings, "high", "Dependency fetched from mutable remote", path.relative_to(root), f"{name}: {spec}")
48
+ elif normalized.startswith("github:") and "#" not in normalized:
49
+ add(findings, "medium", "GitHub dependency is not pinned to a ref", path.relative_to(root), f"{name}: {spec}")
50
+
51
+ package_dir = path.parent
52
+ locks = [name for name in ("package-lock.json", "npm-shrinkwrap.json", "yarn.lock", "pnpm-lock.yaml", "bun.lock", "bun.lockb") if (package_dir / name).exists()]
53
+ if not locks:
54
+ add(findings, "high", "Missing JavaScript lock file", path.relative_to(root), "Add and commit one package-manager lock file.")
55
+ elif len(locks) > 1:
56
+ add(findings, "medium", "Multiple JavaScript lock files", path.relative_to(root), ", ".join(locks))
57
+ return {"file": path.relative_to(root).as_posix(), "dependencies": len(deps), "lock_files": locks}
58
+
59
+
60
+ def analyze_requirements(path: Path, root: Path, findings: list[dict[str, Any]]) -> dict[str, Any]:
61
+ unpinned = []
62
+ total = 0
63
+ try:
64
+ lines = path.read_text("utf-8").splitlines()
65
+ except OSError as exc:
66
+ add(findings, "high", "Unreadable requirements file", path.relative_to(root), str(exc))
67
+ return {"file": path.relative_to(root).as_posix(), "dependencies": 0}
68
+ for raw in lines:
69
+ line = raw.strip()
70
+ if not line or line.startswith(("#", "-r", "--", "-e")):
71
+ continue
72
+ total += 1
73
+ if " @ " in line or re.search(r"===|==", line):
74
+ continue
75
+ if re.match(r"^[A-Za-z0-9_.-]+(?:\[[^]]+\])?\s*(?:$|[<>!~]=?)", line):
76
+ unpinned.append(line)
77
+ for spec in unpinned[:25]:
78
+ add(findings, "medium", "Python dependency is not exactly pinned", path.relative_to(root), spec)
79
+ return {"file": path.relative_to(root).as_posix(), "dependencies": total, "unpinned": len(unpinned)}
80
+
81
+
82
+ def analyze(root: Path) -> dict[str, Any]:
83
+ findings: list[dict[str, Any]] = []
84
+ manifests: list[dict[str, Any]] = []
85
+ for path in iter_named_files(root, {"package.json"}):
86
+ manifests.append(analyze_package_json(path, root, findings))
87
+ for path in iter_named_files(root, {"requirements.txt", "requirements-dev.txt", "requirements-prod.txt"}):
88
+ manifests.append(analyze_requirements(path, root, findings))
89
+
90
+ # Lightweight presence checks for other ecosystems.
91
+ for manifest, locks, ecosystem in (
92
+ ("Cargo.toml", ("Cargo.lock",), "Rust"),
93
+ ("Gemfile", ("Gemfile.lock",), "Ruby"),
94
+ ("go.mod", ("go.sum",), "Go"),
95
+ ("Pipfile", ("Pipfile.lock",), "Python/Pipenv"),
96
+ ("pyproject.toml", ("poetry.lock", "uv.lock", "requirements.txt"), "Python"),
97
+ ):
98
+ for path in iter_named_files(root, {manifest}):
99
+ present = [name for name in locks if (path.parent / name).exists()]
100
+ if not present:
101
+ add(findings, "medium", f"No recognized {ecosystem} lock/resolution file", path.relative_to(root), f"Expected one of: {', '.join(locks)}")
102
+
103
+ counts = {severity: sum(f["severity"] == severity for f in findings) for severity in ("critical", "high", "medium", "low")}
104
+ return {
105
+ "project": str(root),
106
+ "timestamp": datetime.now(timezone.utc).isoformat(),
107
+ "manifests": manifests,
108
+ "findings": findings,
109
+ "summary": {"total": len(findings), **counts},
110
+ }
111
+
112
+
113
+ def should_fail(report: dict[str, Any], threshold: str) -> bool:
114
+ if threshold == "none":
115
+ return False
116
+ rank = SEVERITY[threshold]
117
+ return any(report["summary"].get(level, 0) and value >= rank for level, value in SEVERITY.items() if level != "none")
118
+
119
+
120
+ def main() -> int:
121
+ parser = argparse.ArgumentParser(description="Analyze dependency pinning and lock-file hygiene without network access")
122
+ parser.add_argument("project", nargs="?", default=".")
123
+ parser.add_argument("--output", choices=["json", "summary"], default="summary")
124
+ parser.add_argument("--fail-on", choices=list(SEVERITY), default="high")
125
+ args = parser.parse_args()
126
+ root = Path(args.project).resolve()
127
+ if not root.is_dir():
128
+ parser.error(f"Project directory does not exist: {root}")
129
+ report = analyze(root)
130
+ if args.output == "json":
131
+ print(json.dumps(report, indent=2, ensure_ascii=False))
132
+ else:
133
+ s = report["summary"]
134
+ print(f"Dependency Analysis: {root}")
135
+ print(f"Findings: {s['total']} (critical={s['critical']}, high={s['high']}, medium={s['medium']}, low={s['low']})")
136
+ for finding in report["findings"][:20]:
137
+ print(f"[{finding['severity'].upper()}] {finding['file']}: {finding['issue']} - {finding['detail']}")
138
+ if not report["findings"]:
139
+ print("[PASS] No dependency hygiene issues detected.")
140
+ return 1 if should_fail(report, args.fail_on) else 0
141
+
142
+
143
+ if __name__ == "__main__":
144
+ raise SystemExit(main())