SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Unleash the Power of Temporary
AWS Credentials (a.k.a. IAM roles)
Apurv Awasthi
Sr. Product Manager
AWS
S I D 3 9 0
Ujjwal Pugalia
Sr. Product Manager
AWS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
What are temporary AWS credentials, aka AWS Identity and Access
Management (IAM) roles
Why should you use IAM roles?
When should you use IAM roles?
How does all of this work (role play).
How will you use IAM roles?
Temporary credentials everywhere – a peek at AWS Secrets Manager
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are IAM roles?
•IAM roles are IAM principals used to delegate access to employees,
applications, and AWS services
•An IAM role consists of:
• Trust policy: Who can use this IAM role
• Permissions policy: Which resources, services, and actions can be
accessed using this IAM role
•Employees, applications, and AWS services can assume IAM roles. Once
assumed, they are granted temporary AWS credentials to access
resources on AWS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why should you use IAM roles?
Secure
Deliver temporary
AWS credentials
Convenient
Easy to manage because
multiple employees
and applications can use the
same role
Available at no charge
There are no charges
for using roles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
When should you use IAM roles?
• Grant cross-account access to employees
• Use identities in your current IdP to access resources on AWS
• Enable applications running on AWS or on premises to make
AWS API calls
• Enable AWS services to make AWS API calls on your behalf
Think of IAM roles as limited sudo in to AWS
Humans
Bots
AWS services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Delegate access to contractor
@AnyCompany
Acct ID: 444455556666
s3-role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": ["arn:aws:s3:::ExampleCorp"]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject" ],
"Resource": ["arn:aws:s3:::ExampleCorp/*"]
}]}
@Example Corp.
Acct ID: 111122223333
Authenticate with
Bob’s access keys
Get temporary
security credentials
for s3-role
Call AWS APIs using
temporary security
credentials
of s3-role
{ "Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource":
"arn:aws:iam::444455556666:role/s3-role“}
]}
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":“1111222233334444"},
"Action":"sts:AssumeRole"
}]}
s3-role trusts IAM users from the Example Corp.
account (111122223333)
Permissions assigned to Bob
granting him permission to
assume s3-role in account
AnyCompany
IAM user: Bob
Permissions assigned to s3-role
STS
Amazon S3
Bucket with objects
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How will you use IAM roles at AnyCompany?
1. [Cross-account access] Developer Dan requires access to an S3 bucket in the Prod
account
2. [Cross-account access] Contractor Bob requires access to an S3 bucket in the Prod
account
3. [Least privileges] Require Dan to use IAM roles to delete an Amazon DynamoDB
table
4. [Audit] Administrator Andy wants to track who used an IAM role
5. [Access for AWS services] Amazon Lex uses Amazon Polly to synthesize speech
responses for your bot
6. [IAM roles for EC2] Application running on Amazon Elastic Compute Cloud
(Amazon EC2) requires access to an S3 bucket and DynamoDB table
7. [SAML Federation] Administrator Andy wants to use IAM with identities stored in
an external IdP
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Temporary credentials everywhere –
a peek at AWS Secrets Manager
Secure
Store and encrypt
database credentials
etc. centrally
Rotate
Rotate secrets
automatically, on
demand or on schedule
Pay as you go
No licensing fee or
upfront cost
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Apurv Awasthi
awasth@amazon.com
(or, the blackjack tables at Treasure Island)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Some resources to help you get started
re:Invent 2017 sessions (videos on YouTube)
• How You can use AWS’ Identity Services to be Successful on Your AWS Cloud
Journey (SID 303): https://bit.ly/2O5JhZ4
• Soup to Nuts: Identity Federation for AWS (SID 344): https://bit.ly/2D25dDu
• IAM Policy Ninja (SID 314): https://bit.ly/2JcEJT3
Documentation and blog posts
• IAM best practices: http://amzn.to/2gGcEUC
• Best practices for using IAM roles (video): http://bit.ly/2zttop2
• Using IAM roles for Amazon EC2 instances: http://amzn.to/1St3F4q
• Attaching IAM role to an existing Amazon EC2 instance: http://amzn.to/2lceuMB
• Limit Amazon S3 bucket access to a specific IAM role: http://amzn.to/2n5o9Kj
• Rotate database credentials using Secrets Manager: https://amzn.to/2GLceqD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Appendix
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tracking & monitoring use of IAM roles
Production Support
Erin
Production Support
Bob
Production Support
Alice
Production Support
Carol
prod-support-S3-bucket-account-b
Assume
role
Put object A
B
C
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tracking IAM roles using AWS CloudTrail
Step 1: Locate the put object call using the object name.
Step 2: Find the assume role call using the temporary access key.
Step 3: Find the assume role call from the originating account
using the shared event ID.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 1: Locate the put object call using the object name.
"eventVersion": "1.05",
"userIdentity": {
"type": "AssumedRole",
"principalId": "AROAJN6FXOWE7SY7KDNKW:AWS-CLI-session-1503619346",
"arn": "arn:aws:sts::123456789666:assumed-role/prod-support-S3-bucket-account-b/AWS-CLI-session-1503619346",
"accountId": "123456789666",
"accessKeyId": "ASIAJDCQY5DSKNVSQUKQ",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "AROAJN6FXOWE7SY7KDNKW",
"arn": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b",
"accountId": "784011040245",
"userName": "prod-support-S3-bucket-account-b"
},
"attributes": {
"creationDate": "2017-08-25T00:02:26Z",
"mfaAuthenticated": "false"
}
}
},
"eventTime": "2017-08-25T00:02:27Z",
"eventSource": "s3.amazonaws.com",
"eventName": "PutObject",
"awsRegion": "us-east-1",
"sourceIPAddress": “XX.XX.XXX.XX",
"userAgent": "[aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9]",
"requestParameters": {
"bucketName": "iam-roles-webinar-product-support-account-b",
"key": "mobile-resources/iam-roles-testFile.txt"
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 2: Find the assume role call using the temporary access key.
"eventSource": "sts.amazonaws.com",
"eventName": "AssumeRole",
"awsRegion": "us-east-1",
"sourceIPAddress": “XX.XX.XXX.XX",
"userAgent": "aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9",
"requestParameters": {
"roleArn": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b",
"roleSessionName": "AWS-CLI-session-1503619346"
},
"responseElements": {
"credentials": {
"accessKeyId": "ASIAJDCQY5DSKNVSQUKQ",
"expiration": "Aug 25, 2017 1:02:26 AM",
"sessionToken": “XXX"
}, "assumedRoleUser": {
"assumedRoleId": "AROAJN6FXOWE7SY7KDNKW:AWS-CLI-session-1503619346",
"arn": "arn:aws:sts::123456789666:assumed-role/prod-support-S3-bucket-account-b/AWS-CLI-session-1503619346"
}},
"requestID": "adeb855c-8928-11e7-a0a2-8d7a034d3805",
"eventID": "f48cebce-2194-44c3-bc7d-a4b64b0c5802",
"resources": [{
"ARN": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b",
"accountId": "123456789666",
"type": "AWS::IAM::Role"
}],
"eventType": "AwsApiCall",
"recipientAccountId": "123456789666",
"sharedEventID": "245452c8-af00-44fa-bd12-d13c16e1da2c"}]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 3: Find the assume role call from the originating account using the
shared event ID.
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAJI6WTWP4ZQ6ABT7BW",
"arn": "arn:aws:iam:: 123456789123:user/Brigid",
"accountId": “123456789123",
"accessKeyId": "AKIAJCZ6IERGFDSFAH4Q",
"userName": "Brigid"
},
"eventTime": "2017-08-25T00:02:26Z",
"eventSource": "sts.amazonaws.com",
"eventName": "AssumeRole",
"awsRegion": "us-east-1",
"sourceIPAddress": “XX.XX.XXX.XX", "userAgent": "aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9",
"requestParameters": {
"roleArn": "arn:aws:iam::123456789123:role/prod-support-S3-bucket-account-b",
"roleSessionName": "AWS-CLI-session-1503619346"
},
"responseElements": {… },
"assumedRoleUser": {…}},
…
"eventType": "AwsApiCall",
"recipientAccountId": "123456789123",
"sharedEventID": "245452c8-af00-44fa-bd12-d13c16e1da2c"
}

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

