Infra-Ops SOP
1. Monitoring
Set up monitoring BEFORE you need it. Three layers, in priority order:
Uptime monitoring (must-have day 1):
- UptimeRobot (free, checks every 5 min) or BetterStack
- Monitor: main app URL, API health endpoint, database connectivity
- Alert chain: Slack/email for P1-P3 → phone call for P0
Error tracking (must-have day 1):
- Sentry free tier — captures stack traces with user context
- Set up source maps for frontend, proper error grouping
- Alert on new error types, not every occurrence
Performance baselines (set up by launch):
- Track p50/p95/p99 response times for key endpoints
- Set alerts when p95 > 2x baseline for 5+ minutes
- Database query time monitoring (slow query log)
Source: CloudEagle SaaS Security Checklist, DesignRevision SaaS Security Checklist
2. Staging/Preview Environments
Staging environments are required for the automated release gate (staging-verify). The dev branch must auto-deploy to a preview URL.
Platform Configuration:
| Platform |
How to Enable Dev Preview |
Stable Branch URL Pattern |
| Vercel |
Automatic for all branches via Git Integration |
<project>-git-dev-<scope>.vercel.app |
| Netlify |
Site settings → Branch deploys → add dev |
dev--<site-name>.netlify.app |
| Railway |
Create environment per branch |
Custom domain per environment |
| Render |
Dashboard → Preview Environments |
<service>-dev.onrender.com |
| Fly.io |
Separate fly.staging.toml config |
Custom staging subdomain |
Staging must have:
- Same monitoring as production (uptime checks, error tracking)
- Isolated data (separate database, separate API keys)
- Separate secrets from production
Troubleshooting:
- Not deploying: check platform dashboard and CI/CD logs
- URL returning 404: verify the build succeeded on the platform
- Out of date: compare deployed commit with
git rev-parse dev
3. Backup Strategy — 3-2-1 Rule
3 copies, 2 different media, 1 offsite. Non-negotiable.
| Data type |
Backup method |
Frequency |
Retention |
| Database |
Automated pg_dump / mysqldump to object storage |
Daily |
30 days rolling + weekly for 90 days |
| User uploads |
Replicated cloud storage (e.g., S3 cross-region) |
Real-time replication |
Match user data retention policy |
| Code |
Git (already distributed) |
Every push |
Indefinite |
| Config/secrets |
Encrypted export to separate secure store |
On change |
Last 10 versions |
Critical: test restore monthly. A backup you've never restored is not a backup — it's a hope.
Source: Cohesity — 3-2-1 Backup Rule, Rewind — 3-2-1 for SaaS
4. Incident Response
Follow the NIST framework adapted for solo/small teams:
Severity levels:
- P0 — Service down, all users affected → drop everything, fix now
- P1 — Major feature broken, many users affected → fix within 4 hours
- P2 — Minor feature broken, workaround exists → fix within 24 hours
- P3 — Cosmetic/low-impact issue → fix in next sprint
Response playbook:
- Detect — monitoring alert fires or user reports
- Triage — assign severity (P0-P3), estimate blast radius
- Communicate — update status page within 15 min for P0/P1
- Template: "We're aware of [issue]. Impact: [who's affected]. ETA: [time or 'investigating']."
- Fix — contain first (rollback, feature flag off), then root-cause fix
- Post-mortem (required for P0/P1, within 48 hours):
- What happened (timeline)
- Why it happened (root cause, not blame)
- How to prevent it (concrete action items with owners and deadlines)
Source: TechTarget — Incident Response Plan, Sygnia — SaaS Incident Response
5. Security Checklist
Transport & access:
Application:
Infrastructure:
Source: DesignRevision — SaaS Security Checklist
6. Disaster Recovery
Define targets early, revisit quarterly:
- RTO (Recovery Time Objective): max acceptable downtime. Solo SaaS target: < 4 hours.
- RPO (Recovery Point Objective): max acceptable data loss. Solo SaaS target: < 24 hours (daily backups).
DR plan essentials:
- Documented runbook: "if X dies, do Y" for each critical component
- Database: can restore from backup to new instance in < 2 hours
- App server: infrastructure-as-code so you can spin up a new one in < 1 hour
- DNS: low TTL (300s) so failover propagates fast
- Test the full DR plan quarterly — actually do a restore drill
Source: ATOZDEBUG — Disaster Recovery for SaaS, MightyID — Optimizing RPO & RTO
7. Maintenance Schedule
| Frequency |
Task |
| Weekly |
Check error logs and alert trends, run dependency audit, review uptime reports |
| Monthly |
Test backup restore, review access logs, update dependencies, check infrastructure costs |
| Quarterly |
Full security audit, DR drill (test restore to new environment), review RTO/RPO targets, infrastructure cost optimization |
| Annually |
Rotate all credentials/API keys, review and update incident response plan, evaluate monitoring stack |
Next Steps
Report to user: "Infrastructure: [what was set up/fixed]. Status: [healthy/issues]"
Suggested next steps (user decides):
- Monitoring done → "Resume development"
- Incident occurred → "Run data-decide for impact analysis"
- Security audit done → "Run legal-guard"
1---2name: infra-ops3description: Manages infrastructure, monitoring, backups, and incident response. Triggers ONLY when: user asks to set up monitoring, plan backup strategy, handle an incident, or review infrastructure security. Do NOT trigger during normal development.4---56# Infra-Ops SOP78## 1. Monitoring910Set up monitoring BEFORE you need it. Three layers, in priority order:1112**Uptime monitoring (must-have day 1):**13- UptimeRobot (free, checks every 5 min) or BetterStack14- Monitor: main app URL, API health endpoint, database connectivity15- Alert chain: Slack/email for P1-P3 → phone call for P01617**Error tracking (must-have day 1):**18- Sentry free tier — captures stack traces with user context19- Set up source maps for frontend, proper error grouping20- Alert on new error types, not every occurrence2122**Performance baselines (set up by launch):**23- Track p50/p95/p99 response times for key endpoints24- Set alerts when p95 > 2x baseline for 5+ minutes25- Database query time monitoring (slow query log)2627> Source: [CloudEagle SaaS Security Checklist](https://www.cloudeagle.ai/blogs/ultimate-saas-security-checklist), [DesignRevision SaaS Security Checklist](https://designrevision.com/blog/saas-security-checklist)2829## 2. Staging/Preview Environments3031Staging environments are required for the automated release gate (`staging-verify`). The `dev` branch must auto-deploy to a preview URL.3233**Platform Configuration:**3435| Platform | How to Enable Dev Preview | Stable Branch URL Pattern |36|---|---|---|37| Vercel | Automatic for all branches via Git Integration | `<project>-git-dev-<scope>.vercel.app` |38| Netlify | Site settings → Branch deploys → add `dev` | `dev--<site-name>.netlify.app` |39| Railway | Create environment per branch | Custom domain per environment |40| Render | Dashboard → Preview Environments | `<service>-dev.onrender.com` |41| Fly.io | Separate `fly.staging.toml` config | Custom staging subdomain |4243**Staging must have:**44- Same monitoring as production (uptime checks, error tracking)45- Isolated data (separate database, separate API keys)46- Separate secrets from production4748**Troubleshooting:**49- Not deploying: check platform dashboard and CI/CD logs50- URL returning 404: verify the build succeeded on the platform51- Out of date: compare deployed commit with `git rev-parse dev`5253## 3. Backup Strategy — 3-2-1 Rule5455**3** copies, **2** different media, **1** offsite. Non-negotiable.5657| Data type | Backup method | Frequency | Retention |58|---|---|---|---|59| Database | Automated pg_dump / mysqldump to object storage | Daily | 30 days rolling + weekly for 90 days |60| User uploads | Replicated cloud storage (e.g., S3 cross-region) | Real-time replication | Match user data retention policy |61| Code | Git (already distributed) | Every push | Indefinite |62| Config/secrets | Encrypted export to separate secure store | On change | Last 10 versions |6364**Critical:** test restore monthly. A backup you've never restored is not a backup — it's a hope.6566> Source: [Cohesity — 3-2-1 Backup Rule](https://www.cohesity.com/glossary/321-backup-rule/), [Rewind — 3-2-1 for SaaS](https://rewind.com/321-backup-rule/)6768## 4. Incident Response6970Follow the NIST framework adapted for solo/small teams:7172**Severity levels:**73- **P0** — Service down, all users affected → drop everything, fix now74- **P1** — Major feature broken, many users affected → fix within 4 hours75- **P2** — Minor feature broken, workaround exists → fix within 24 hours76- **P3** — Cosmetic/low-impact issue → fix in next sprint7778**Response playbook:**79801. **Detect** — monitoring alert fires or user reports812. **Triage** — assign severity (P0-P3), estimate blast radius823. **Communicate** — update status page within 15 min for P0/P183 - Template: "We're aware of [issue]. Impact: [who's affected]. ETA: [time or 'investigating']."844. **Fix** — contain first (rollback, feature flag off), then root-cause fix855. **Post-mortem** (required for P0/P1, within 48 hours):86 - What happened (timeline)87 - Why it happened (root cause, not blame)88 - How to prevent it (concrete action items with owners and deadlines)8990> Source: [TechTarget — Incident Response Plan](https://www.techtarget.com/searchsecurity/feature/5-critical-steps-to-creating-an-effective-incident-response-plan), [Sygnia — SaaS Incident Response](https://www.sygnia.co/blog/saas-incident-response/)9192## 5. Security Checklist9394**Transport & access:**95- [ ] HTTPS everywhere (no mixed content, HSTS enabled)96- [ ] Secrets in env vars or secret manager — NEVER in code or git97- [ ] MFA for admin accounts and cloud provider console98- [ ] CORS configured to allow only your domains99100**Application:**101- [ ] Rate limiting on auth endpoints (login, signup, password reset)102- [ ] CSP (Content Security Policy) headers configured103- [ ] Input validation and parameterized queries (prevent SQLi/XSS)104- [ ] Dependency audit weekly (`npm audit` / `pip audit` / `cargo audit`)105106**Infrastructure:**107- [ ] Minimal open ports — only 80/443 publicly accessible108- [ ] Database not publicly accessible (VPC/private network only)109- [ ] Automated security updates for OS packages110- [ ] Logging enabled for all access and auth events111112> Source: [DesignRevision — SaaS Security Checklist](https://designrevision.com/blog/saas-security-checklist)113114## 6. Disaster Recovery115116Define targets early, revisit quarterly:117118- **RTO (Recovery Time Objective):** max acceptable downtime. Solo SaaS target: < 4 hours.119- **RPO (Recovery Point Objective):** max acceptable data loss. Solo SaaS target: < 24 hours (daily backups).120121**DR plan essentials:**1221. Documented runbook: "if X dies, do Y" for each critical component1232. Database: can restore from backup to new instance in < 2 hours1243. App server: infrastructure-as-code so you can spin up a new one in < 1 hour1254. DNS: low TTL (300s) so failover propagates fast1265. Test the full DR plan quarterly — actually do a restore drill127128> Source: [ATOZDEBUG — Disaster Recovery for SaaS](https://atozdebug.com/disaster-recovery-for-saas/), [MightyID — Optimizing RPO & RTO](https://www.mightyid.com/how-to-optimize-rpo-and-rto-in-disaster-recovery-plans/)129130## 7. Maintenance Schedule131132| Frequency | Task |133|---|---|134| **Weekly** | Check error logs and alert trends, run dependency audit, review uptime reports |135| **Monthly** | Test backup restore, review access logs, update dependencies, check infrastructure costs |136| **Quarterly** | Full security audit, DR drill (test restore to new environment), review RTO/RPO targets, infrastructure cost optimization |137| **Annually** | Rotate all credentials/API keys, review and update incident response plan, evaluate monitoring stack |138139## Next Steps140Report to user: "Infrastructure: [what was set up/fixed]. Status: [healthy/issues]"141142Suggested next steps (user decides):143- Monitoring done → "Resume development"144- Incident occurred → "Run data-decide for impact analysis"145- Security audit done → "Run legal-guard"