Profile Applicability:
- Level 1
Description:
Ensure that permissions granted to IAM users, roles, and Aurora database accounts follow the principle of least privilege—only allowing the minimum access required to perform necessary functions.
Rationale:
Applying least privilege limits the potential damage caused by accidental or malicious actions. It reduces the attack surface and helps maintain strong access control practices, both in IAM and within the database.
Impact:
Careful permission scoping requires additional administrative effort, but it significantly improves security by avoiding overly permissive access.
Default Value:
By default, IAM users and database users may be granted broad privileges unless explicitly restricted.
Pre-requisites:
IAM access with permissions to view users, roles, and policies
Access to the Aurora database for reviewing user privileges
Remediation:
Test Plan
Using AWS Console:
Sign in to the AWS Management Console
Navigate to IAM > Users and Roles
Review attached policies for each IAM identity
Verify permissions are scoped to specific services and actions
Connect to the Aurora DB via MySQL/PostgreSQL client
Run SHOW GRANTS FOR '<username>'@'<host>'; and confirm only required privileges are granted
Using AWS CLI:
List all IAM users
aws iam list-users
List all IAM roles
aws iam list-roles
List attached policies for a user
aws iam list-attached-user-policies --user-name <username>
List attached policies for a role
aws iam list-attached-role-policies --role-name <rolename>
Review policy contents
aws iam get-policy-version --policy-arn <policy-arn> --version-id <version-id>
Implementation Plan
Using AWS Console:
Sign in to the AWS Console
Go to IAM > Users or IAM > Roles
Click the target user or role
Remove broad policies like AdministratorAccess
Attach fine-grained, least privilege policies (e.g., AmazonRDSReadOnlyAccess)
Log into the Aurora database
Create a new database user if needed
Grant only required privileges using SQL:
GRANT SELECT, INSERT ON <database>.* TO '<username>'@'<host>';
Using AWS CLI:
Detach broad policy
aws iam detach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
Attach least privilege policy
aws iam attach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/AmazonRDSReadOnlyAccess
Log in to the Aurora database and run:
CREATE USER '<username>'@'<host>' IDENTIFIED BY '<password>'; GRANT SELECT, INSERT ON <database>.* TO '<username>'@'<host>';
Backout Plan
Using AWS Console:
Navigate to IAM > Users or Roles
Remove least privilege policy
Re-attach the previously used policy (if required)
Connect to the database
Revoke restricted privileges or drop the user
Using AWS CLI:
Detach least privilege policy
aws iam detach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/AmazonRDSReadOnlyAccess
Re-attach old policy
aws iam attach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
Revoke or drop the user in Aurora:
REVOKE ALL PRIVILEGES ON <database>.* FROM '<username>'@'<host>'; DROP USER '<username>'@'<host>';
References:
CIS AWS Database Services Benchmark v1.0.0, Section 2.8