SID201_IAM for Enterprises How Vanguard strikes the Balance Between Agility, ...
SID201_IAM for Enterprises How Vanguard strikes the Balance Between Agility, ...SID201_IAM for Enterprises How Vanguard strikes the Balance Between Agility, ...
SID201_IAM for Enterprises How Vanguard strikes the Balance Between Agility, ...
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS Security
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
 
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
 
AWS Summit Seoul 2023 | 12가지 디자인 패턴으로 알아보는 클라우드 네이티브 마이크로서비스 아키텍처
AWS Summit Seoul 2023 | 12가지 디자인 패턴으로 알아보는 클라우드 네이티브 마이크로서비스 아키텍처AWS Summit Seoul 2023 | 12가지 디자인 패턴으로 알아보는 클라우드 네이티브 마이크로서비스 아키텍처
AWS Summit Seoul 2023 | 12가지 디자인 패턴으로 알아보는 클라우드 네이티브 마이크로서비스 아키텍처
 
AWS Security Best Practices in a Zero Trust Security Model - DEM08 - Toronto ...
AWS Security Best Practices in a Zero Trust Security Model - DEM08 - Toronto ...AWS Security Best Practices in a Zero Trust Security Model - DEM08 - Toronto ...
AWS Security Best Practices in a Zero Trust Security Model - DEM08 - Toronto ...
 
