SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Demo
Amazon S3 Read-Only Access Template 
Example of an IAM user/group/role access policy 
{ 
"Statement": [ 
{ 
"Effect": "Allow", 
"Action": ["s3:Get*", "s3:List*"], 
"Resource": "*" 
} 
] 
}
{ 
"Statement":[{ 
"Effect":"effect", 
"Principal":"principal", 
"Action":"action", 
"Resource":"arn", 
"Condition":{ 
"condition":{ 
"key":"value" } 
} 
} 
] 
} 
Principal 
Action 
Resource 
Conditions 
Effect: Allow 
Principal:123456789012:user/bob 
Action: s3:* 
Resource: jeff_bucket/* 
Condition: Referer= example.com 
Effect: Deny 
Principal:123456789012:user/brad 
Action: s3:DeleteBucket 
Resource: jeff_bucket 
Condition: Referer= example.com
<!--Everyone (anonymous users) --> 
"Principal":"AWS":"*.*" 
<!--Specific account or accounts --> 
"Principal":{"AWS":"arn:aws:iam::123456789012:root" } 
"Principal":{"AWS":"123456789012"} 
<!--Individual IAM user --> 
"Principal":"AWS":"arn:aws:iam::123456789012:user/username" 
<!--Federated user (using web identity federation) --> 
"Principal":{"Federated":"www.amazon.com"} 
"Principal":{"Federated":"graph.facebook.com"} 
"Principal":{"Federated":"accounts.google.com"} 
<!--Specific role --> 
"Principal":{"AWS":"arn:aws:iam::123456789012:role/rolename"} 
<!--Specific service --> 
"Principal":{"Service":"ec2.amazonaws.com"} 
Replace with your account number
<!--EC2 action --> 
"Action":"ec2:StartInstances" 
<!--IAM action --> 
"Action":"iam:ChangePassword" 
<!--S3 action --> 
"Action":"s3:GetObject" 
<!--Specify multiple values for the Action element--> 
"Action":["sqs:SendMessage","sqs:ReceiveMessage"] 
<--Use wildcards (* or ?) as part of the action name. This would cover Create/Delete/List/Update--> 
"Action":"iam:*AccessKey*"
{ 
"Version": "2012-10-17", 
"Statement": [ { 
"Effect": "Allow", 
"NotAction": "iam:*", 
"Resource": "*" 
} 
] 
} 
{ 
"Version": "2012-10-17", 
"Statement": [{ 
"Effect": "Allow", 
"Action": "*", 
"Resource": "*" 
}, 
{ 
"Effect": "Deny", 
"Action": "iam:*", 
"Resource": "*" 
} 
] 
} 
or 
This is not a Deny. A user could still have a separate policy that grants IAM:* 
If you want to prevent the user from ever being able to call IAM APIs, use an explicit deny 
Notice the difference?
{ 
"Version": "2012-10-17", 
"Statement": [ { 
"Effect": "Allow", 
"NotAction": "iam:*", 
"Resource": "*" 
} 
] 
} 
{ 
"Version": "2012-10-17", 
"Statement": [{ 
"Effect": "Allow", 
"NotAction": "iam:*", 
"Resource": "*" 
}, 
{ 
"Effect": "Deny", 
"Action": "iam:*", 
"Resource": "*" 
} 
] 
} 
Even more strict 
Grants only what you want while ensuring you’re always denying what you don’t want granted.
<--S3 Bucket --> 
"Resource":"arn:aws:s3:::my_corporate_bucket/*" 
<--SQS queue--> 
"Resource":"arn:aws:sqs:us-west-2:123456789012:queue1" 
<--Multiple DynamoDB tables --> 
"Resource":["arn:aws:dynamodb:us-west-2:123456789012:table/books_table", 
"arn:aws:dynamodb:us-west-2:123456789012:table/magazines_table"] 
<--All EC2 instances for an account in a region --> 
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*"
{ 
"Statement": 
{ 
"Sid":"Queue1_SendMessage", 
"Effect": "Allow", 
"Principal": {"AWS": "111122223333"}, 
"Action": "sqs:SendMessage", 
"Resource": 
"arn:aws:sqs:us-east-1:444455556666:queue1" 
} 
} 
Principal required here
Condition Element 
Condition 1: 
Key1: Value1A 
Condition 2: 
Key3: Value3A 
AND 
AND 
Key2: Value2A ORValue2B 
OR 
OR 
Value1B Value 1C
"Condition" : { 
"DateGreaterThan" : {"aws:CurrentTime" : "2014-11-13T12:00:00Z"}, 
"DateLessThan": {"aws:CurrentTime" : "2014-11-13T15:00:00Z"}, 
"IpAddress" : {"aws:SourceIp" : ["192.0.2.0/24", "203.0.113.0/24"]} 
} 
Allows a user to access a resource under the following conditions: 
•The time is after 12:00 p.m. on 11/13/2014 
•The time is before 3:00 p.m. on 11/13/2014 
•The request comes from an IP address in the 192.0.2.0 /24 or 203.0.113.0 /24 range 
AND 
OR
{ 
"Version": "2012-10-17", 
"Statement": [{ 
"Effect": "Allow", 
"Action": ["s3:ListBucket"], 
"Resource": ["arn:aws:s3:::myBucket"], 
"Condition": 
{"StringLike": 
{"s3:prefix":["home/${aws:userid}/*"]} 
} 
}, 
{ 
"Effect":"Allow", 
"Action":["s3:*"], 
"Resource": ["arn:aws:s3:::myBucket/home/${aws:userid}", 
"arn:aws:s3:::myBucket/home/${aws:userid}/*"] 
} 
] 
} 
Version is required 
Variable in conditions 
Variable in resource ARNs 
Grants a user access to a home directory in Amazon S3 that can be accessed programmatically
Giving a User a Home Directory From the Amazon 
S3 Console 
{ 
"Version": "2012-10-17", 
"Statement": [ 
{"Sid": "AllowGroupToSeeBucketListInTheManagementConsole", 
"Action": ["s3:ListAllMyBuckets", "s3:GetBucketLocation"], 
"Effect": "Allow", 
"Resource": ["arn:aws:s3:::*"]}, 
{"Sid": "AllowRootLevelListingOfThisBucketAndHomePrefix", 
"Action": ["s3:ListBucket"], 
"Effect": "Allow", 
"Resource": ["arn:aws:s3:::myBucket"], 
"Condition":{"StringEquals":{"s3:prefix":["","home/"],"s3:delimiter":["/"]}}}, 
{"Sid": "AllowListBucketofASpecificUserPrefix", 
"Action": ["s3:ListBucket"], 
"Effect": "Allow", 
"Resource": ["arn:aws:s3:::myBucket"], 
"Condition":{"StringLike":{"s3:prefix":["home/${aws:username}/*"]}}}, 
{"Sid":"AllowUserFullAccesstoJustSpecificUserPrefix", 
"Action":["s3:*"], 
"Effect":"Allow", 
"Resource": ["arn:aws:s3:::myBucket/home/${aws:username}", 
"arn:aws:s3:::myBucket/home/${aws:username}/*"]} 
] 
} 
Necessary to 
access the 
Amazon S3 console 
Allows listing all 
objects in a folder + 
its subfolders 
Allows modifying 
objects in the folder 
+ subfolders
Demo
{ 
"Version": "2012-10-17", 
"Statement": [{ 
"Sid": "ViewListOfAllUsers", 
"Action": ["iam:ListUsers"], 
"Effect": "Allow", 
"Resource": ["arn:aws:iam::123456789012:user/*"] 
}, 
{ 
"Sid": "AllowUserToSeeListOfOwnStuff", 
"Action": ["iam:GetUser","iam:GetLoginProfile", 
"iam:ListGroupsForUser","iam:ListAccessKeys"], 
"Effect": "Allow", 
"Resource": ["arn:aws:iam::123456789012:user/${aws:username}"] 
} 
] 
} 
•Underneath the covers, the IAM console calls these APIs 
•Keep in mind the user will be able to viewlimited details about all users 
•The IAM user will not be able to modify the other IAM users’ settings 
•Alternatively, use the CLI
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Action": ["iam:*AccessKey*","iam:*SigningCertificate*"], 
"Effect": "Allow", 
"Resource": ["arn:aws:iam::123456789012:user/${aws:username}"] 
} 
] 
}
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Action": ["iam:CreateVirtualMFADevice","iam:DeleteVirtualMFADevice"], 
"Effect": "Allow", 
"Resource": "arn:aws:iam::123456789012:mfa/${aws:username}" 
}, 
{ 
"Action": ["iam:DeactivateMFADevice", "iam:EnableMFADevice", 
"iam:ListMFADevices", "iam:ResyncMFADevice"], 
"Effect": "Allow", 
"Resource": "arn:aws:iam::123456789012:user/${aws:username}" 
}, 
{ 
"Action": ["iam:ListVirtualMFADevices"], 
"Effect": "Allow", 
"Resource": "arn:aws:iam::123456789012:mfa/*" 
} 
] 
}
Demo
{ 
"Statement": [{ 
"Effect": "Allow", 
"Action": ["ec2:TerminateInstances"], 
"Resource":"*" 
} 
] 
} 
Tell me there is a better way.
{ 
"Statement": [{ 
"Effect": "Allow", 
"Action": ["ec2:TerminateInstances"], 
"Resource": 
"arn:aws:ec2:us-east-1:123456789012:instance/i-abc12345" 
} 
] 
}
{ 
"Statement": [{ 
"Effect": "Allow", 
"Action": ["ec2:TerminateInstances"], 
"Resource": 
"arn:aws:ec2:us-east-1:123456789012:instance/*" 
} 
] 
}
{ 
"Statement": [{ 
"Effect": "Allow", 
"Action": ["ec2:TerminateInstances"], 
"Resource": 
"arn:aws:ec2:us-east-1:123456789012:instance/*", 
"Condition": { 
"StringEquals": {"ec2:ResourceTag/department": "dev"} 
} 
} 
] 
}
•Customer gateway 
•DHCP options set 
•Image 
•Instance 
•Instance profile 
•Internet gateway 
•Key pair 
•Network ACL 
•Network interface 
•Placement group 
•Route table 
•Security group 
•Snapshot 
•Subnet 
•Volume 
•VPC 
•VPC peering connection 
Supports many different resource types, including:
Type of Resource 
Actions 
EC2 Instances 
RebootInstances,RunInstance, StartInstances, StopInstances, TerminateInstances 
Customer gateway 
DeleteCustomerGateway 
DHCP Options Sets 
DeleteDhcpOptions 
Internet Gateways 
DeleteInternetGateway 
Network ACLs 
DeleteNetworkAcl, DeleteNetworkAclEntry 
Route Tables 
DeleteRoute, DeleteRouteTable 
Security Groups 
AuthorizeSecurityGroupEgress, AuthorizeSecurityGroupIngress, 
DeleteSecurityGroup, RevokeSecurityGroupEgress, RevokeSecurityGroupIngress 
Volumes 
AttachVolume, DeleteVolume, DetachVolume 
VPC Peering Connections 
AcceptVpcPeeringConnection, CreateVpcPeeringConnection, DeleteVpcPeeringConnection, RejectVpcPeeringConnection 
Accurate as of 11/13/2014 
Note: This is only a subsetof all possible Amazon EC2 actions
Demo
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "THISALLOWSEC2READACCESS", 
"Effect": "Allow", 
"Action": ["ec2:Describe*","elasticloadbalancing:Describe*", 
"cloudwatch:ListMetrics","cloudwatch:GetMetricStatistics", 
"cloudwatch:Describe*","autoscaling:Describe*"], 
"Resource": "*" 
}, 
{ 
"Sid": "THISLIMITSACCESSTOOWNINSTANCES", 
"Effect": "Allow", 
"Action": ["ec2:RebootInstances","ec2:StartInstances", 
"ec2:StopInstances","ec2:TerminateInstances"], 
"Resource":"arn:aws:ec2:us-east-1:123456789012:instance/*", 
"Condition": {"StringEquals": 
{"ec2:ResourceTag/Owner": "${aws:username}"}} 
} 
] 
} 
Version is required here because we’re using variables 
Only allowed if this tag condition is true 
Use a variable for the owner tag 
Allows seeing everything from the Amazon EC2 console.
Ready for a quiz?
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "SorryThisIsNotGoingToWorkAsExpected", 
"Effect": "Allow", 
"Action": ["ec2:*"], 
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" 
} 
] 
} 
Why doesn’t this work? 
Problem: Not all Amazon EC2 actions support resource-level permissions
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "Thiswillwork", 
"Effect": "Allow", 
"Action": ["ec2:*"], 
"Resource": "*" 
} 
] 
} 
Solution: Change the resource to *
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "ThisWillNotWork", 
"Effect": "Allow", 
"Action": [ 
"ec2:RunInstances","ec2:TerminateInstances", 
"ec2:StopInstances","ec2:StartInstances", 
"ec2:Describe*" 
], 
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" 
} 
] 
} 
Why doesn’t this work? 
Problem: None of the ec2:Describe* actions support resource-level permissions
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "TheseActionsDontSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": ["ec2:Describe*"], 
"Resource": "*" 
}, 
{ 
"Sid": "TheseActionsSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": [ 
"ec2:RunInstances","ec2:TerminateInstances", 
"ec2:StopInstances","ec2:StartInstances" 
], 
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" 
} 
] 
} 
Solution: Put ec2:Describe* into a separate block.
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Sid": "TheseActionsDontSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": ["ec2:Describe*"], 
"Resource": "*" 
}, 
{ 
"Sid": "TheseActionsSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": [ 
"ec2:RunInstances","ec2:TerminateInstances", 
"ec2:StopInstances","ec2:StartInstances" 
], 
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" 
} 
] 
} 
So will this work now? 
No
{ 
"Version": "2012-10-17", 
"Statement": [{ 
"Sid": "TheseActionsDontSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": ["ec2:Describe*"], 
"Resource": "*"}, 
{ 
"Sid": "ThisActionsSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": ["ec2:RunInstances"], 
"Resource": [ 
"arn:aws:ec2:us-east-1:accountid:instance/*", 
"arn:aws:ec2:us-east-1:accountid:key-pair/*", 
"arn:aws:ec2:us-east-1:accountid:security-group/*", 
"arn:aws:ec2:us-east-1:accountid:volume/*", 
"arn:aws:ec2:us-east-1::image/ami-*"]}, 
{ 
"Sid": "TheseActionsSupportResourceLevelPermissions", 
"Effect": "Allow", 
"Action": [ 
"ec2:TerminateInstances", 
"ec2:StopInstances", 
"ec2:StartInstances"], 
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" 
} 
] 
To run an EC2 instance, you also need access to an Amazon EC2 key pair, a security group, an EBS volume, and an AMI 
.
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 & 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, a implicit (default) deny is returned
http://aws.amazon.com/documentation/iam/ http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ec2-api- permissions.htmlDemystifying- EC2-Resource-Level-PermissionsGranting-Users-Permission-to-Work-in-the-Amazon-EC2-Consolehttp://aws.amazon.com/iamhttps://forums.aws.amazon.com/forum.jspa?forumID=76
Please give us your feedback on this session. 
Complete session evaluations and earn re:Invent swag. 
http://bit.ly/awsevals

Weitere ähnliche Inhalte

Was ist angesagt?

AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
Amazon Web Services
 

Was ist angesagt? (20)

AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
AWS March 2016 Webinar Series - Best Practices for Managing Security Operatio...
 
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
 
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
 
(DEV306) Building Cross-Platform Applications Using the AWS SDK for JavaScrip...
(DEV306) Building Cross-Platform Applications Using the AWS SDK for JavaScrip...(DEV306) Building Cross-Platform Applications Using the AWS SDK for JavaScrip...
(DEV306) Building Cross-Platform Applications Using the AWS SDK for JavaScrip...
 
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
 
Become an IAM Policy Ninja
Become an IAM Policy NinjaBecome an IAM Policy Ninja
Become an IAM Policy Ninja
 
Security Day IAM Recommended Practices
Security Day IAM Recommended PracticesSecurity Day IAM Recommended Practices
Security Day IAM Recommended Practices
 
AWS re:Invent 2016: Become an AWS IAM Policy Ninja in 60 Minutes or Less (SAC...
AWS re:Invent 2016: Become an AWS IAM Policy Ninja in 60 Minutes or Less (SAC...AWS re:Invent 2016: Become an AWS IAM Policy Ninja in 60 Minutes or Less (SAC...
AWS re:Invent 2016: Become an AWS IAM Policy Ninja in 60 Minutes or Less (SAC...
 
(SEC306) Turn on CloudTrail: Log API Activity in Your AWS Account | AWS re:In...
(SEC306) Turn on CloudTrail: Log API Activity in Your AWS Account | AWS re:In...(SEC306) Turn on CloudTrail: Log API Activity in Your AWS Account | AWS re:In...
(SEC306) Turn on CloudTrail: Log API Activity in Your AWS Account | AWS re:In...
 
AWS APAC Webinar Week - Securing Your Business on AWS
AWS APAC Webinar Week - Securing Your Business on AWSAWS APAC Webinar Week - Securing Your Business on AWS
AWS APAC Webinar Week - Securing Your Business on AWS
 
Transparency and Auditing on AWS
Transparency and Auditing on AWSTransparency and Auditing on AWS
Transparency and Auditing on AWS
 
Security Day IAM Recommended Practices
Security Day IAM Recommended PracticesSecurity Day IAM Recommended Practices
Security Day IAM Recommended Practices
 
Log Analytics with Amazon Elasticsearch Service - September Webinar Series
Log Analytics with Amazon Elasticsearch Service - September Webinar SeriesLog Analytics with Amazon Elasticsearch Service - September Webinar Series
Log Analytics with Amazon Elasticsearch Service - September Webinar Series
 
(SEC403) Building AWS Partner Applications Using IAM Roles | AWS re:Invent 2014
(SEC403) Building AWS Partner Applications Using IAM Roles | AWS re:Invent 2014(SEC403) Building AWS Partner Applications Using IAM Roles | AWS re:Invent 2014
(SEC403) Building AWS Partner Applications Using IAM Roles | AWS re:Invent 2014
 
AWS Webcast - Highly Available SQL Server on AWS
AWS Webcast - Highly Available SQL Server on AWS  AWS Webcast - Highly Available SQL Server on AWS
AWS Webcast - Highly Available SQL Server on AWS
 
AWS Enterprise Summit Netherlands - Creating a Landing Zone
AWS Enterprise Summit Netherlands - Creating a Landing ZoneAWS Enterprise Summit Netherlands - Creating a Landing Zone
AWS Enterprise Summit Netherlands - Creating a Landing Zone
 
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsSEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
Getting Started with Windows Workloads on Amazon EC2 - Toronto
 Getting Started with Windows Workloads on Amazon EC2 - Toronto Getting Started with Windows Workloads on Amazon EC2 - Toronto
Getting Started with Windows Workloads on Amazon EC2 - Toronto
 
Building Scalable Windows and .NET Apps on AWS (TLS302) | AWS re:Invent 2013
Building Scalable Windows and .NET Apps on AWS (TLS302) | AWS re:Invent 2013Building Scalable Windows and .NET Apps on AWS (TLS302) | AWS re:Invent 2013
Building Scalable Windows and .NET Apps on AWS (TLS302) | AWS re:Invent 2013
 

Andere mochten auch

Andere mochten auch (18)

Disaster Recovery Sites on AWS: Minimal Cost, Maximum Efficiency
Disaster Recovery Sites on AWS: Minimal Cost, Maximum EfficiencyDisaster Recovery Sites on AWS: Minimal Cost, Maximum Efficiency
Disaster Recovery Sites on AWS: Minimal Cost, Maximum Efficiency
 
Welcome to the AWS Cloud - AWS Symposium 2014 - Washington D.C.
Welcome to the AWS Cloud - AWS Symposium 2014 - Washington D.C. Welcome to the AWS Cloud - AWS Symposium 2014 - Washington D.C.
Welcome to the AWS Cloud - AWS Symposium 2014 - Washington D.C.
 
(BDT204) Rendering a Seamless Satellite Map of the World with AWS and NASA Da...
(BDT204) Rendering a Seamless Satellite Map of the World with AWS and NASA Da...(BDT204) Rendering a Seamless Satellite Map of the World with AWS and NASA Da...
(BDT204) Rendering a Seamless Satellite Map of the World with AWS and NASA Da...
 
(ENT210) Accelerating Business Innovation with DevOps on AWS | AWS re:Invent ...
(ENT210) Accelerating Business Innovation with DevOps on AWS | AWS re:Invent ...(ENT210) Accelerating Business Innovation with DevOps on AWS | AWS re:Invent ...
(ENT210) Accelerating Business Innovation with DevOps on AWS | AWS re:Invent ...
 
Build your own 4 node virtualized hadoop cluster
Build your own 4 node virtualized hadoop clusterBuild your own 4 node virtualized hadoop cluster
Build your own 4 node virtualized hadoop cluster
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
Running Complex Enterprise Workloads on AWS - Session sponsored by Fronde
Running Complex Enterprise Workloads on AWS - Session sponsored by FrondeRunning Complex Enterprise Workloads on AWS - Session sponsored by Fronde
Running Complex Enterprise Workloads on AWS - Session sponsored by Fronde
 
AWS Webcast - An Introduction to High Performance Computing on AWS
AWS Webcast - An Introduction to High Performance Computing on AWSAWS Webcast - An Introduction to High Performance Computing on AWS
AWS Webcast - An Introduction to High Performance Computing on AWS
 
(ENT311) Public IaaS Provider Bake-off: AWS vs Azure | AWS re:Invent 2014
(ENT311) Public IaaS Provider Bake-off: AWS vs Azure | AWS re:Invent 2014(ENT311) Public IaaS Provider Bake-off: AWS vs Azure | AWS re:Invent 2014
(ENT311) Public IaaS Provider Bake-off: AWS vs Azure | AWS re:Invent 2014
 
Federal Compliance Deep Dive: FISMA, FedRAMP, and Beyond - AWS Symposium 2014...
Federal Compliance Deep Dive: FISMA, FedRAMP, and Beyond - AWS Symposium 2014...Federal Compliance Deep Dive: FISMA, FedRAMP, and Beyond - AWS Symposium 2014...
Federal Compliance Deep Dive: FISMA, FedRAMP, and Beyond - AWS Symposium 2014...
 
Cloudera cluster setup and configuration
Cloudera cluster setup and configurationCloudera cluster setup and configuration
Cloudera cluster setup and configuration
 
Power Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS CloudPower Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS Cloud
 
(SDD413) Amazon S3 Deep Dive and Best Practices | AWS re:Invent 2014
(SDD413) Amazon S3 Deep Dive and Best Practices | AWS re:Invent 2014(SDD413) Amazon S3 Deep Dive and Best Practices | AWS re:Invent 2014
(SDD413) Amazon S3 Deep Dive and Best Practices | AWS re:Invent 2014
 
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
 
Hadoop AWS infrastructure cost evaluation
Hadoop AWS infrastructure cost evaluationHadoop AWS infrastructure cost evaluation
Hadoop AWS infrastructure cost evaluation
 
AWS Data Transfer Services: Accelerating Large-Scale Data Ingest Into the AWS...
AWS Data Transfer Services: Accelerating Large-Scale Data Ingest Into the AWS...AWS Data Transfer Services: Accelerating Large-Scale Data Ingest Into the AWS...
AWS Data Transfer Services: Accelerating Large-Scale Data Ingest Into the AWS...
 
Migrating Large Scale Data Sets to the Cloud
Migrating Large Scale Data Sets to the CloudMigrating Large Scale Data Sets to the Cloud
Migrating Large Scale Data Sets to the Cloud
 
Cloudera Impala technical deep dive
Cloudera Impala technical deep diveCloudera Impala technical deep dive
Cloudera Impala technical deep dive
 

Ähnlich wie (SEC303) Mastering Access Control Policies | AWS re:Invent 2014

Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
Jeremy Przygode
 
AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated Billing
Amazon Web Services
 

Ähnlich wie (SEC303) Mastering Access Control Policies | AWS re:Invent 2014 (20)

best aws training in bangalore
best aws training in bangalorebest aws training in bangalore
best aws training in bangalore
 
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
 
Mastering Access Control Policies (SEC302) | AWS re:Invent 2013
Mastering Access Control Policies (SEC302) | AWS re:Invent 2013Mastering Access Control Policies (SEC302) | AWS re:Invent 2013
Mastering Access Control Policies (SEC302) | AWS re:Invent 2013
 
Mastering Access Control Policies
Mastering Access Control PoliciesMastering Access Control Policies
Mastering Access Control Policies
 
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
 
Policy Ninja
Policy NinjaPolicy Ninja
Policy Ninja
 
Amazon Web Services Security
Amazon Web Services SecurityAmazon Web Services Security
Amazon Web Services Security
 
Masting Access Control Policies
Masting Access Control PoliciesMasting Access Control Policies
Masting Access Control Policies
 
Policy Ninja
Policy NinjaPolicy Ninja
Policy Ninja
 
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
 
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
 
Auto Scaling Groups
Auto Scaling GroupsAuto Scaling Groups
Auto Scaling Groups
 
SID314_IAM Policy Ninja
SID314_IAM Policy NinjaSID314_IAM Policy Ninja
SID314_IAM Policy Ninja
 
AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated Billing
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
 
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
 
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 Automating your Infrastructure Deployment with CloudFormation and OpsWorks –... Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 
AWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfAWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdf
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

(SEC303) Mastering Access Control Policies | AWS re:Invent 2014

  • 1.
  • 2.
  • 4.
  • 5. Amazon S3 Read-Only Access Template Example of an IAM user/group/role access policy { "Statement": [ { "Effect": "Allow", "Action": ["s3:Get*", "s3:List*"], "Resource": "*" } ] }
  • 6. { "Statement":[{ "Effect":"effect", "Principal":"principal", "Action":"action", "Resource":"arn", "Condition":{ "condition":{ "key":"value" } } } ] } Principal Action Resource Conditions Effect: Allow Principal:123456789012:user/bob Action: s3:* Resource: jeff_bucket/* Condition: Referer= example.com Effect: Deny Principal:123456789012:user/brad Action: s3:DeleteBucket Resource: jeff_bucket Condition: Referer= example.com
  • 7. <!--Everyone (anonymous users) --> "Principal":"AWS":"*.*" <!--Specific account or accounts --> "Principal":{"AWS":"arn:aws:iam::123456789012:root" } "Principal":{"AWS":"123456789012"} <!--Individual IAM user --> "Principal":"AWS":"arn:aws:iam::123456789012:user/username" <!--Federated user (using web identity federation) --> "Principal":{"Federated":"www.amazon.com"} "Principal":{"Federated":"graph.facebook.com"} "Principal":{"Federated":"accounts.google.com"} <!--Specific role --> "Principal":{"AWS":"arn:aws:iam::123456789012:role/rolename"} <!--Specific service --> "Principal":{"Service":"ec2.amazonaws.com"} Replace with your account number
  • 8. <!--EC2 action --> "Action":"ec2:StartInstances" <!--IAM action --> "Action":"iam:ChangePassword" <!--S3 action --> "Action":"s3:GetObject" <!--Specify multiple values for the Action element--> "Action":["sqs:SendMessage","sqs:ReceiveMessage"] <--Use wildcards (* or ?) as part of the action name. This would cover Create/Delete/List/Update--> "Action":"iam:*AccessKey*"
  • 9. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "NotAction": "iam:*", "Resource": "*" } ] } { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "*", "Resource": "*" }, { "Effect": "Deny", "Action": "iam:*", "Resource": "*" } ] } or This is not a Deny. A user could still have a separate policy that grants IAM:* If you want to prevent the user from ever being able to call IAM APIs, use an explicit deny Notice the difference?
  • 10. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "NotAction": "iam:*", "Resource": "*" } ] } { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "NotAction": "iam:*", "Resource": "*" }, { "Effect": "Deny", "Action": "iam:*", "Resource": "*" } ] } Even more strict Grants only what you want while ensuring you’re always denying what you don’t want granted.
  • 11. <--S3 Bucket --> "Resource":"arn:aws:s3:::my_corporate_bucket/*" <--SQS queue--> "Resource":"arn:aws:sqs:us-west-2:123456789012:queue1" <--Multiple DynamoDB tables --> "Resource":["arn:aws:dynamodb:us-west-2:123456789012:table/books_table", "arn:aws:dynamodb:us-west-2:123456789012:table/magazines_table"] <--All EC2 instances for an account in a region --> "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*"
  • 12. { "Statement": { "Sid":"Queue1_SendMessage", "Effect": "Allow", "Principal": {"AWS": "111122223333"}, "Action": "sqs:SendMessage", "Resource": "arn:aws:sqs:us-east-1:444455556666:queue1" } } Principal required here
  • 13. Condition Element Condition 1: Key1: Value1A Condition 2: Key3: Value3A AND AND Key2: Value2A ORValue2B OR OR Value1B Value 1C
  • 14. "Condition" : { "DateGreaterThan" : {"aws:CurrentTime" : "2014-11-13T12:00:00Z"}, "DateLessThan": {"aws:CurrentTime" : "2014-11-13T15:00:00Z"}, "IpAddress" : {"aws:SourceIp" : ["192.0.2.0/24", "203.0.113.0/24"]} } Allows a user to access a resource under the following conditions: •The time is after 12:00 p.m. on 11/13/2014 •The time is before 3:00 p.m. on 11/13/2014 •The request comes from an IP address in the 192.0.2.0 /24 or 203.0.113.0 /24 range AND OR
  • 15.
  • 16. { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::myBucket"], "Condition": {"StringLike": {"s3:prefix":["home/${aws:userid}/*"]} } }, { "Effect":"Allow", "Action":["s3:*"], "Resource": ["arn:aws:s3:::myBucket/home/${aws:userid}", "arn:aws:s3:::myBucket/home/${aws:userid}/*"] } ] } Version is required Variable in conditions Variable in resource ARNs Grants a user access to a home directory in Amazon S3 that can be accessed programmatically
  • 17. Giving a User a Home Directory From the Amazon S3 Console { "Version": "2012-10-17", "Statement": [ {"Sid": "AllowGroupToSeeBucketListInTheManagementConsole", "Action": ["s3:ListAllMyBuckets", "s3:GetBucketLocation"], "Effect": "Allow", "Resource": ["arn:aws:s3:::*"]}, {"Sid": "AllowRootLevelListingOfThisBucketAndHomePrefix", "Action": ["s3:ListBucket"], "Effect": "Allow", "Resource": ["arn:aws:s3:::myBucket"], "Condition":{"StringEquals":{"s3:prefix":["","home/"],"s3:delimiter":["/"]}}}, {"Sid": "AllowListBucketofASpecificUserPrefix", "Action": ["s3:ListBucket"], "Effect": "Allow", "Resource": ["arn:aws:s3:::myBucket"], "Condition":{"StringLike":{"s3:prefix":["home/${aws:username}/*"]}}}, {"Sid":"AllowUserFullAccesstoJustSpecificUserPrefix", "Action":["s3:*"], "Effect":"Allow", "Resource": ["arn:aws:s3:::myBucket/home/${aws:username}", "arn:aws:s3:::myBucket/home/${aws:username}/*"]} ] } Necessary to access the Amazon S3 console Allows listing all objects in a folder + its subfolders Allows modifying objects in the folder + subfolders
  • 18. Demo
  • 19. { "Version": "2012-10-17", "Statement": [{ "Sid": "ViewListOfAllUsers", "Action": ["iam:ListUsers"], "Effect": "Allow", "Resource": ["arn:aws:iam::123456789012:user/*"] }, { "Sid": "AllowUserToSeeListOfOwnStuff", "Action": ["iam:GetUser","iam:GetLoginProfile", "iam:ListGroupsForUser","iam:ListAccessKeys"], "Effect": "Allow", "Resource": ["arn:aws:iam::123456789012:user/${aws:username}"] } ] } •Underneath the covers, the IAM console calls these APIs •Keep in mind the user will be able to viewlimited details about all users •The IAM user will not be able to modify the other IAM users’ settings •Alternatively, use the CLI
  • 20. { "Version": "2012-10-17", "Statement": [ { "Action": ["iam:*AccessKey*","iam:*SigningCertificate*"], "Effect": "Allow", "Resource": ["arn:aws:iam::123456789012:user/${aws:username}"] } ] }
  • 21. { "Version": "2012-10-17", "Statement": [ { "Action": ["iam:CreateVirtualMFADevice","iam:DeleteVirtualMFADevice"], "Effect": "Allow", "Resource": "arn:aws:iam::123456789012:mfa/${aws:username}" }, { "Action": ["iam:DeactivateMFADevice", "iam:EnableMFADevice", "iam:ListMFADevices", "iam:ResyncMFADevice"], "Effect": "Allow", "Resource": "arn:aws:iam::123456789012:user/${aws:username}" }, { "Action": ["iam:ListVirtualMFADevices"], "Effect": "Allow", "Resource": "arn:aws:iam::123456789012:mfa/*" } ] }
  • 22. Demo
  • 23.
  • 24. { "Statement": [{ "Effect": "Allow", "Action": ["ec2:TerminateInstances"], "Resource":"*" } ] } Tell me there is a better way.
  • 25. { "Statement": [{ "Effect": "Allow", "Action": ["ec2:TerminateInstances"], "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-abc12345" } ] }
  • 26. { "Statement": [{ "Effect": "Allow", "Action": ["ec2:TerminateInstances"], "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*" } ] }
  • 27. { "Statement": [{ "Effect": "Allow", "Action": ["ec2:TerminateInstances"], "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*", "Condition": { "StringEquals": {"ec2:ResourceTag/department": "dev"} } } ] }
  • 28. •Customer gateway •DHCP options set •Image •Instance •Instance profile •Internet gateway •Key pair •Network ACL •Network interface •Placement group •Route table •Security group •Snapshot •Subnet •Volume •VPC •VPC peering connection Supports many different resource types, including:
  • 29. Type of Resource Actions EC2 Instances RebootInstances,RunInstance, StartInstances, StopInstances, TerminateInstances Customer gateway DeleteCustomerGateway DHCP Options Sets DeleteDhcpOptions Internet Gateways DeleteInternetGateway Network ACLs DeleteNetworkAcl, DeleteNetworkAclEntry Route Tables DeleteRoute, DeleteRouteTable Security Groups AuthorizeSecurityGroupEgress, AuthorizeSecurityGroupIngress, DeleteSecurityGroup, RevokeSecurityGroupEgress, RevokeSecurityGroupIngress Volumes AttachVolume, DeleteVolume, DetachVolume VPC Peering Connections AcceptVpcPeeringConnection, CreateVpcPeeringConnection, DeleteVpcPeeringConnection, RejectVpcPeeringConnection Accurate as of 11/13/2014 Note: This is only a subsetof all possible Amazon EC2 actions
  • 30.
  • 31. Demo
  • 32. { "Version": "2012-10-17", "Statement": [ { "Sid": "THISALLOWSEC2READACCESS", "Effect": "Allow", "Action": ["ec2:Describe*","elasticloadbalancing:Describe*", "cloudwatch:ListMetrics","cloudwatch:GetMetricStatistics", "cloudwatch:Describe*","autoscaling:Describe*"], "Resource": "*" }, { "Sid": "THISLIMITSACCESSTOOWNINSTANCES", "Effect": "Allow", "Action": ["ec2:RebootInstances","ec2:StartInstances", "ec2:StopInstances","ec2:TerminateInstances"], "Resource":"arn:aws:ec2:us-east-1:123456789012:instance/*", "Condition": {"StringEquals": {"ec2:ResourceTag/Owner": "${aws:username}"}} } ] } Version is required here because we’re using variables Only allowed if this tag condition is true Use a variable for the owner tag Allows seeing everything from the Amazon EC2 console.
  • 33. Ready for a quiz?
  • 34. { "Version": "2012-10-17", "Statement": [ { "Sid": "SorryThisIsNotGoingToWorkAsExpected", "Effect": "Allow", "Action": ["ec2:*"], "Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" } ] } Why doesn’t this work? Problem: Not all Amazon EC2 actions support resource-level permissions
  • 35. { "Version": "2012-10-17", "Statement": [ { "Sid": "Thiswillwork", "Effect": "Allow", "Action": ["ec2:*"], "Resource": "*" } ] } Solution: Change the resource to *
  • 36. { "Version": "2012-10-17", "Statement": [ { "Sid": "ThisWillNotWork", "Effect": "Allow", "Action": [ "ec2:RunInstances","ec2:TerminateInstances", "ec2:StopInstances","ec2:StartInstances", "ec2:Describe*" ], "Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" } ] } Why doesn’t this work? Problem: None of the ec2:Describe* actions support resource-level permissions
  • 37. { "Version": "2012-10-17", "Statement": [ { "Sid": "TheseActionsDontSupportResourceLevelPermissions", "Effect": "Allow", "Action": ["ec2:Describe*"], "Resource": "*" }, { "Sid": "TheseActionsSupportResourceLevelPermissions", "Effect": "Allow", "Action": [ "ec2:RunInstances","ec2:TerminateInstances", "ec2:StopInstances","ec2:StartInstances" ], "Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" } ] } Solution: Put ec2:Describe* into a separate block.
  • 38. { "Version": "2012-10-17", "Statement": [ { "Sid": "TheseActionsDontSupportResourceLevelPermissions", "Effect": "Allow", "Action": ["ec2:Describe*"], "Resource": "*" }, { "Sid": "TheseActionsSupportResourceLevelPermissions", "Effect": "Allow", "Action": [ "ec2:RunInstances","ec2:TerminateInstances", "ec2:StopInstances","ec2:StartInstances" ], "Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" } ] } So will this work now? No
  • 39. { "Version": "2012-10-17", "Statement": [{ "Sid": "TheseActionsDontSupportResourceLevelPermissions", "Effect": "Allow", "Action": ["ec2:Describe*"], "Resource": "*"}, { "Sid": "ThisActionsSupportResourceLevelPermissions", "Effect": "Allow", "Action": ["ec2:RunInstances"], "Resource": [ "arn:aws:ec2:us-east-1:accountid:instance/*", "arn:aws:ec2:us-east-1:accountid:key-pair/*", "arn:aws:ec2:us-east-1:accountid:security-group/*", "arn:aws:ec2:us-east-1:accountid:volume/*", "arn:aws:ec2:us-east-1::image/ami-*"]}, { "Sid": "TheseActionsSupportResourceLevelPermissions", "Effect": "Allow", "Action": [ "ec2:TerminateInstances", "ec2:StopInstances", "ec2:StartInstances"], "Resource": "arn:aws:ec2:us-east-1:accountid:instance/*" } ] To run an EC2 instance, you also need access to an Amazon EC2 key pair, a security group, an EBS volume, and an AMI .
  • 40.
  • 41. 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 & 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, a implicit (default) deny is returned
  • 42.
  • 43. http://aws.amazon.com/documentation/iam/ http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ec2-api- permissions.htmlDemystifying- EC2-Resource-Level-PermissionsGranting-Users-Permission-to-Work-in-the-Amazon-EC2-Consolehttp://aws.amazon.com/iamhttps://forums.aws.amazon.com/forum.jspa?forumID=76
  • 44. Please give us your feedback on this session. Complete session evaluations and earn re:Invent swag. http://bit.ly/awsevals