OWASP / OWASP/OpenCRE

Continuity runbook: Production DB surgery

Open
#1,066 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

existing-maintainers-only
Dominant language
Python
Stars
180
Forks
137
Avg merge
3d 23h
Merged PRs (30d)
21

Description

Task

A second maintainer can run targeted SQL on production Postgres only through scripts/db/surgery-opencreorg.sh, with backup-first and the destructive confirmation phrase when needed.

Success criteria

  • Dry-run documented: how to classify a SQL file as destructive vs not
  • Operator will not run destructive SQL without exact I_UNDERSTAND_OPENCREORG_PROD_DB_DESTRUCTIVE_ACTION plus --destructive
  • No ad-hoc heroku pg:psql workaround in the runbook path
  • Runbook docs/continuity/runbooks/production-db-surgery.md (skill continuity-production-db-surgery)

Context

  • .cursor/rules/production-db-ops-safety.mdc
  • Wrapper does not parse SQL for DROP; humans must pass --destructive when the file deletes/drops

Constraints

  • existing maintainers only
  • Confirm APP_NAME (default opencreorg) and the SQL file path before running
  • Never paste DATABASE_URL

Agent prompt

See Agent prompt in docs/continuity/runbooks/production-db-surgery.md.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read .cursor/rules/production-db-ops-safety.mdc, scripts/db/surgery-opencreorg.sh, and the existing docs/continuity/runbooks/production-db-surgery.md. Verify the runbook covers dry-run classification, backup-first execution, the exact destructive confirmation and --destructive requirement, APP_NAME and SQL path confirmation, and the prohibition on ad-hoc heroku pg:psql or exposing DATABASE_URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, shell
Domain
databases, documentation, security
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.