AWS IAM Tutorial | Identity And Access Management (IAM) | AWS Training Videos...
AWS IAM Tutorial | Identity And Access Management (IAM) | AWS Training Videos...AWS IAM Tutorial | Identity And Access Management (IAM) | AWS Training Videos...
AWS IAM Tutorial | Identity And Access Management (IAM) | AWS Training Videos...
 
AWS Security Best Practices
AWS Security Best PracticesAWS Security Best Practices
AWS Security Best Practices
 
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
 
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
 
AWS Security & Compliance
AWS Security & ComplianceAWS Security & Compliance
AWS Security & Compliance
 
Setting Up a Landing Zone
Setting Up a Landing ZoneSetting Up a Landing Zone
Setting Up a Landing Zone
 
AWS Summit Seoul 2023 | 지역거점 중심의 산업 생태계 활성화 사례
AWS Summit Seoul 2023 | 지역거점 중심의 산업 생태계 활성화 사례AWS Summit Seoul 2023 | 지역거점 중심의 산업 생태계 활성화 사례
AWS Summit Seoul 2023 | 지역거점 중심의 산업 생태계 활성화 사례
 
AWS Summit Seoul 2023 | 가격은 저렴, 성능은 최대로! 확 달라진 Amazon EC2 알아보기
AWS Summit Seoul 2023 | 가격은 저렴, 성능은 최대로! 확 달라진 Amazon EC2 알아보기AWS Summit Seoul 2023 | 가격은 저렴, 성능은 최대로! 확 달라진 Amazon EC2 알아보기
AWS Summit Seoul 2023 | 가격은 저렴, 성능은 최대로! 확 달라진 Amazon EC2 알아보기
 
K8s on AWS: Introducing Amazon EKS
K8s on AWS: Introducing Amazon EKSK8s on AWS: Introducing Amazon EKS
K8s on AWS: Introducing Amazon EKS
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
 

Similar a Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1) - AWS re:Invent 2018

Similar a Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1) - AWS re:Invent 2018 (20)

Best Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS WorkloadsBest Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS Workloads
 
Federation & Access Management
Federation & Access ManagementFederation & Access Management
Federation & Access Management
 
Identity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF LoftIdentity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
 
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
 
Mastering Identity at Every Layer of the Cake (SEC401-R1) - AWS re:Invent 2018
Mastering Identity at Every Layer of the Cake (SEC401-R1) - AWS re:Invent 2018Mastering Identity at Every Layer of the Cake (SEC401-R1) - AWS re:Invent 2018
Mastering Identity at Every Layer of the Cake (SEC401-R1) - AWS re:Invent 2018
 
AWS Identity Access Management
AWS Identity Access ManagementAWS Identity Access Management
AWS Identity Access Management
 
Identity and Access Management and Directory Services
Identity and Access Management and Directory ServicesIdentity and Access Management and Directory Services
Identity and Access Management and Directory Services
 
Evolving perimeters with guardrails, not gates: Improving developer agility -...
Evolving perimeters with guardrails, not gates: Improving developer agility -...Evolving perimeters with guardrails, not gates: Improving developer agility -...
Evolving perimeters with guardrails, not gates: Improving developer agility -...
 
AWS Security Deep Dive
AWS Security Deep DiveAWS Security Deep Dive
AWS Security Deep Dive
 
Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018
 
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
 
Incident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat ResponseIncident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat Response
 
A Practitioner's Guide to Securing Your Cloud (Like an Expert) (SEC203-R1) - ...
A Practitioner's Guide to Securing Your Cloud (Like an Expert) (SEC203-R1) - ...A Practitioner's Guide to Securing Your Cloud (Like an Expert) (SEC203-R1) - ...
A Practitioner's Guide to Securing Your Cloud (Like an Expert) (SEC203-R1) - ...
 
Red Team vs. Blue Team on AWS (DVC304) - AWS re:Invent 2018
Red Team vs. Blue Team on AWS (DVC304) - AWS re:Invent 2018Red Team vs. Blue Team on AWS (DVC304) - AWS re:Invent 2018
Red Team vs. Blue Team on AWS (DVC304) - AWS re:Invent 2018
 
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019 The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
 
