Principle of Least Privilege
What you'll learn: How granting only the minimum necessary permissions reduces security risk and limits the blast radius of breaches.
What It Is
The Principle of Least Privilege (PoLP) means every user, process, service, or system component should have access to only the resources and permissions absolutely necessary to perform its legitimate function—nothing more.
Think of it like giving someone keys to your house. You wouldn't hand over keys to every room, drawer, and safe if they're only there to water your plants. They need access to the front door and wherever the plants are—that's it.
Why It Matters
When you grant excessive permissions "just in case" or because it's convenient, you create unnecessary risk:
- Compromised accounts cause less damage: If an attacker steals credentials with limited scope, they can't pivot to sensitive systems
- Mistakes have smaller impact: A developer with read-only database access can't accidentally
DROP TABLEin production - Insider threats are contained: Malicious actors can only harm what they can reach
- Compliance becomes easier: Many regulations require demonstrable access controls
Applying It
In practice, this means:
- Database users get read-only access unless they specifically need to write
- API keys are scoped to specific resources, not "admin everything"
- Service accounts have narrow permissions for their exact task
- Users start with minimal roles and request additional access when needed (not vice versa)
- Temporary elevated access expires automatically
This complements Defense in Depth by ensuring even if one layer fails, limited permissions prevent full compromise.
Key Takeaway: Grant the minimum permissions necessary for each function—reducing attack surface and containing damage when security fails.