2.1.1.2. Principle of Least Privilege
š” First Principle: The Principle of Least Privilege (PoLP) grants only the minimum permissions needed for a user or service to perform its task, reducing the attack surface and limiting the impact of a breach.
The Principle of Least Privilege (PoLP) grants only the minimum permissions needed for a user or service to perform its task. This reduces the attack surface and limits the impact of a breach.
PoLP is a fundamental security best practice. Instead of granting broad access (e.g., full administrator access), you grant only the specific permissions required for an IAM identity to perform its intended function.
Key Aspects of PoLP:
- Minimal Permissions: Grant only what's necessary.
- Reduced Attack Surface: Fewer ways for attackers to exploit privileges.
- Limited Blast Radius: If a credential is compromised, impact is contained.
- Auditable: Easier to audit and understand access patterns.
Scenario: An IAM user is responsible for managing S3 backups. Instead of granting AmazonS3FullAccess
to all S3 resources, the IAM policy should only allow s3:PutObject
and s3:GetObject
permissions on a specific backup bucket.
Visual: Principle of Least Privilege
Loading diagram...
ā ļø Common Pitfall: Granting *
(all actions) on *
(all resources) just to get something working quickly, leading to massive security holes.
Key Trade-Offs:
- Security (Least Privilege) vs. Administrative Overhead: Implementing least privilege requires more time and knowledge to craft precise policies, but it's a critical security control.
Reflection Question: How does applying PoLP to an AWS Lambda function's execution role (granting it only access to specific resources it needs) fundamentally enhance your serverless application's security posture?