πŸ›‘οΈ Security

Security Architecture

ProtectMyAPI implements enterprise-grade security to protect your API keys and prevent unauthorized access.

πŸ”’

We follow OWASP security guidelines, SOC 2 compliance requirements, and industry best practices for API security.


Zero-Trust Security Model

ProtectMyAPI operates on a zero-trust principle: every request must prove its legitimacy before accessing protected resources.

The 4-Layer Security Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 4: TLS 1.3 Encryption (Transit)      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Layer 3: Device Attestation (Identity)     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Layer 2: AES-256 Encryption (Storage)      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Layer 1: Runtime Protection (Client)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer 1: Runtime Protection (Client-Side)

Our SDKs include built-in security checks that run on the device:

Jailbreak/Root Detection

  • iOS: Detects common jailbreak artifacts, Cydia, unauthorized paths
  • Android: Detects root binaries, Magisk, su access, test-keys

Debugger Detection

  • Blocks requests when debugger is attached
  • Prevents runtime analysis and memory inspection

Emulator/Simulator Detection

  • Identifies virtual environments
  • Blocks requests from non-physical devices (configurable)

Binary Integrity

  • Verifies app signature matches expected bundle ID
  • Detects repackaged or modified apps

Layer 2: Device Attestation (Identity)

Device attestation cryptographically proves the request comes from:

  1. A genuine device (not emulated)
  2. Your authentic app (not modified)
  3. A secure environment (not compromised)

Apple App Attest (iOS)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   iPhone    β”‚         β”‚  Apple Servers   β”‚
β”‚   (Your     β”‚   ───►  β”‚  (App Attest)    β”‚
β”‚    App)     β”‚   ◄───  β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                         β”‚
       β”‚    Signed Assertion     β”‚
       β–Ό                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           ProtectMyAPI Server           β”‚
β”‚  β€’ Verifies Apple signature             β”‚
β”‚  β€’ Validates bundle ID                  β”‚
β”‚  β€’ Checks device ID                     β”‚
β”‚  β€’ Prevents replay attacks              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How it works:

  1. App generates a key pair tied to device hardware
  2. Apple signs the public key with bundle ID and team ID
  3. For each request, device signs a challenge with private key
  4. ProtectMyAPI verifies signature with Apple’s root certificate

Google Play Integrity (Android)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Android   β”‚         β”‚  Google Servers  β”‚
β”‚   (Your     β”‚   ───►  β”‚  (Play Integrity)β”‚
β”‚    App)     β”‚   ◄───  β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                         β”‚
       β”‚    Integrity Token      β”‚
       β–Ό                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           ProtectMyAPI Server           β”‚
β”‚  β€’ Decrypts integrity token             β”‚
β”‚  β€’ Verifies package name                β”‚
β”‚  β€’ Checks device verdict                β”‚
β”‚  β€’ Validates app licensing              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Verdict Types:

  • MEETS_DEVICE_INTEGRITY: Genuine Android device
  • MEETS_BASIC_INTEGRITY: Device passes basic checks
  • MEETS_STRONG_INTEGRITY: Device has strong security
  • MEETS_VIRTUAL_INTEGRITY: Legitimate Android emulator

Layer 3: Encryption at Rest

All sensitive data is encrypted using AES-256-GCM:

What’s Encrypted

  • API keys and secrets
  • OAuth tokens
  • Service credentials
  • Webhook signing keys

Key Management

  • Encryption key derived from ENCRYPTION_KEY environment variable
  • Keys never logged or exposed in error messages
  • Regular key rotation supported
  • Hardware security module (HSM) integration available for enterprise

Encryption Process

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Your API Key    β”‚  "sk-abc123xyz..."
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AES-256-GCM     β”‚  + Random IV
β”‚  Encryption      β”‚  + Auth Tag
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Encrypted Blob  β”‚  "aGVsbG8gd29ybGQ..."
β”‚  (Database)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer 4: Encryption in Transit

All communications use TLS 1.3 with:

Configuration

  • TLS 1.3 only (TLS 1.2 fallback available)
  • Strong cipher suites (AEAD only)
  • Perfect Forward Secrecy (PFS)
  • Certificate pinning in SDKs

Pinned Certificates

Our SDKs pin to ProtectMyAPI’s root certificate to prevent MITM attacks:

// iOS SDK - Certificate pinning is automatic
ProtectMyAPI.configure(appToken: "your-token")
// Pinning enabled by default
// Android SDK - Certificate pinning is automatic
ProtectMyAPI.configure(appToken = "your-token")
// Pinning enabled by default

