bps-kit 1.0.7 → 1.0.8

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 (32) hide show
  1. package/README.md +19 -6
  2. package/bin/cli.js +27 -16
  3. package/package.json +1 -1
  4. package/templates/VAULT_INDEX.md +2 -2
  5. package/templates/agents-template/rules/GEMINI.md +4 -4
  6. package/templates/agents-template/scripts/convert_to_vscode.js +87 -0
  7. package/templates/skills_basic/behavioral-modes/SKILL.md +247 -0
  8. package/templates/skills_basic/brainstorming/SKILL.md +232 -0
  9. package/templates/skills_basic/clean-code/SKILL.md +94 -0
  10. package/templates/skills_basic/concise-planning/SKILL.md +68 -0
  11. package/templates/skills_basic/executing-plans/SKILL.md +82 -0
  12. package/templates/skills_basic/git-pushing/SKILL.md +36 -0
  13. package/templates/skills_basic/git-pushing/scripts/smart_commit.sh +19 -0
  14. package/templates/skills_basic/lint-and-validate/SKILL.md +50 -0
  15. package/templates/skills_basic/lint-and-validate/scripts/lint_runner.py +172 -0
  16. package/templates/skills_basic/lint-and-validate/scripts/type_coverage.py +173 -0
  17. package/templates/skills_basic/plan-writing/SKILL.md +154 -0
  18. package/templates/skills_basic/systematic-debugging/CREATION-LOG.md +119 -0
  19. package/templates/skills_basic/systematic-debugging/SKILL.md +299 -0
  20. package/templates/skills_basic/systematic-debugging/condition-based-waiting-example.ts +158 -0
  21. package/templates/skills_basic/systematic-debugging/condition-based-waiting.md +115 -0
  22. package/templates/skills_basic/systematic-debugging/defense-in-depth.md +122 -0
  23. package/templates/skills_basic/systematic-debugging/find-polluter.sh +63 -0
  24. package/templates/skills_basic/systematic-debugging/root-cause-tracing.md +169 -0
  25. package/templates/skills_basic/systematic-debugging/test-academic.md +14 -0
  26. package/templates/skills_basic/systematic-debugging/test-pressure-1.md +58 -0
  27. package/templates/skills_basic/systematic-debugging/test-pressure-2.md +68 -0
  28. package/templates/skills_basic/systematic-debugging/test-pressure-3.md +69 -0
  29. package/templates/skills_basic/verification-before-completion/SKILL.md +145 -0
  30. package/templates/skills_basic/vulnerability-scanner/SKILL.md +281 -0
  31. package/templates/skills_basic/vulnerability-scanner/checklists.md +121 -0
  32. package/templates/skills_basic/vulnerability-scanner/scripts/security_scan.py +458 -0
@@ -0,0 +1,281 @@
1
+ ---
2
+ name: vulnerability-scanner
3
+ description: "Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization."
4
+ risk: unknown
5
+ source: community
6
+ date_added: "2026-02-27"
7
+ ---
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
+ | `scripts/security_scan.py` | Validate security principles applied | `python 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?"
279
+
280
+ ## When to Use
281
+ This skill is applicable to execute the workflow or actions described in the overview.
@@ -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.