Skip to content

Commit

Permalink
Updates AWS managed policies
Browse files Browse the repository at this point in the history
  • Loading branch information
udondan committed Aug 30, 2024
1 parent 2f74a51 commit a427e98
Show file tree
Hide file tree
Showing 34 changed files with 744 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"cloudtrail:LookupEvents",
"ec2:RequestSpotInstances",
"ec2:RunInstances",
"ec2:StartInstances",
"iam:AddUserToGroup",
"iam:AttachGroupPolicy",
"iam:AttachRolePolicy",
"iam:AttachUserPolicy",
"iam:ChangePassword",
"iam:CreateAccessKey",
"iam:CreateInstanceProfile",
"iam:CreateLoginProfile",
"iam:CreatePolicyVersion",
"iam:CreateRole",
"iam:CreateUser",
"iam:DetachUserPolicy",
"iam:PassRole",
"iam:PutGroupPolicy",
"iam:PutRolePolicy",
"iam:PutUserPermissionsBoundary",
"iam:PutUserPolicy",
"iam:SetDefaultPolicyVersion",
"iam:UpdateAccessKey",
"iam:UpdateAccountPasswordPolicy",
"iam:UpdateAssumeRolePolicy",
"iam:UpdateLoginProfile",
"iam:UpdateUser",
"lambda:AddLayerVersionPermission",
"lambda:AddPermission",
"lambda:CreateFunction",
"lambda:GetPolicy",
"lambda:ListTags",
"lambda:PutProvisionedConcurrencyConfig",
"lambda:TagResource",
"lambda:UntagResource",
"lambda:UpdateFunctionCode",
"lightsail:Create*",
"lightsail:Delete*",
"lightsail:DownloadDefaultKeyPair",
"lightsail:GetInstanceAccessDetails",
"lightsail:Start*",
"lightsail:Update*",
"organizations:CreateAccount",
"organizations:CreateOrganization",
"organizations:InviteAccountToOrganization",
"s3:DeleteBucket",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:PutLifecycleConfiguration",
"s3:PutBucketAcl",
"s3:PutBucketOwnershipControls",
"s3:DeleteBucketPolicy",
"s3:ObjectOwnerOverrideToBucketOwner",
"s3:PutAccountPublicAccessBlock",
"s3:PutBucketPolicy",
"s3:ListAllMyBuckets",
"ec2:PurchaseReservedInstancesOffering",
"ec2:AcceptReservedInstancesExchangeQuote",
"ec2:CreateReservedInstancesListing",
"savingsplans:CreateSavingsPlan"
],
"Resource": [
"*"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DataExchangeActions",
"Effect": "Allow",
"Action": [
"dataexchange:CreateDataSet",
Expand All @@ -16,12 +17,14 @@
"dataexchange:PublishDataSet",
"dataexchange:SendApiAsset",
"dataexchange:RevokeRevision",
"dataexchange:SendDataSetNotification",
"tag:GetTagKeys",
"tag:GetTagValues"
],
"Resource": "*"
},
{
"Sid": "DataExchangeJobsActions",
"Effect": "Allow",
"Action": [
"dataexchange:CreateJob",
Expand All @@ -43,6 +46,7 @@
}
},
{
"Sid": "S3GetActionConditionalResourceAndADX",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::*aws-data-exchange*",
Expand All @@ -55,6 +59,7 @@
}
},
{
"Sid": "S3GetActionConditionalTagAndADX",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "*",
Expand All @@ -70,6 +75,7 @@
}
},
{
"Sid": "S3WriteActions",
"Effect": "Allow",
"Action": [
"s3:PutObject",
Expand All @@ -85,6 +91,7 @@
}
},
{
"Sid": "S3ReadActions",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
Expand All @@ -94,6 +101,7 @@
"Resource": "*"
},
{
"Sid": "AWSMarketplaceActions",
"Effect": "Allow",
"Action": [
"aws-marketplace:DescribeEntity",
Expand All @@ -113,6 +121,7 @@
"Resource": "*"
},
{
"Sid": "KMSActions",
"Effect": "Allow",
"Action": [
"kms:DescribeKey",
Expand All @@ -122,6 +131,7 @@
"Resource": "*"
},
{
"Sid": "RedshiftConditionalActions",
"Effect": "Allow",
"Action": [
"redshift:AuthorizeDataShare"
Expand All @@ -134,6 +144,7 @@
}
},
{
"Sid": "RedshiftActions",
"Effect": "Allow",
"Action": [
"redshift:DescribeDataSharesForProducer",
Expand All @@ -142,6 +153,7 @@
"Resource": "*"
},
{
"Sid": "APIGatewayActions",
"Effect": "Allow",
"Action": [
"apigateway:GET"
Expand Down
210 changes: 210 additions & 0 deletions docs/source/_static/managed-policies/AWSPCSServiceRolePolicy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PermissionsToCreatePCSNetworkInterfaces",
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface"
],
"Resource": "arn:aws:ec2:*:*:network-interface/*",
"Condition": {
"Null": {
"aws:RequestTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToCreatePCSNetworkInterfacesInSubnet",
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface"
],
"Resource": [
"arn:aws:ec2:*:*:subnet/*",
"arn:aws:ec2:*:*:security-group/*"
]
},
{
"Sid": "PermissionsToManagePCSNetworkInterfaces",
"Effect": "Allow",
"Action": [
"ec2:DeleteNetworkInterface",
"ec2:CreateNetworkInterfacePermission"
],
"Resource": "arn:aws:ec2:*:*:network-interface/*",
"Condition": {
"Null": {
"aws:ResourceTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToDescribePCSResources",
"Effect": "Allow",
"Action": [
"ec2:DescribeSubnets",
"ec2:DescribeVpcs",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeLaunchTemplates",
"ec2:DescribeLaunchTemplateVersions",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypes",
"ec2:DescribeInstanceStatus",
"ec2:DescribeInstanceAttribute",
"ec2:DescribeSecurityGroups",
"ec2:DescribeKeyPairs",
"ec2:DescribeImages",
"ec2:DescribeImageAttribute"
],
"Resource": "*"
},
{
"Sid": "PermissionsToCreatePCSLaunchTemplates",
"Effect": "Allow",
"Action": [
"ec2:CreateLaunchTemplate"
],
"Resource": "arn:aws:ec2:*:*:launch-template/*",
"Condition": {
"Null": {
"aws:RequestTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToManagePCSLaunchTemplates",
"Effect": "Allow",
"Action": [
"ec2:DeleteLaunchTemplate",
"ec2:DeleteLaunchTemplateVersions",
"ec2:CreateLaunchTemplateVersion"
],
"Resource": "arn:aws:ec2:*:*:launch-template/*",
"Condition": {
"Null": {
"aws:ResourceTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToTerminatePCSManagedInstances",
"Effect": "Allow",
"Action": [
"ec2:TerminateInstances"
],
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"Null": {
"aws:ResourceTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToPassRoleToEC2",
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": [
"arn:aws:iam::*:role/*/AWSPCS*",
"arn:aws:iam::*:role/AWSPCS*",
"arn:aws:iam::*:role/aws-pcs/*",
"arn:aws:iam::*:role/*/aws-pcs/*"
],
"Condition": {
"StringEquals": {
"iam:PassedToService": [
"ec2.amazonaws.com"
]
}
}
},
{
"Sid": "PermissionsToControlClusterInstanceAttributes",
"Effect": "Allow",
"Action": [
"ec2:RunInstances",
"ec2:CreateFleet"
],
"Resource": [
"arn:aws:ec2:*::image/*",
"arn:aws:ec2:*::snapshot/*",
"arn:aws:ec2:*:*:subnet/*",
"arn:aws:ec2:*:*:network-interface/*",
"arn:aws:ec2:*:*:security-group/*",
"arn:aws:ec2:*:*:volume/*",
"arn:aws:ec2:*:*:key-pair/*",
"arn:aws:ec2:*:*:launch-template/*",
"arn:aws:ec2:*:*:placement-group/*",
"arn:aws:ec2:*:*:capacity-reservation/*",
"arn:aws:resource-groups:*:*:group/*",
"arn:aws:ec2:*:*:fleet/*",
"arn:aws:ec2:*:*:spot-instances-request/*"
]
},
{
"Sid": "PermissionsToProvisionClusterInstances",
"Effect": "Allow",
"Action": [
"ec2:RunInstances",
"ec2:CreateFleet"
],
"Resource": [
"arn:aws:ec2:*:*:instance/*"
],
"Condition": {
"Null": {
"aws:RequestTag/AWSPCSManaged": "false"
}
}
},
{
"Sid": "PermissionsToTagPCSResources",
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": [
"*"
],
"Condition": {
"StringEquals": {
"ec2:CreateAction": [
"RunInstances",
"CreateLaunchTemplate",
"CreateFleet",
"CreateNetworkInterface"
]
}
}
},
{
"Sid": "PermissionsToPublishMetrics",
"Effect": "Allow",
"Action": "cloudwatch:PutMetricData",
"Resource": "*",
"Condition": {
"StringEquals": {
"cloudwatch:namespace": "AWS/PCS"
}
}
},
{
"Sid": "PermissionsToManageSecret",
"Effect": "Allow",
"Action": [
"secretsmanager:DescribeSecret",
"secretsmanager:GetSecretValue",
"secretsmanager:PutSecretValue",
"secretsmanager:UpdateSecretVersionStage",
"secretsmanager:DeleteSecret"
],
"Resource": "arn:aws:secretsmanager:*:*:secret:pcs!*",
"Condition": {
"StringEquals": {
"secretsmanager:ResourceTag/aws:secretsmanager:owningService": "pcs",
"aws:ResourceAccount": "${aws:PrincipalAccount}"
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"Sid": "CloudTrailEventsAccess",
"Effect": "Allow",
"Action": [
"cloudtrail:CreateServiceLinkedChannel"
"cloudtrail:CreateServiceLinkedChannel",
"cloudtrail:GetServiceLinkedChannel"
],
"Resource": [
"arn:aws:cloudtrail:*:*:channel/aws-service-channel/resource-explorer-2/*"
Expand Down
Loading

0 comments on commit a427e98

Please sign in to comment.