Security

From gustavscirulis/snapgrid · View interactive version

Security is an AI agent skill from the GitHub repository gustavscirulis/snapgrid. 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.

How to use this skill

Skill file

Security Review for Apple Platforms

Comprehensive security guidance for iOS, macOS, and watchOS applications. Reviews code for vulnerabilities and provides secure implementation patterns.

When This Skill Activates

Use this skill when the user:

Review Process

Phase 1: Project Discovery

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:

Phase 2: Secure Storage Review

Load and apply: secure-storage.md

Key areas:

Phase 3: Authentication Review

Load and apply: biometric-auth.md

Key areas:

Phase 4: Network Security Review

Load and apply: network-security.md

Key areas:

Phase 5: Platform-Specific Review

Load and apply: platform-specifics.md

Key areas:

Output Format

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**:

// current insecure code


**Secure Implementation**:

// fixed secure code


---

## 🟠 High Priority Issues

Issues that weaken security posture.

[Same format as above]

---

## 🟡 Medium Priority Issues

Issues that should be addressed for defense in depth.

[Same format as above]

---

## 🟢 Recommendations

Security hardening suggestions.

[Same format as above]

---

## ✅ Security Strengths

What the app does well:
- [Strength 1]
- [Strength 2]

---

## Action Plan

1. **[Critical]** [First fix]
2. **[Critical]** [Second fix]
3. **[High]** [Third fix]
...

Priority Classification

🔴 Critical

🟠 High

🟡 Medium

🟢 Low/Recommendations

Quick Checks

Insecure Storage Detection

Grep: "UserDefaults.*password|UserDefaults.*token|UserDefaults.*secret|UserDefaults.*apiKey"
Grep: "\.write\(.*credential|\.write\(.*password"
Grep: "let.*apiKey.*=.*\"|let.*secret.*=.*\""

Insecure Network Detection

Grep: "http://(?!localhost|127\.0\.0\.1)"
Grep: "AllowsArbitraryLoads.*true"
Grep: "serverTrust|URLAuthenticationChallenge.*useCredential"

Sensitive Data in Logs

Grep: "print\(.*password|print\(.*token|NSLog.*credential"
Grep: "Logger.*password|os_log.*secret"

References

External Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.