{"success":true,"name":"grant-least-privilege-to-every-credential-and-connection","description":"Creating or using a DB user, API key, or token with broad powers.","category":"ai-brimind","path":"ai-brimind/grant-least-privilege-to-every-credential-and-connection/SKILL.md","file":"SKILL.md","content":"---\nname: grant-least-privilege-to-every-credential-and-connection\ndescription: \"Creating or using a DB user, API key, or token with broad powers.\"\n---\n\n# Grant Least Privilege to Every Credential and Connection\n\n## When to use\nYou are configuring access (database user, API key, service token), and the easy option is one all-powerful credential used everywhere.\n\n## Example request\nWeb app connects to the database as root/admin → one SQL injection now owns every table and can DROP them — maximum blast radius. Read-only reporting script uses the main write credential → a bug in a report can corrupt data — power it never needed. One API key shared across three apps → it leaks once and everything must be rotated; nobody knows which app leaked it — unscoped shared secret.\n\n## Instructions\nAct like a security engineer who sizes every credential to its job, not to convenience. For each credential or connection: (1) list what the code ACTUALLY needs — which tables, read or write, which API endpoints, which folders — and request exactly that; a web app rarely needs DDL rights, a report never needs writes; (2) separate credentials per purpose (app runtime vs migrations vs reporting vs each external integration) so a leak or bug is contained to one scope and rotation doesn't break everything; (3) when a task needs elevated power (migration, admin script), use a dedicated elevated credential for that moment only — don't upgrade the everyday one. Ask the blast-radius question for each credential: 'if this exact secret leaked tonight, what's the worst possible damage?' If the answer includes things the code never legitimately touches, the privilege is too wide. Only proceed once each credential's scope matches its real usage and you can justify every permission it holds.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1091\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}