2017-11-21 23:15:31 +01:00
|
|
|
{# Not all Autoscaling API Actions allow specified resources #}
|
|
|
|
{# See http://docs.aws.amazon.com/autoscaling/latest/userguide/control-access-using-iam.html#policy-auto-scaling-resources #}
|
|
|
|
{
|
|
|
|
"Version": "2012-10-17",
|
|
|
|
"Statement": [
|
|
|
|
{
|
|
|
|
"Sid": "DescribeAutoscaling",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"autoscaling:DescribeAutoScalingGroups",
|
|
|
|
"autoscaling:DescribeLaunchConfigurations",
|
|
|
|
"autoscaling:DescribePolicies"
|
|
|
|
],
|
|
|
|
"Resource": "*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowAutoscaling",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
2019-08-23 20:53:47 +02:00
|
|
|
"autoscaling:*LaunchConfiguration",
|
|
|
|
"autoscaling:*AutoScalingGroup",
|
|
|
|
"autoscaling:*MetricsCollection",
|
2017-11-21 23:15:31 +01:00
|
|
|
"autoscaling:PutScalingPolicy",
|
|
|
|
"autoscaling:DeletePolicy"
|
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"arn:aws:autoscaling:{{aws_region}}:{{aws_account}}:*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{# Note that not all EC2 API Actions allow a specific resource #}
|
|
|
|
{# See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ec2-api-permissions.html#ec2-api-unsupported-resource-permissions #}
|
|
|
|
{
|
|
|
|
"Sid": "AllowUnspecifiedEC2Resource",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
2019-09-04 21:33:01 +02:00
|
|
|
"ec2:*LaunchTemplate",
|
|
|
|
"ec2:*LaunchTemplateVersion",
|
|
|
|
"ec2:*LaunchTemplateVersions",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:AllocateAddress",
|
|
|
|
"ec2:AssociateAddress",
|
2017-12-05 22:41:16 +01:00
|
|
|
"ec2:AssociateDhcpOptions",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:AssociateRouteTable",
|
|
|
|
"ec2:AssociateVpcCidrBlock",
|
|
|
|
"ec2:AssociateSubnetCidrBlock",
|
|
|
|
"ec2:AttachInternetGateway",
|
2019-03-06 13:46:37 +01:00
|
|
|
"ec2:AttachNetworkInterface",
|
2019-07-04 21:25:19 +02:00
|
|
|
"ec2:AttachVolume",
|
2018-05-15 18:13:46 +02:00
|
|
|
"ec2:AttachVpnGateway",
|
|
|
|
"ec2:CreateCustomerGateway",
|
2017-12-05 22:41:16 +01:00
|
|
|
"ec2:CreateDhcpOptions",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:CreateImage",
|
|
|
|
"ec2:CreateInternetGateway",
|
|
|
|
"ec2:CreateKeyPair",
|
|
|
|
"ec2:CreateNatGateway",
|
2019-07-04 21:25:19 +02:00
|
|
|
"ec2:CreateNetworkInterface",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:CreateRoute",
|
|
|
|
"ec2:CreateRouteTable",
|
|
|
|
"ec2:CreateSecurityGroup",
|
|
|
|
"ec2:CreateSnapshot",
|
|
|
|
"ec2:CreateSubnet",
|
|
|
|
"ec2:CreateTags",
|
|
|
|
"ec2:CreateVpc",
|
2018-05-15 18:13:46 +02:00
|
|
|
"ec2:CreateVpnConnection",
|
|
|
|
"ec2:CreateVpnGateway",
|
|
|
|
"ec2:DeleteCustomerGateway",
|
2017-12-05 22:41:16 +01:00
|
|
|
"ec2:DeleteDhcpOptions",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:DeleteInternetGateway",
|
|
|
|
"ec2:DeleteKeyPair",
|
|
|
|
"ec2:DeleteNatGateway",
|
2019-07-04 21:25:19 +02:00
|
|
|
"ec2:DeleteNetworkInterface",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:DeleteRoute",
|
|
|
|
"ec2:DeleteRouteTable",
|
|
|
|
"ec2:DeleteSnapshot",
|
|
|
|
"ec2:DeleteSubnet",
|
|
|
|
"ec2:DeleteTags",
|
|
|
|
"ec2:DeleteVpc",
|
2018-05-15 18:13:46 +02:00
|
|
|
"ec2:DeleteVpnConnection",
|
|
|
|
"ec2:DeleteVpnGateway",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:DeregisterImage",
|
|
|
|
"ec2:DetachInternetGateway",
|
2018-05-15 18:13:46 +02:00
|
|
|
"ec2:DetachVpnGateway",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:Describe*",
|
|
|
|
"ec2:DisassociateAddress",
|
|
|
|
"ec2:DisassociateRouteTable",
|
2018-05-25 12:31:54 +02:00
|
|
|
"ec2:DisassociateSubnetCidrBlock",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:ImportKeyPair",
|
|
|
|
"ec2:ModifyImageAttribute",
|
2019-03-06 13:46:37 +01:00
|
|
|
"ec2:ModifyInstanceAttribute",
|
2018-05-25 12:31:54 +02:00
|
|
|
"ec2:ModifySubnetAttribute",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:ModifyVpcAttribute",
|
|
|
|
"ec2:RegisterImage",
|
|
|
|
"ec2:ReleaseAddress",
|
2019-06-28 12:28:47 +02:00
|
|
|
"ec2:ReplaceRouteTableAssociation",
|
2019-07-04 21:25:19 +02:00
|
|
|
"ec2:ReplaceIamInstanceProfileAssociation",
|
2019-06-28 12:28:47 +02:00
|
|
|
"ec2:ReportInstanceStatus"
|
2017-11-21 23:15:31 +01:00
|
|
|
],
|
|
|
|
"Resource": "*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowSpecifiedEC2Resource",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"ec2:AuthorizeSecurityGroupIngress",
|
|
|
|
"ec2:AuthorizeSecurityGroupEgress",
|
|
|
|
"ec2:CreateTags",
|
2018-07-27 21:45:18 +02:00
|
|
|
"ec2:CreateVolume",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:DeleteRouteTable",
|
|
|
|
"ec2:DeleteSecurityGroup",
|
2018-07-27 21:45:18 +02:00
|
|
|
"ec2:DeleteVolume",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:RevokeSecurityGroupEgress",
|
|
|
|
"ec2:RevokeSecurityGroupIngress",
|
|
|
|
"ec2:RunInstances",
|
2019-03-06 13:46:37 +01:00
|
|
|
"ec2:StartInstances",
|
|
|
|
"ec2:StopInstances",
|
2017-11-21 23:15:31 +01:00
|
|
|
"ec2:TerminateInstances",
|
|
|
|
"ec2:UpdateSecurityGroupRuleDescriptionsIngress",
|
|
|
|
"ec2:UpdateSecurityGroupRuleDescriptionsEgress"
|
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"arn:aws:ec2:{{aws_region}}::image/*",
|
|
|
|
"arn:aws:ec2:{{aws_region}}:{{aws_account}}:*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{# According to http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/load-balancer-authentication-access-control.html #}
|
|
|
|
{# Resource level access control is not possible for the new ELB API (providing Application Load Balancer functionality #}
|
|
|
|
{# While it remains possible for the old API, there is no distinction of the Actions between old API and new API #}
|
|
|
|
{
|
|
|
|
"Sid": "AllowLoadBalancerOperations",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
2018-05-03 14:36:52 +02:00
|
|
|
"elasticloadbalancing:AddTags",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:ConfigureHealthCheck",
|
2017-12-15 14:15:01 +01:00
|
|
|
"elasticloadbalancing:CreateListener",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:CreateLoadBalancer",
|
|
|
|
"elasticloadbalancing:CreateLoadBalancerListeners",
|
2019-08-02 02:40:53 +02:00
|
|
|
"elasticloadbalancing:CreateRule",
|
2017-12-15 14:15:01 +01:00
|
|
|
"elasticloadbalancing:CreateTargetGroup",
|
|
|
|
"elasticloadbalancing:DeleteListener",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:DeleteLoadBalancer",
|
|
|
|
"elasticloadbalancing:DeleteLoadBalancerListeners",
|
2019-08-02 02:40:53 +02:00
|
|
|
"elasticloadbalancing:DeleteRule",
|
2017-12-15 14:15:01 +01:00
|
|
|
"elasticloadbalancing:DeleteTargetGroup",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
|
|
|
|
"elasticloadbalancing:DescribeInstanceHealth",
|
2019-07-04 21:25:19 +02:00
|
|
|
"elasticloadbalancing:DescribeLoadBalancer*",
|
2018-05-03 14:36:52 +02:00
|
|
|
"elasticloadbalancing:DescribeTags",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:DisableAvailabilityZonesForLoadBalancer",
|
|
|
|
"elasticloadbalancing:EnableAvailabilityZonesForLoadBalancer",
|
2019-08-02 02:40:53 +02:00
|
|
|
"elasticloadbalancing:ModifyListener",
|
2017-11-21 23:15:31 +01:00
|
|
|
"elasticloadbalancing:ModifyLoadBalancerAttributes",
|
2019-08-02 02:40:53 +02:00
|
|
|
"elasticloadbalancing:ModifyRule",
|
2018-05-03 14:36:52 +02:00
|
|
|
"elasticloadbalancing:RegisterInstancesWithLoadBalancer",
|
|
|
|
"elasticloadbalancing:RemoveTags"
|
2017-11-21 23:15:31 +01:00
|
|
|
],
|
|
|
|
"Resource": "*"
|
|
|
|
},
|
|
|
|
{# Only certain lambda actions can be restricted to a specific resource #}
|
|
|
|
{# http://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html #}
|
|
|
|
{
|
|
|
|
"Sid": "AllowApiGateway",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"apigateway:*"
|
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"arn:aws:apigateway:{{aws_region}}::/*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowGetUserForLambdaCreation",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"iam:GetUser"
|
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"arn:aws:iam::{{aws_account}}:user/ansible_integration_tests"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowLambdaManagementWithoutResource",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"lambda:CreateEventSourceMapping",
|
|
|
|
"lambda:GetAccountSettings",
|
|
|
|
"lambda:GetEventSourceMapping",
|
2019-07-04 21:25:19 +02:00
|
|
|
"lambda:List*",
|
2017-11-21 23:15:31 +01:00
|
|
|
"lambda:TagResource",
|
|
|
|
"lambda:UntagResource"
|
|
|
|
],
|
|
|
|
"Resource": "*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowLambdaManagementWithResource",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"lambda:AddPermission",
|
|
|
|
"lambda:CreateAlias",
|
|
|
|
"lambda:CreateFunction",
|
|
|
|
"lambda:DeleteAlias",
|
|
|
|
"lambda:DeleteFunction",
|
|
|
|
"lambda:GetAlias",
|
|
|
|
"lambda:GetFunction",
|
|
|
|
"lambda:GetFunctionConfiguration",
|
|
|
|
"lambda:GetPolicy",
|
|
|
|
"lambda:InvokeFunction",
|
|
|
|
"lambda:PublishVersion",
|
|
|
|
"lambda:RemovePermission",
|
|
|
|
"lambda:UpdateAlias",
|
|
|
|
"lambda:UpdateEventSourceMapping",
|
|
|
|
"lambda:UpdateFunctionCode",
|
|
|
|
"lambda:UpdateFunctionConfiguration"
|
|
|
|
],
|
|
|
|
"Resource": "arn:aws:lambda:{{aws_region}}:{{aws_account}}:function:*"
|
|
|
|
},
|
|
|
|
{
|
2017-12-15 14:15:01 +01:00
|
|
|
"Sid": "AllowRoleManagement",
|
2017-11-21 23:15:31 +01:00
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"iam:PassRole"
|
|
|
|
],
|
|
|
|
"Resource": [
|
2017-12-15 14:15:01 +01:00
|
|
|
"arn:aws:iam::{{aws_account}}:role/ansible_lambda_role",
|
|
|
|
"arn:aws:iam::{{aws_account}}:role/ecsInstanceRole",
|
2019-07-04 21:25:19 +02:00
|
|
|
"arn:aws:iam::{{aws_account}}:role/ec2InstanceRole",
|
2018-06-07 14:44:04 +02:00
|
|
|
"arn:aws:iam::{{aws_account}}:role/ecsServiceRole",
|
2018-07-12 15:16:41 +02:00
|
|
|
"arn:aws:iam::{{aws_account}}:role/aws_eks_cluster_role",
|
|
|
|
"arn:aws:iam::{{aws_account}}:role/ecsTaskExecutionRole"
|
2017-11-21 23:15:31 +01:00
|
|
|
]
|
2017-12-15 14:15:01 +01:00
|
|
|
},
|
2018-01-29 21:35:49 +01:00
|
|
|
{
|
|
|
|
"Sid": "AllowSESManagement",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"ses:VerifyEmailIdentity",
|
|
|
|
"ses:DeleteIdentity",
|
|
|
|
"ses:GetIdentityVerificationAttributes",
|
|
|
|
"ses:GetIdentityNotificationAttributes",
|
|
|
|
"ses:VerifyDomainIdentity",
|
|
|
|
"ses:SetIdentityNotificationTopic",
|
|
|
|
"ses:SetIdentityHeadersInNotificationsEnabled",
|
2018-04-05 21:11:12 +02:00
|
|
|
"ses:SetIdentityFeedbackForwardingEnabled",
|
|
|
|
"ses:GetIdentityPolicies",
|
|
|
|
"ses:PutIdentityPolicy",
|
|
|
|
"ses:DeleteIdentityPolicy",
|
2018-11-14 18:15:24 +01:00
|
|
|
"ses:ListIdentityPolicies",
|
|
|
|
"ses:SetIdentityFeedbackForwardingEnabled",
|
|
|
|
"ses:ListReceiptRuleSets",
|
|
|
|
"ses:DescribeReceiptRuleSet",
|
|
|
|
"ses:DescribeActiveReceiptRuleSet",
|
|
|
|
"ses:SetActiveReceiptRuleSet",
|
|
|
|
"ses:CreateReceiptRuleSet",
|
|
|
|
"ses:DeleteReceiptRuleSet"
|
2018-01-29 21:35:49 +01:00
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Sid": "AllowSNSManagement",
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Action": [
|
|
|
|
"SNS:CreateTopic",
|
|
|
|
"SNS:DeleteTopic",
|
|
|
|
"SNS:GetTopicAttributes",
|
2018-08-24 03:04:18 +02:00
|
|
|
"SNS:ListSubscriptions",
|
|
|
|
"SNS:ListSubscriptionsByTopic",
|
|
|
|
"SNS:ListTopics",
|
|
|
|
"SNS:SetTopicAttributes",
|
|
|
|
"SNS:Subscribe",
|
|
|
|
"SNS:Unsubscribe"
|
2018-01-29 21:35:49 +01:00
|
|
|
],
|
|
|
|
"Resource": [
|
|
|
|
"*"
|
|
|
|
]
|
2017-11-21 23:15:31 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|