Become an IAM Policy Master in 60 Minutes or Less (SEC316-R1) - AWS reInvent ...
Become an IAM Policy Master in 60 Minutes or Less (SEC316-R1) - AWS reInvent ...Become an IAM Policy Master in 60 Minutes or Less (SEC316-R1) - AWS reInvent ...
Become an IAM Policy Master in 60 Minutes or Less (SEC316-R1) - AWS reInvent ...
 
AWSome Day MODULE 4 - Security
AWSome Day MODULE 4 - SecurityAWSome Day MODULE 4 - Security
AWSome Day MODULE 4 - Security
 
Jeff Lombardo - Enforcing access control in depth with AWS - v1.2.pdf
Jeff Lombardo - Enforcing access control in depth with AWS - v1.2.pdfJeff Lombardo - Enforcing access control in depth with AWS - v1.2.pdf
Jeff Lombardo - Enforcing access control in depth with AWS - v1.2.pdf
 
Red Team vs. Blue Team on AWS ~ re:Invent 2018
Red Team vs. Blue Team on AWS ~ re:Invent 2018Red Team vs. Blue Team on AWS ~ re:Invent 2018
Red Team vs. Blue Team on AWS ~ re:Invent 2018
 
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
 

Más 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
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
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
 

Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) Apurv Awasthi Sr. Product Manager AWS S I D 3 9 0 Ujjwal Pugalia Sr. Product Manager AWS
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda What are temporary AWS credentials, aka AWS Identity and Access Management (IAM) roles Why should you use IAM roles? When should you use IAM roles? How does all of this work (role play). How will you use IAM roles? Temporary credentials everywhere – a peek at AWS Secrets Manager
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are IAM roles? •IAM roles are IAM principals used to delegate access to employees, applications, and AWS services •An IAM role consists of: • Trust policy: Who can use this IAM role • Permissions policy: Which resources, services, and actions can be accessed using this IAM role •Employees, applications, and AWS services can assume IAM roles. Once assumed, they are granted temporary AWS credentials to access resources on AWS
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why should you use IAM roles? Secure Deliver temporary AWS credentials Convenient Easy to manage because multiple employees and applications can use the same role Available at no charge There are no charges for using roles
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. When should you use IAM roles? • Grant cross-account access to employees • Use identities in your current IdP to access resources on AWS • Enable applications running on AWS or on premises to make AWS API calls • Enable AWS services to make AWS API calls on your behalf Think of IAM roles as limited sudo in to AWS Humans Bots AWS services
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Delegate access to contractor @AnyCompany Acct ID: 444455556666 s3-role { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::ExampleCorp"] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject" ], "Resource": ["arn:aws:s3:::ExampleCorp/*"] }]} @Example Corp. Acct ID: 111122223333 Authenticate with Bob’s access keys Get temporary security credentials for s3-role Call AWS APIs using temporary security credentials of s3-role { "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::444455556666:role/s3-role“} ]} { "Statement": [ { "Effect":"Allow", "Principal":{"AWS":“1111222233334444"}, "Action":"sts:AssumeRole" }]} s3-role trusts IAM users from the Example Corp. account (111122223333) Permissions assigned to Bob granting him permission to assume s3-role in account AnyCompany IAM user: Bob Permissions assigned to s3-role STS Amazon S3 Bucket with objects
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How will you use IAM roles at AnyCompany? 1. [Cross-account access] Developer Dan requires access to an S3 bucket in the Prod account 2. [Cross-account access] Contractor Bob requires access to an S3 bucket in the Prod account 3. [Least privileges] Require Dan to use IAM roles to delete an Amazon DynamoDB table 4. [Audit] Administrator Andy wants to track who used an IAM role 5. [Access for AWS services] Amazon Lex uses Amazon Polly to synthesize speech responses for your bot 6. [IAM roles for EC2] Application running on Amazon Elastic Compute Cloud (Amazon EC2) requires access to an S3 bucket and DynamoDB table 7. [SAML Federation] Administrator Andy wants to use IAM with identities stored in an external IdP
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Temporary credentials everywhere – a peek at AWS Secrets Manager Secure Store and encrypt database credentials etc. centrally Rotate Rotate secrets automatically, on demand or on schedule Pay as you go No licensing fee or upfront cost
  • 11. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Apurv Awasthi awasth@amazon.com (or, the blackjack tables at Treasure Island)
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Some resources to help you get started re:Invent 2017 sessions (videos on YouTube) • How You can use AWS’ Identity Services to be Successful on Your AWS Cloud Journey (SID 303): https://bit.ly/2O5JhZ4 • Soup to Nuts: Identity Federation for AWS (SID 344): https://bit.ly/2D25dDu • IAM Policy Ninja (SID 314): https://bit.ly/2JcEJT3 Documentation and blog posts • IAM best practices: http://amzn.to/2gGcEUC • Best practices for using IAM roles (video): http://bit.ly/2zttop2 • Using IAM roles for Amazon EC2 instances: http://amzn.to/1St3F4q • Attaching IAM role to an existing Amazon EC2 instance: http://amzn.to/2lceuMB • Limit Amazon S3 bucket access to a specific IAM role: http://amzn.to/2n5o9Kj • Rotate database credentials using Secrets Manager: https://amzn.to/2GLceqD
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Appendix
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tracking & monitoring use of IAM roles Production Support Erin Production Support Bob Production Support Alice Production Support Carol prod-support-S3-bucket-account-b Assume role Put object A B C
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tracking IAM roles using AWS CloudTrail Step 1: Locate the put object call using the object name. Step 2: Find the assume role call using the temporary access key. Step 3: Find the assume role call from the originating account using the shared event ID.
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 1: Locate the put object call using the object name. "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AROAJN6FXOWE7SY7KDNKW:AWS-CLI-session-1503619346", "arn": "arn:aws:sts::123456789666:assumed-role/prod-support-S3-bucket-account-b/AWS-CLI-session-1503619346", "accountId": "123456789666", "accessKeyId": "ASIAJDCQY5DSKNVSQUKQ", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROAJN6FXOWE7SY7KDNKW", "arn": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b", "accountId": "784011040245", "userName": "prod-support-S3-bucket-account-b" }, "attributes": { "creationDate": "2017-08-25T00:02:26Z", "mfaAuthenticated": "false" } } }, "eventTime": "2017-08-25T00:02:27Z", "eventSource": "s3.amazonaws.com", "eventName": "PutObject", "awsRegion": "us-east-1", "sourceIPAddress": “XX.XX.XXX.XX", "userAgent": "[aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9]", "requestParameters": { "bucketName": "iam-roles-webinar-product-support-account-b", "key": "mobile-resources/iam-roles-testFile.txt"
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 2: Find the assume role call using the temporary access key. "eventSource": "sts.amazonaws.com", "eventName": "AssumeRole", "awsRegion": "us-east-1", "sourceIPAddress": “XX.XX.XXX.XX", "userAgent": "aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9", "requestParameters": { "roleArn": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b", "roleSessionName": "AWS-CLI-session-1503619346" }, "responseElements": { "credentials": { "accessKeyId": "ASIAJDCQY5DSKNVSQUKQ", "expiration": "Aug 25, 2017 1:02:26 AM", "sessionToken": “XXX" }, "assumedRoleUser": { "assumedRoleId": "AROAJN6FXOWE7SY7KDNKW:AWS-CLI-session-1503619346", "arn": "arn:aws:sts::123456789666:assumed-role/prod-support-S3-bucket-account-b/AWS-CLI-session-1503619346" }}, "requestID": "adeb855c-8928-11e7-a0a2-8d7a034d3805", "eventID": "f48cebce-2194-44c3-bc7d-a4b64b0c5802", "resources": [{ "ARN": "arn:aws:iam::123456789666:role/prod-support-S3-bucket-account-b", "accountId": "123456789666", "type": "AWS::IAM::Role" }], "eventType": "AwsApiCall", "recipientAccountId": "123456789666", "sharedEventID": "245452c8-af00-44fa-bd12-d13c16e1da2c"}]
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 3: Find the assume role call from the originating account using the shared event ID. { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "AIDAJI6WTWP4ZQ6ABT7BW", "arn": "arn:aws:iam:: 123456789123:user/Brigid", "accountId": “123456789123", "accessKeyId": "AKIAJCZ6IERGFDSFAH4Q", "userName": "Brigid" }, "eventTime": "2017-08-25T00:02:26Z", "eventSource": "sts.amazonaws.com", "eventName": "AssumeRole", "awsRegion": "us-east-1", "sourceIPAddress": “XX.XX.XXX.XX", "userAgent": "aws-cli/1.11.46 Python/2.7.9 Windows/7 botocore/1.5.9", "requestParameters": { "roleArn": "arn:aws:iam::123456789123:role/prod-support-S3-bucket-account-b", "roleSessionName": "AWS-CLI-session-1503619346" }, "responseElements": {… }, "assumedRoleUser": {…}}, … "eventType": "AwsApiCall", "recipientAccountId": "123456789123", "sharedEventID": "245452c8-af00-44fa-bd12-d13c16e1da2c" }