Time to Complete: 45-60 minutes | Exam Weight: ~15-20%
USERS → GROUPS → POLICIES → ROLES
People Collections Permissions Services
Memory Aid: "U Go Play Rugby" = Users, Groups, Policies, Roles
- Root user = Never use for daily tasks
- IAM users = People & applications
- Roles = AWS services & temporary access
- Policies = JSON documents defining permissions
- Groups = Organize users, apply policies
| Component | Who/What | Credentials | Best For |
|---|---|---|---|
| Users | People/Apps | Long-term | Individual access |
| Groups | User collections | None | Organize by job function |
| Roles | AWS services | Temporary | EC2, Lambda, cross-account |
| Policies | JSON rules | None | Define permissions |
| Type | Scope | Use Case |
|---|---|---|
| Managed - AWS | Pre-built by AWS | Common permissions |
| Managed - Customer | You create & reuse | Custom reusable |
| Inline | Attached to 1 entity | 1:1 strict relationship |
| Identity-based | Users/Groups/Roles | Who can do what |
| Resource-based | Resources (S3, etc) | Who can access this |
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow/Deny",
"Principal": "who",
"Action": "service:operation",
"Resource": "arn:aws:service:region:account:resource",
"Condition": "optional conditions"
}]
}Memory Aid: Very Effective Statements Provide Actions on Resources with Conditions
Decision Flow:
1. Default = DENY
2. Check for explicit DENY → If yes, DENY (stop here)
3. Check for explicit ALLOW → If yes, ALLOW
4. If no ALLOW found → DENY
Rule: Explicit DENY > Explicit ALLOW > Default DENY
Account A Account B
├── User needs access → ├── Resource (S3)
└── Assume Role → └── Trust Policy
Steps: Create role in Account B → Add trust policy → User assumes role
Question: EC2 instance needs to access S3 bucket ❌ WRONG: Store credentials on EC2 ✅ CORRECT: Create IAM role, attach to EC2 instance
Question: External auditor needs temporary access ✅ CORRECT: Use IAM role with trust policy, provide temporary credentials
Question: Allow S3 access only from office IP
✅ CORRECT: Use Condition with aws:SourceIp
"Condition": {
"IpAddress": {
"aws:SourceIp": "203.0.113.0/24"
}
}Question: Require MFA to delete S3 objects
✅ CORRECT: Use Condition with aws:MultiFactorAuthPresent
- Users = Long-term credentials
- Roles = Temporary credentials
- Groups = Cannot be nested (no groups in groups)
- Policies = JSON permissions documents
- IAM = Global service (not regional)
| Type | Example | Use Case |
|---|---|---|
| Virtual | Google Authenticator | Most common |
| Hardware | YubiKey | High security |
| AWS | AWS device | AWS-specific |
| SMS | Text message | Deprecated (not recommended) |
1. CONSOLE ACCESS
└── Username + Password (+ MFA)
2. PROGRAMMATIC ACCESS
└── Access Key ID + Secret Access Key
- ✅ Enable MFA for root account
- ✅ Never use root for daily tasks
- ✅ Create individual IAM users
- ✅ Use groups to assign permissions
- ✅ Grant least privilege
- ✅ Use roles for EC2/Lambda
- ✅ Rotate credentials regularly
- ✅ Use strong password policy
- ✅ Monitor with CloudTrail
- ✅ Remove unnecessary credentials
- Max 5,000 users per account
- Max 300 groups per account
- User can be in max 10 groups
- Max 2 access keys per user
- Max 10 managed policies per user/group/role
1. Start with DENY (default)
2. Evaluate all policies
3. Explicit DENY? → DENY immediately
4. Explicit ALLOW? → ALLOW
5. No ALLOW? → DENY
- Minimum length
- Require uppercase
- Require lowercase
- Require numbers
- Require symbols
- Password expiration
- Prevent reuse
- Never commit to code repositories
- Rotate every 90 days
- Delete if not used
- Use IAM roles instead when possible
- Users: Permanent credentials, max 2 access keys
- Groups: Organize users, can't nest, no credentials
- Roles: Temporary credentials, for services & cross-account
- Policies: JSON permissions, explicit deny wins
- Root: Enable MFA, lock away, never use daily
- Service: Global (not regional), free
- Best Practice: Least privilege always
❌ Using root account for daily tasks ❌ Embedding credentials in code ❌ Creating access keys when role would work ❌ Granting broad permissions (use least privilege) ❌ Forgetting to rotate credentials ❌ Not enabling MFA on privileged accounts ❌ Thinking groups can contain groups (they can't!)
Policy Decision Questions (Answers at bottom)
- User has ALLOW in identity policy, DENY in resource policy. Result? __
- No explicit policies attached to user. Result? __
- Best way to give EC2 access to DynamoDB? __
- Can groups be nested? __
- IAM is regional or global? __
- Maximum access keys per user? __
| Condition | Purpose | Example Use |
|---|---|---|
aws:SourceIp |
IP restriction | Office-only access |
aws:MultiFactorAuthPresent |
Require MFA | Sensitive operations |
aws:CurrentTime |
Time-based | Business hours only |
aws:SecureTransport |
Force HTTPS | Secure connections |
aws:userid |
Specific user | User-specific access |
- Time spent: ~45-60 min
- Practice: Write sample policies
- Ready for: IAM practice questions
- Move to: Module 03 - Compute
Quick Answers:
- DENY (explicit deny wins)
- DENY (default)
- IAM Role attached to EC2
- No
- Global
- 2