Infrastructure Security

Network Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Cloudflare (WAF)                   β”‚
β”‚  β€’ DDoS protection  β€’ Rate limiting  β€’ Bot defense β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Load Balancer                    β”‚
β”‚              (Geographic distribution)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚               β”‚               β”‚
    β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
    β”‚ API Node  β”‚   β”‚ API Node  β”‚   β”‚ API Node  β”‚
    β”‚    #1     β”‚   β”‚    #2     β”‚   β”‚    #3     β”‚
    β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
          β”‚               β”‚               β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Internal Network (VPC)                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  PostgreSQL β”‚  β”‚    Redis    β”‚  β”‚   BullMQ    β”‚ β”‚
β”‚  β”‚  (Primary)  β”‚  β”‚   (Cache)   β”‚  β”‚   (Jobs)    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Server Security

  • Isolated VPC: Database not accessible from internet
  • Firewall rules: Whitelist-only access
  • Encrypted storage: All disks encrypted at rest
  • Regular patching: Automated security updates

Access Control

  • MFA required: All team members use 2FA
  • Audit logging: All admin actions logged
  • Principle of least privilege: Minimal access by default
  • IP allowlisting: Admin access from approved IPs only

Application Security

Authentication

  • JWT tokens: Short-lived (15 min) with refresh tokens
  • Secure cookies: HttpOnly, Secure, SameSite=Strict
  • Password hashing: bcrypt with cost factor 12
  • IP verification: New IPs require email verification

Rate Limiting

ResourceLimitWindow
API requests100/minPer IP
Auth attempts5/minPer IP
Password reset3/hourPer email
Account creation5/dayPer IP

Input Validation

  • Zod schemas: All input validated server-side
  • Parameterized queries: No SQL injection possible
  • Content-type validation: Strict MIME type checking
  • Size limits: Request body max 10MB

Data Protection

What We Store

DataEncryptedRetention
API keysβœ… AES-256Until deleted
Passwordsβœ… bcryptUntil deleted
Request logsβœ…30 days
Analytics❌Aggregated only
PII (email)❌Until deleted

What We Never Store

  • ❌ Plain-text API keys
  • ❌ Full request/response bodies
  • ❌ Credit card numbers (Stripe handles)
  • ❌ Biometric data

Data Deletion

  • Soft-delete with 30-day grace period
  • Hard-delete from all backups after 90 days
  • GDPR-compliant data export available

Compliance & Certifications

Current Compliance

  • GDPR: Full compliance for EU users
  • CCPA: California privacy rights
  • SOC 2 Type II: In progress
  • ISO 27001: Planned

Security Practices

  • Annual penetration testing
  • Quarterly vulnerability scans
  • Bug bounty program (coming soon)
  • Security incident response plan

Secure Development Practices

Code Security

  • Dependency scanning: Automated vulnerability detection
  • Code review: All changes peer-reviewed
  • Static analysis: ESLint security plugins
  • Secret scanning: Pre-commit hooks prevent credential leaks

CI/CD Security

  • Signed commits: GPG-signed releases
  • Protected branches: Main branch protected
  • Automated tests: Security tests in CI pipeline
  • Deployment approval: Manual approval for production

Incident Response

If You Suspect a Breach

Rotate your secrets

Immediately rotate all API keys in the dashboard under Services β†’ Manage β†’ Rotate Secret.

Check audit logs

Review the Analytics section for unusual activity patterns.

Contact us

Email [email protected] with details. We respond within 1 hour for security issues.

Enable additional protection

Consider enabling stricter attestation settings or IP allowlisting.

Our Commitment

  • 24-hour notification: We notify affected users within 24 hours of confirmed breach
  • Transparent communication: Full disclosure of what happened
  • Free remediation: No charge for breach-related support

Security Best Practices

For Your App

⚠️

Even with ProtectMyAPI, follow these security practices in your app.

  1. Keep SDKs updated: We patch security issues quickly
  2. Use certificate pinning: Enabled by default in our SDKs
  3. Enable all attestation checks: Don’t disable for production
  4. Monitor your analytics: Watch for unusual patterns
  5. Rotate secrets regularly: At least every 90 days

For Your Team

  1. Use strong passwords: 16+ characters, unique per account
  2. Enable MFA: Required for all team members
  3. Limit admin access: Only necessary people
  4. Review audit logs: Monthly at minimum

Security Contact

Report vulnerabilities: [email protected]

PGP Key: Available on request for encrypted communication

We take all security reports seriously and respond within 24 hours.