The principle of least privilege says that each person, program or service should have only the permissions necessary to do its job, and only for as long as needed.
Why it matters: if an account is hacked, misused or buggy, the damage is limited to what that account can do. An application that connects as database admin can, if exploited (for example by SQL injection), read every table, drop data or change the server.
In practice:
Create a dedicated database login for the app with permissions only on the objects it uses (for example SELECT, INSERT, UPDATE on certain tables, or EXECUTE on stored procedures). No sysadmin or db_owner.
Use separate accounts for deployment, migrations and the running app.
Give staff role-based access, review it regularly and remove it when people change roles or leave.
Use temporary elevated access where possible.
Give cloud services and API keys narrow scopes.
It takes a little planning but greatly reduces risk.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The principle of least privilege says that each person, program or service should have only the permissions necessary to do its job, and only for as long as needed.
Why it matters: if an account is hacked, misused or buggy, the damage is limited to what that account can do. An application that connects as database admin can, if exploited (for example by SQL injection), read every table, drop data or change the server.
In practice:
It takes a little planning but greatly reduces risk.