SlideShare une entreprise Scribd logo
1  sur  47
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
Identity & Access Management:
The First Step in AWS Security
Reef D’Souza
Security Consultant
AWS Professional Services
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Agenda
• Overview of AWS Identity & Access Management
• IAM Authentication & Authorization
• AWS Identity Federation
• AWS Organizations & Service Control Policies
• Recap of Best Practices
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Identity & Access Management
IAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is IAM?
• IAM is a preventive security control
• What is a security control?
– Any hardware, software, policy or
procedure meant to govern access
to IT resources
• A preventive security control is one
intended to thwart unwanted or
unauthorized activity
Directive
Preventive
Detective
Responsive
CAF Security
Perspective
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is AWS IAM?
• Create and manage AWS users and groups and use permissions to
allow and deny access to AWS resources
• Integrates with Microsoft Active Directory using SAML identity
federation and AWS Directory Service
• Roles can be created and assumed to control what operations can be
performed by an entity or AWS service (e.g. EC2 instance)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Why use AWS IAM?
• You can specify permissions to control which operations a user or role
can perform on AWS resources
• IAM service provides access to the AWS Management Console, AWS
API, and AWS Command-Line Interface (CLI)
Note: IAM does not provide authentication for your OS or application
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Users?
• IAM users can be an individual, system, or application requiring access
to AWS services
• A user account consists of a unique name and security credentials
such as a password, access key, and/or multi-factor authentication
(MFA)
• IAM users only need passwords when they access the AWS
Management Console
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Groups?
• IAM Groups are a way to assign permissions to logical and functional
units of your organization
• IAM Groups are a tool to help with operational efficiency
– Bulk permissions management (scalable)
– Easy to change permissions as individuals change teams (portable)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Roles?
• An IAM role is similar to a user, in that it is an AWS identity with
permission policies that determine what the identity can and cannot
do in AWS.
• You can authorize roles to be assumed by humans, Amazon EC2
instances, custom code, or other AWS services
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Authentication & Authorization
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Access Keys?
• IAM access keys are used to make programmatic calls to AWS using
the AWS Command Line Interface (CLI), the AWS SDKs, or direct
HTTPS calls to the APIs for individual AWS services
• Consists of an Access Key ID and a Secret Access Key
• Example:
– Access Key ID: AKIA3R7HGUSSI4BOW
– Secret Access Key: MxQ4QSzT0NsnEO5VNCYjJo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the signing process?
• AWS Signature Version 4 is the process to add authentication
information to AWS requests.
– The AWS SDKs or CLI tools will construct, sign, and send requests for you,
with the access keys you provide.
– If you are constructing AWS API requests yourself, you will have to
include code to sign the requests.
• http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM passwords?
• IAM passwords are credentials used by IAM users to authenticate to
the AWS Management Console.
• A password policy can be configured for the AWS account
• Alphanumeric and common special characters are allowed:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | ‘
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
When should I use Access Keys vs. passwords?
• Depends on how your users will access AWS
– Console → Password
– API, CLI, SDK → Access keys
• In either case, make sure to rotate credentials regularly
– Use Credential Report to audit credential rotation
– Configure password policy
– Configure policy to allow access key rotation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is an IAM principal?
• IAM principal refers to a user, account, service, role, or other entity
• In terms of evaluating authorization, a principal is defined as the
entity that is allowed or denied access to a resource.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM policies?
• IAM policies are JSON-based statements that define access control
and permissions
• IAM polices can be “inline” or “managed”
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Example IAM policy
{ "Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::example_bucket”
}
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Policies?
• Inline policies are policies that you create and manage, and that are
embedded directly into a single user, group, or role.
• Managed policies are standalone policies that you can manage
separately from the IAM users, groups, or roles to which they are
attached
– AWS managed policies
– Customer managed polices
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Choosing Inline vs Managed Policies
• Use inline policies when you need to:
– Enforce a strict one-to-one relationship between policy and principal
– Avoid the wrong policy being attached to a principal
– Ensure the policy is deleted when deleting the principal
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Choosing Inline vs Managed Policies
• Use managed policies when you need:
– Reusability
– Central change management
– Versioning and rollback
– Delegation of permissions management
– Automatic updates for AWS managed policies
– Larger policy size
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are Resource-based policies?
• To specify resource-based permissions, you attach an inline policy to a
supported resource, such as an Amazon SNS topic, an Amazon S3
bucket, an AWS KMS key, or an Amazon Glacier vault.
• Resource-based policies must specify who is allowed to access the
resource, known as the Principal.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Policy structure
Identity-based policy Resource-based policy
{
"Statement":[{
"Effect":"effect",
"Principal":"principal",
"Action":"action",
"Resource":"arn",
"Condition":{
"condition":{
"key":"value" }
}
}
]
}
{
"Statement":[{
"Effect":"effect",
"Action":"action",
"Resource":"arn",
"Condition":{
"condition":{
"key":"value" }
}
}
]
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the key difference?
• With Identity-based Policies, the Principal is implicit.
• With Resource-based Policies, the Principal is explicit.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Evaluation Logic
• By default, the decision is default deny
• An allow overrides any default denies
• An explicit deny overrides any allows
• The order in which the policies are evaluated is not important
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Policy Evaluation Logic
Final decision =“deny”
(explicit deny)
Yes
Final decision =“allow”
Yes
No Is there an
Allow?
4
Decision
starts at Deny
1
Evaluate all
applicable
policies
2
Is there an
explicit
deny?
3
No Final decision =“deny”
(default deny)
5
• AWS retrieves all policies
associated with the user
and resource.
• Only policies that match the
action and conditions are
evaluated.
If a policy statement
has a deny, it trumps all
other policy statements.
Access is granted if
there is an explicit
allow and no deny.
By default, an
implicit (default)
deny is returned.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Prevent Privilege Escalation
• Any principal with full IAM permissions is effectively a super user,
even if no other permissions have been granted.
• Why? The principal can modify its own permissions at any time.
• To prevent this, deny access to at least these IAM actions:
– iam:AttachUserPolicy
– iam:AttachGroupPolicy
– iam:AttachRolePolicy
– iam:PutUserPolicy
– iam:PutGroupPolicy
– iam:PutRolePolicy
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the IAM Policy Simulator?
The IAM policy
simulator allows
you to test policies
against resources
in your account
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the IAM Policy Simulator?
• Test policies that are attached to IAM users, groups, or roles in your
AWS account.
• Test policies that are attached to AWS resources, such as Amazon S3
buckets, Amazon SQS queues, Amazon SNS topics, or Amazon Glacier
vaults
• Test new policies that are not yet attached to a user, group, or role by
typing or copying them into the simulator.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the IAM Policy Simulator?
• Test the policies with selected services, actions, and resources.
• Simulate real-world scenarios by providing context keys, such as an IP
address or date, that are included in Condition elements in the
policies being tested.
• Identify which specific statement in a policy results in allowing or
denying access to a particular resource or action.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is the IAM Policy Generator?
The AWS IAM Console
has a simple GUI that
helps you build your IAM
policies.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Identity Federation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Identity Federation
Before:
After:
Unique
Credentials
Single sign-
on
Long Lived
Keys
Short-term
tokens
One-off
Naturally
aligned
Users Security Compliance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Users vs. Federated Users
• IAM supports users managed in AWS’s identity management system
• Users managed outside of AWS in your corporate directory are
referred to as “federated users”
– Examples of corporate directories, include Microsoft Active Directory,
PingFederate, Okta Univeral Directory, etc.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What are IAM Identity Providers?
• IAM identity providers allow you to use identities managed outside of
AWS instead of creating IAM users in your AWS account
• You don’t have to create custom sign-in code or manage your own
identities
• This is helpful if your organization already has its own identity
system, such as a corporate user directory like Microsoft Active
Directory
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is SAML 2.0-based Federation?
• SAML 2.0 is an open standard that many Identity Providers (IdPs) use
• This feature enables federated Single Sign-On (SSO), so users can log
into the AWS Management Console or call the AWS APIs without you
having to create an IAM user for everyone in your organization
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is AWS Security Token Service (STS)?
• The AWS Security Token Service (STS) is a web service that enables
you to request temporary, limited-privilege credentials for AWS
Identity and Access Management (IAM) users or for users that you
authenticate (federated users)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Ideas on Identity & Federation
• Do IAM users require a password or access key to call an AWS API?
– Access key, as passwords are only used to log into the AWS Management
Console
• Should code running on an EC2 instance use an access key or IAM role
to access DynamoDB?
– IAM role, as access keys can be challenging to manage
• Which IAM permission is more powerful, “iam:CreatePolicy” or
“iam:AttachRolePolicy”?
– iam:AttachRolePolicy, since you can escalate permissions by attaching any
policy to a role
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Organizations &
Service Control Policies
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is AWS Organizations?
• Service that enables customers to centrally manage policies across
multiple AWS accounts
• Create accounts and invite existing accounts to join your organization
and organize them into groups called organizational units (OUs)
• Attach policy-based controls called Service Control Policies (SCPs) to
centrally control AWS service use across multiple AWS accounts
• Simplify billing for multiple accounts by enabling a single payment
method through consolidated billing
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Organizations Policies
• A policy is a “document” with one or more statements that define the
controls that you want to apply to a group of AWS accounts.
• Currently, AWS Organizations provides a Service Control Policy (SCP).
– An SCP defines the AWS service actions, such as Amazon EC2
RunInstances, that are available for use in different accounts within an
organization.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is a Service Control Policy (SCP)?
• Service Control Policies (SCPs) allow you to control which AWS service
actions are accessible to principals (account root, IAM users, and IAM
roles)
• Authorization on a principal in an account that has an SCP attached is
the intersection of what is allowed explicitly in the SCP and what is
allowed explicitly in the IAM permissions attached to the principal.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Service Control Policy (SCP) Example
• If a SCP applied to an account states that the only ALLOWs Amazon
EC2 actions
• And if a IAM policy on a principal in the same AWS account ALLOWs
both EC2 actions and Amazon S3 actions
• Then the principal is able to access only the EC2 actions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
A1 A2 A4
M
Master Account / Administrative root
Organizational Unit (OU)
AWS Account
Organization
Control
Policy (OCP)
AWS Resources
A3
Dev Test Prod
AWS Organizations
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
A3A1 A2 A4
A
Dev Test Prod
AWS Organizations Service Control Policies
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Best Practices
• Lock away your AWS account (root) access keys
• Create individual IAM users
• Use groups to assign permissions to IAM users
• Grant least privilege
• Configure a strong password policy for your users
• Enable MFA for privileged users
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
IAM Best Practices
• Use roles for applications that run on Amazon EC2 instances
• Delegate by using roles instead of by sharing credentials
• Rotate credentials regularly
• Remove unnecessary credentials
• Use policy conditions for extra security
• Monitor activity in your AWS account
• http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
aws.amazon.com/activate
Everything and Anything Startups
Need to Get Started on AWS

Contenu connexe

Plus de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
Amazon Web Services
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Amazon Web Services
 

Plus de Amazon Web Services (20)

Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 
AWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei serverAWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei server
 
Crea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSightCrea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSight
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
 
Migra le tue file shares in cloud con FSx for Windows
Migra le tue file shares in cloud con FSx for Windows Migra le tue file shares in cloud con FSx for Windows
Migra le tue file shares in cloud con FSx for Windows
 
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
 

AWS Security Week: Identity & Access Management

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft Identity & Access Management: The First Step in AWS Security Reef D’Souza Security Consultant AWS Professional Services
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Agenda • Overview of AWS Identity & Access Management • IAM Authentication & Authorization • AWS Identity Federation • AWS Organizations & Service Control Policies • Recap of Best Practices
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Identity & Access Management IAM
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is IAM? • IAM is a preventive security control • What is a security control? – Any hardware, software, policy or procedure meant to govern access to IT resources • A preventive security control is one intended to thwart unwanted or unauthorized activity Directive Preventive Detective Responsive CAF Security Perspective
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is AWS IAM? • Create and manage AWS users and groups and use permissions to allow and deny access to AWS resources • Integrates with Microsoft Active Directory using SAML identity federation and AWS Directory Service • Roles can be created and assumed to control what operations can be performed by an entity or AWS service (e.g. EC2 instance)
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Why use AWS IAM? • You can specify permissions to control which operations a user or role can perform on AWS resources • IAM service provides access to the AWS Management Console, AWS API, and AWS Command-Line Interface (CLI) Note: IAM does not provide authentication for your OS or application
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Users? • IAM users can be an individual, system, or application requiring access to AWS services • A user account consists of a unique name and security credentials such as a password, access key, and/or multi-factor authentication (MFA) • IAM users only need passwords when they access the AWS Management Console
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Groups? • IAM Groups are a way to assign permissions to logical and functional units of your organization • IAM Groups are a tool to help with operational efficiency – Bulk permissions management (scalable) – Easy to change permissions as individuals change teams (portable)
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Roles? • An IAM role is similar to a user, in that it is an AWS identity with permission policies that determine what the identity can and cannot do in AWS. • You can authorize roles to be assumed by humans, Amazon EC2 instances, custom code, or other AWS services
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Authentication & Authorization
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Access Keys? • IAM access keys are used to make programmatic calls to AWS using the AWS Command Line Interface (CLI), the AWS SDKs, or direct HTTPS calls to the APIs for individual AWS services • Consists of an Access Key ID and a Secret Access Key • Example: – Access Key ID: AKIA3R7HGUSSI4BOW – Secret Access Key: MxQ4QSzT0NsnEO5VNCYjJo
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the signing process? • AWS Signature Version 4 is the process to add authentication information to AWS requests. – The AWS SDKs or CLI tools will construct, sign, and send requests for you, with the access keys you provide. – If you are constructing AWS API requests yourself, you will have to include code to sign the requests. • http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM passwords? • IAM passwords are credentials used by IAM users to authenticate to the AWS Management Console. • A password policy can be configured for the AWS account • Alphanumeric and common special characters are allowed: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ‘
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved When should I use Access Keys vs. passwords? • Depends on how your users will access AWS – Console → Password – API, CLI, SDK → Access keys • In either case, make sure to rotate credentials regularly – Use Credential Report to audit credential rotation – Configure password policy – Configure policy to allow access key rotation
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is an IAM principal? • IAM principal refers to a user, account, service, role, or other entity • In terms of evaluating authorization, a principal is defined as the entity that is allowed or denied access to a resource.
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM policies? • IAM policies are JSON-based statements that define access control and permissions • IAM polices can be “inline” or “managed”
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Example IAM policy { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::example_bucket” } }
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Policies? • Inline policies are policies that you create and manage, and that are embedded directly into a single user, group, or role. • Managed policies are standalone policies that you can manage separately from the IAM users, groups, or roles to which they are attached – AWS managed policies – Customer managed polices
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Choosing Inline vs Managed Policies • Use inline policies when you need to: – Enforce a strict one-to-one relationship between policy and principal – Avoid the wrong policy being attached to a principal – Ensure the policy is deleted when deleting the principal
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Choosing Inline vs Managed Policies • Use managed policies when you need: – Reusability – Central change management – Versioning and rollback – Delegation of permissions management – Automatic updates for AWS managed policies – Larger policy size
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are Resource-based policies? • To specify resource-based permissions, you attach an inline policy to a supported resource, such as an Amazon SNS topic, an Amazon S3 bucket, an AWS KMS key, or an Amazon Glacier vault. • Resource-based policies must specify who is allowed to access the resource, known as the Principal.
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Policy structure Identity-based policy Resource-based policy { "Statement":[{ "Effect":"effect", "Principal":"principal", "Action":"action", "Resource":"arn", "Condition":{ "condition":{ "key":"value" } } } ] } { "Statement":[{ "Effect":"effect", "Action":"action", "Resource":"arn", "Condition":{ "condition":{ "key":"value" } } } ] }
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the key difference? • With Identity-based Policies, the Principal is implicit. • With Resource-based Policies, the Principal is explicit.
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Evaluation Logic • By default, the decision is default deny • An allow overrides any default denies • An explicit deny overrides any allows • The order in which the policies are evaluated is not important
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Policy Evaluation Logic Final decision =“deny” (explicit deny) Yes Final decision =“allow” Yes No Is there an Allow? 4 Decision starts at Deny 1 Evaluate all applicable policies 2 Is there an explicit deny? 3 No Final decision =“deny” (default deny) 5 • AWS retrieves all policies associated with the user and resource. • Only policies that match the action and conditions are evaluated. If a policy statement has a deny, it trumps all other policy statements. Access is granted if there is an explicit allow and no deny. By default, an implicit (default) deny is returned.
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Prevent Privilege Escalation • Any principal with full IAM permissions is effectively a super user, even if no other permissions have been granted. • Why? The principal can modify its own permissions at any time. • To prevent this, deny access to at least these IAM actions: – iam:AttachUserPolicy – iam:AttachGroupPolicy – iam:AttachRolePolicy – iam:PutUserPolicy – iam:PutGroupPolicy – iam:PutRolePolicy
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the IAM Policy Simulator? The IAM policy simulator allows you to test policies against resources in your account
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the IAM Policy Simulator? • Test policies that are attached to IAM users, groups, or roles in your AWS account. • Test policies that are attached to AWS resources, such as Amazon S3 buckets, Amazon SQS queues, Amazon SNS topics, or Amazon Glacier vaults • Test new policies that are not yet attached to a user, group, or role by typing or copying them into the simulator.
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the IAM Policy Simulator? • Test the policies with selected services, actions, and resources. • Simulate real-world scenarios by providing context keys, such as an IP address or date, that are included in Condition elements in the policies being tested. • Identify which specific statement in a policy results in allowing or denying access to a particular resource or action.
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is the IAM Policy Generator? The AWS IAM Console has a simple GUI that helps you build your IAM policies.
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Identity Federation
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Identity Federation Before: After: Unique Credentials Single sign- on Long Lived Keys Short-term tokens One-off Naturally aligned Users Security Compliance
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Users vs. Federated Users • IAM supports users managed in AWS’s identity management system • Users managed outside of AWS in your corporate directory are referred to as “federated users” – Examples of corporate directories, include Microsoft Active Directory, PingFederate, Okta Univeral Directory, etc.
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What are IAM Identity Providers? • IAM identity providers allow you to use identities managed outside of AWS instead of creating IAM users in your AWS account • You don’t have to create custom sign-in code or manage your own identities • This is helpful if your organization already has its own identity system, such as a corporate user directory like Microsoft Active Directory
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is SAML 2.0-based Federation? • SAML 2.0 is an open standard that many Identity Providers (IdPs) use • This feature enables federated Single Sign-On (SSO), so users can log into the AWS Management Console or call the AWS APIs without you having to create an IAM user for everyone in your organization
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is AWS Security Token Service (STS)? • The AWS Security Token Service (STS) is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users)
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Ideas on Identity & Federation • Do IAM users require a password or access key to call an AWS API? – Access key, as passwords are only used to log into the AWS Management Console • Should code running on an EC2 instance use an access key or IAM role to access DynamoDB? – IAM role, as access keys can be challenging to manage • Which IAM permission is more powerful, “iam:CreatePolicy” or “iam:AttachRolePolicy”? – iam:AttachRolePolicy, since you can escalate permissions by attaching any policy to a role
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Organizations & Service Control Policies
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is AWS Organizations? • Service that enables customers to centrally manage policies across multiple AWS accounts • Create accounts and invite existing accounts to join your organization and organize them into groups called organizational units (OUs) • Attach policy-based controls called Service Control Policies (SCPs) to centrally control AWS service use across multiple AWS accounts • Simplify billing for multiple accounts by enabling a single payment method through consolidated billing
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Organizations Policies • A policy is a “document” with one or more statements that define the controls that you want to apply to a group of AWS accounts. • Currently, AWS Organizations provides a Service Control Policy (SCP). – An SCP defines the AWS service actions, such as Amazon EC2 RunInstances, that are available for use in different accounts within an organization.
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What is a Service Control Policy (SCP)? • Service Control Policies (SCPs) allow you to control which AWS service actions are accessible to principals (account root, IAM users, and IAM roles) • Authorization on a principal in an account that has an SCP attached is the intersection of what is allowed explicitly in the SCP and what is allowed explicitly in the IAM permissions attached to the principal.
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Service Control Policy (SCP) Example • If a SCP applied to an account states that the only ALLOWs Amazon EC2 actions • And if a IAM policy on a principal in the same AWS account ALLOWs both EC2 actions and Amazon S3 actions • Then the principal is able to access only the EC2 actions
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved A1 A2 A4 M Master Account / Administrative root Organizational Unit (OU) AWS Account Organization Control Policy (OCP) AWS Resources A3 Dev Test Prod AWS Organizations
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved A3A1 A2 A4 A Dev Test Prod AWS Organizations Service Control Policies
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Best Practices • Lock away your AWS account (root) access keys • Create individual IAM users • Use groups to assign permissions to IAM users • Grant least privilege • Configure a strong password policy for your users • Enable MFA for privileged users
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved IAM Best Practices • Use roles for applications that run on Amazon EC2 instances • Delegate by using roles instead of by sharing credentials • Rotate credentials regularly • Remove unnecessary credentials • Use policy conditions for extra security • Monitor activity in your AWS account • http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft aws.amazon.com/activate Everything and Anything Startups Need to Get Started on AWS