---
title: "What is the principle of least privilege?"  
description: "What is the principle of least privilege?"  
author: "Khoa Vu"  
published: 2026-11-19  
updated: 2026-11-19  
canonical: https://www.mindstick.com/forum/163086/what-is-the-principle-of-least-privilege  
category: "Cloud and Security"  
tags: ["least privilege", "access control", "security", "IAM", "best practices"]  
reading_time: 1 minute  

---

# What is the principle of least privilege?

Our app connects to the database as an administrator. A reviewer said it violates least privilege. What does that mean?

## Replies

### Reply by Magdalena Krawczyk

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.


---

Original Source: https://www.mindstick.com/forum/163086/what-is-the-principle-of-least-privilege

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
