Module 05 SAA
Module 05 SAA
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module overview
Sections Demonstration
• EC2 Instance Profile
1. Architectural need
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2
Module objectives
At the end of this module, you should be able to:
• Explain the purpose of AWS Identity and Access Management (IAM) users,
groups, and roles
• Describe how to allow user federation within an architecture to increase security
• Recognize how AWS Organizations service control policies (SCPs) increase
security within an architecture
• Describe how to manage multiple AWS accounts
• Configure IAM users
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
Section 1: Architectural need
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Café business requirement
The café needs to define what level of access users and systems should have
across cloud resources and then put these access controls into place across
the AWS account.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
Section 2: Account users and IAM
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Secure the root account
The account root user has a large amount of power. Recommended security steps:
IAM user
Granular permissions
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
AWS Identity and Access Management (IAM)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
IAM components: Review
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10
IAM permissions
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
IAM permissions
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
Identity-based versus resource-based policies
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13
IAM policy document structure
{ • Effect: Effect can be either Allow or Deny
"Version": "2012-10-17",
"Statement":[{ • Action: Type of access that is allowed or denied
"Effect": "effect",
"Action": "action", "Action": "s3:GetObject"
"Resource": "arn",
"Condition":{ • Resource: Resources that the action will act on
"condition":{
"Resource": "arn:aws:sqs:us-west-2:125456789012:queue1"
"key": "value"
}
} • Condition: Conditions that must be met for the rule to apply
}]
"Condition" : {
}
"StringEquals" : {
"aws:username" : "johndoe"
}
}
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
ARNs and wildcards
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
IAM policy example
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16
Activity:
Examining IAM
policies
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17
Activity: IAM policy analysis (1 of 5)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
Activity: IAM policy analysis (1 of 5) - Answers
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
Activity: IAM policy analysis (2 of 5)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
Activity: IAM policy analysis (2 of 5) - Answers
Consider this IAM policy, then answer the questions as they are presented.
1. Does the policy allow you to terminate any EC2 instance
at any time without conditions?
• ANSWER: No. The first statement object allows it.
However, the second statement object applies a
condition.
2. Are you allowed to make the terminate instance call from
anywhere?
• ANSWER: No. You can only make the request from
one of the two IP address ranges that are specified in
aws:SourceIp.
3. Can you terminate instances if you make the call from a
server that has an assigned IP address of [Link]?
• ANSWER: Yes, because the [Link]/24 Classless
Inter-Domain Routing (CIDR) IP address range
includes IP addresses [Link] through [Link].
A resource like the CIDR to IP Range tool can be used
to calculate the range of a CIDR block.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21
Activity: IAM Policy analysis (5 of 5)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
Activity: IAM Policy analysis (5 of 5)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
Section 2 key • Avoid using the account root user for common
tasks. Instead, create and use IAM user credentials.
takeaways
• Permissions for accessing AWS account resources
are defined in one or more IAM policy documents.
• Attach IAM policies to IAM users, groups, or roles.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
Section 5: Organizing users
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IAM groups
Use IAM groups to grant the same access
rights to multiple users. One-off approach to
managing access.
IAM policy B
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 26
Example IAM groups
Sofía Jane
• Users can belong to more than one group
• However the most restrictive policy will then apply
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
Use case for IAM with Amazon S3
IAM user
zhang
Member
of
IAM group
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
IAM Group
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29
Section 4: Access to AWS
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Access Key
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
AWS Access Key
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
AWS CLI
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
AWS CLI
Please switch to one of these regions if you want to do the next (optional) hands-on.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 34
AWS SDK
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 35
Section 5: IAM Roles
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IAM roles
• IAM role characteristics AWS account 2
• Provides temporary security credentials IAM
• Is not uniquely associated with one person user
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 37
IAM roles
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 38
Demonstration:
EC2 Instance
Profile
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 39
Summary: EC2 instance profile demonstration
Scenario:
• An application that runs on an EC2 AWS Cloud
instance needs access to an S3 bucket Application has
permissions to
Amazon EC2 instance access the S3
bucket
Solution: Application
5
• Define an IAM policy that grants access S3 bucket
to the S3 bucket Role assumed by
2
• Attach the policy to a role the EC2 instance
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 40
Section 6: Securing your account
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Password Policy
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 42
Multi-Factor Authentication (MFA)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 43
Multi-Factor Authentication (MFA)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 44
Multi-Factor Authentication (MFA)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 45
IAM Security Tools
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 46
IAM Best Practices
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 47
Module 5 –
Challenge Lab:
Controlling AWS
Account Access
by Using IAM
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 48
The business need: User access control
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 50
Challenge lab: Final product
AWS Cloud Region Parameter
IAM resources Store
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 51
~ 80 minutes
Begin Module 5 –
Challenge Lab:
Controlling AWS
Account Access by Using
IAM
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 52
Challenge lab
debrief:
Key takeaways
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 53
Module wrap-up
Module 5: Securing Access
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module summary
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 55
Complete the knowledge check
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 56
Sample exam question
A company is storing an access key (access key ID and secret access key) in a text file on a custom AMI.
The company uses the access key to access DynamoDB tables from instances created from the AMI.
The security team has mandated a more secure solution.
Which solution will meet the security team’s mandate?
Choice Response
A Put the access key in an S3 bucket, and retrieve the access key on boot from the instance.
B Pass the access key to the instances through instance user data.
C Obtain the access key from a key server launched in a private subnet.
Create an IAM role with permissions to access the table, and launch all instances with the new
D
role.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 57
Sample exam question answer
A company is storing an access key (access key ID and secret access key) in a text file on a custom AMI.
The company uses the access key to access DynamoDB tables from instances created from the AMI.
The security team has mandated a more secure solution.
Which solution will meet the security team’s mandate?
The correct answer is D.
The keywords in the question are “storing an access key”, “DynamoDB tables from instances”,
“custom AMI”, and “most secure solution”.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 58
Additional resources
• AWS Well-Architected Framework – Security Pillar
• IAM FAQs
• Creating IAM policies video
• Identity at different layers video
• Identity Providers and Federation
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 59
Thank you
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 60