.claude/skills/security/SKILL.md
Security review and guidance for iOS, macOS, and watchOS apps. Covers secure storage, biometric authentication, network security, and platform-specific patterns. Use when implementing security features or reviewing code for vulnerabilities.
npx skillsauth add brdohman/agile-maestro securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive security guidance for iOS, macOS, and watchOS applications. Reviews code for vulnerabilities and provides secure implementation patterns.
Use this skill when the user:
Identify the app's security surface:
# Find security-related code
Grep: "SecItem|Keychain|kSecClass"
Grep: "LAContext|biometryType|evaluatePolicy"
Grep: "URLSession|ATS|NSAppTransportSecurity"
Grep: "CryptoKit|SecKey|CC_SHA"
Determine:
Load and apply: secure-storage.md
Key areas:
Load and apply: biometric-auth.md
Key areas:
Load and apply: network-security.md
Key areas:
Load and apply: platform-specifics.md
Key areas:
Present findings in this structure:
# Security Review: [App Name]
**Platform**: iOS / macOS / watchOS / Universal
**Review Date**: [Date]
**Risk Level**: Critical / High / Medium / Low
## Summary
| Category | Status | Issues |
|----------|--------|--------|
| Secure Storage | ✅/⚠️/❌ | X issues |
| Authentication | ✅/⚠️/❌ | X issues |
| Network Security | ✅/⚠️/❌ | X issues |
| Platform Security | ✅/⚠️/❌ | X issues |
---
## 🔴 Critical Vulnerabilities
Security issues that expose user data or enable attacks.
### [Issue Title]
**File**: `path/to/file.swift:123`
**Risk**: [What could happen if exploited]
**OWASP Category**: [If applicable]
**Vulnerable Code**:
```swift
// current insecure code
Secure Implementation:
// fixed secure code
Issues that weaken security posture.
[Same format as above]
Issues that should be addressed for defense in depth.
[Same format as above]
Security hardening suggestions.
[Same format as above]
What the app does well:
## Priority Classification
### 🔴 Critical
- Credentials stored in plain text or UserDefaults
- Disabled SSL/TLS validation
- Hardcoded secrets or API keys
- SQL injection or code injection vulnerabilities
- Missing authentication on sensitive operations
### 🟠 High
- Keychain without appropriate access controls
- Missing biometric authentication for sensitive data
- Weak cryptographic implementations
- Overly permissive entitlements
- Sensitive data in logs
### 🟡 Medium
- Missing certificate pinning
- Biometric fallback too permissive
- Data Protection class could be stronger
- Missing jailbreak/integrity detection
### 🟢 Low/Recommendations
- Additional hardening measures
- Defense in depth improvements
- Code organization for security clarity
## Quick Checks
### Insecure Storage Detection
```bash
Grep: "UserDefaults.*password|UserDefaults.*token|UserDefaults.*secret|UserDefaults.*apiKey"
Grep: "\.write\(.*credential|\.write\(.*password"
Grep: "let.*apiKey.*=.*\"|let.*secret.*=.*\""
Grep: "http://(?!localhost|127\.0\.0\.1)"
Grep: "AllowsArbitraryLoads.*true"
Grep: "serverTrust|URLAuthenticationChallenge.*useCredential"
Grep: "print\(.*password|print\(.*token|NSLog.*credential"
Grep: "Logger.*password|os_log.*secret"
Use STRIDE to systematically identify threats:
| Category | Question | macOS Example | |----------|----------|---------------| | Spoofing | Can an attacker impersonate a legitimate entity? | Fake Keychain prompt, spoofed API response | | Tampering | Can data be modified in transit or at rest? | Unvalidated file imports, unprotected UserDefaults | | Repudiation | Can actions be denied after the fact? | No audit logging for destructive operations | | Information Disclosure | Can data leak to unauthorized parties? | Sensitive data in logs, crash reports with PII | | Denial of Service | Can the app be made unavailable? | Unbounded data import, infinite retry loops | | Elevation of Privilege | Can access be escalated? | Entitlements broader than needed, unsandboxed execution |
For each feature under review, walk through all 6 STRIDE categories and document findings.
Test boundary inputs on all user-facing fields:
../../etc/passwd) for file pathsAfter fixing a security issue:
# Check for hardcoded secrets
grep -rn "let.*key.*=.*\"" --include="*.swift" | grep -iv "test\|mock\|sample"
# Check for UserDefaults storing sensitive data
grep -rn "UserDefaults.*password\|UserDefaults.*token\|UserDefaults.*secret" --include="*.swift"
# Check for disabled certificate validation
grep -rn "serverTrust\|URLAuthenticationChallenge.*useCredential" --include="*.swift"
testing
XCTest patterns for macOS Swift apps. Unit tests, async tests, Core Data tests, mock patterns, and assertion reference. Use when writing or reviewing tests.
tools
How to transition workflow state between review stages. Rules for setting review_stage and review_result fields on Stories and Epics.
documentation
Comment structure and rules for task workflow updates. Use when adding any comment to a task during implementation, review, or fix cycles.
testing
Validate task/story/epic/bug/techdebt metadata against schema v2.0. Run after TaskCreate or TaskUpdate to verify compliance. Returns pass/fail with actionable details.