security-analysis
Security assessment using STRIDE threat modeling, OWASP Top 10, and CVSS scoring. Use for security reviews, threat modeling, and secure coding guidance.
What this skill does
# Security Analysis
Comprehensive security assessment framework.
## Frameworks Included
### STRIDE Threat Modeling
Categorize threats by type:
| Threat | Description | Example |
|--------|-------------|---------|
| **S**poofing | Impersonating something/someone | Fake login page |
| **T**ampering | Modifying data/code | SQL injection |
| **R**epudiation | Denying actions | Missing audit logs |
| **I**nformation Disclosure | Exposing data | Error message leaks |
| **D**enial of Service | Disrupting availability | Resource exhaustion |
| **E**levation of Privilege | Gaining unauthorized access | Broken access control |
### OWASP Top 10 (2021)
Check for common vulnerabilities:
1. **A01: Broken Access Control**
2. **A02: Cryptographic Failures**
3. **A03: Injection**
4. **A04: Insecure Design**
5. **A05: Security Misconfiguration**
6. **A06: Vulnerable Components**
7. **A07: Auth Failures**
8. **A08: Integrity Failures**
9. **A09: Logging Failures**
10. **A10: SSRF**
### CVSS Scoring
Rate vulnerability severity:
| Score | Severity | Action |
|-------|----------|--------|
| 9.0-10.0 | Critical | Fix immediately |
| 7.0-8.9 | High | Fix within days |
| 4.0-6.9 | Medium | Fix within weeks |
| 0.1-3.9 | Low | Fix when convenient |
## Security Review Process
### Phase 1: Attack Surface Mapping
Identify all entry points:
- API endpoints
- User inputs
- File uploads
- External integrations
- Authentication flows
### Phase 2: STRIDE Analysis
For each entry point, check all STRIDE categories.
### Phase 3: OWASP Checklist
Verify protection against Top 10.
### Phase 4: Risk Scoring
Apply CVSS to findings.
### Phase 5: Remediation Plan
Prioritize fixes by severity.
## Output Template
```markdown
## Security Analysis: [Component/Feature]
### Attack Surface
| Entry Point | Type | Trust Level |
|-------------|------|-------------|
| [endpoint] | API | Untrusted |
| [input] | User | Untrusted |
### STRIDE Assessment
#### Spoofing
- Risk: [description]
- Mitigation: [control]
- Status: [Mitigated/Open]
#### Tampering
...
### OWASP Top 10 Check
| Category | Status | Notes |
|----------|--------|-------|
| A01 Broken Access Control | ✓/✗ | |
| A02 Crypto Failures | ✓/✗ | |
| A03 Injection | ✓/✗ | |
...
### Vulnerabilities Found
| ID | Description | CVSS | Severity |
|----|-------------|------|----------|
| V1 | [description] | X.X | High |
| V2 | [description] | X.X | Medium |
### Remediation Plan
1. **[V1]**: [fix] - Priority: Immediate
2. **[V2]**: [fix] - Priority: This sprint
### Security Posture
**Overall Risk: [Low/Medium/High/Critical]**
```
## Quick Security Checklist
For rapid review:
- [ ] Input validation on all user data
- [ ] Output encoding to prevent XSS
- [ ] Parameterized queries (no SQL concatenation)
- [ ] Authentication on sensitive endpoints
- [ ] Authorization checks (not just auth)
- [ ] HTTPS everywhere
- [ ] Secrets not in code
- [ ] Error messages don't leak info
- [ ] Logging without sensitive data
- [ ] Dependencies updated
## Secure Coding Patterns
### Input Validation
```python
# Always validate and sanitize
def process_input(user_input):
if not isinstance(user_input, str):
raise ValueError("Invalid input type")
if len(user_input) > MAX_LENGTH:
raise ValueError("Input too long")
sanitized = escape_html(user_input)
return sanitized
```
### SQL Injection Prevention
```python
# NEVER concatenate
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}") # BAD
# ALWAYS parameterize
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,)) # GOOD
```
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.