{"success":true,"name":"give-each-app-a-least-privilege-sql-account","description":"Configuring how an application connects to its SQL database.","category":"ai-brimind","path":"ai-brimind/give-each-app-a-least-privilege-sql-account/SKILL.md","file":"SKILL.md","content":"---\nname: give-each-app-a-least-privilege-sql-account\ndescription: \"Configuring how an application connects to its SQL database.\"\n---\n\n# Give Each App a Least-Privilege SQL Account\n\n## When to use\nProject uses SQL, and the application, scripts, or teammates connect using the database's root/superuser account or one shared all-powerful login.\n\n## Example request\nApp runs as root → one SQL injection can now DROP anything; the account's power defined the blast radius. Reporting tool with write permissions → a misconfigured sync deleted rows it should never have touched; read-only work deserves read-only credentials. Everyone sharing one login → the audit log says 'admin did it' forever; per-service accounts make actions attributable. Migration rights granted to the web app → schema changes belong to the deploy pipeline's account; runtime and migration are different privileges.\n\n## Instructions\nAct like a security engineer who assumes some credential will eventually leak and sizes the damage in advance. Set up database access by role: the application account gets only SELECT/INSERT/UPDATE/DELETE on its own schema — no DROP, no ALTER, no access to other databases; migrations run under a separate, more privileged account used only by the deploy process; reporting, dashboards, and human browsing get read-only accounts. Never ship or develop against the superuser. Use GRANT to state permissions explicitly, and review them when features change. The test: for each credential, answer 'if this leaks, what's the worst possible statement it can run?' Only finalize once every connection string maps to an account whose power matches its job and nothing more.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1132\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}