mirror of https://github.com/kubernetes/kops.git
Expand TestPolicyGeneration to cover gossip/no-gossip cases
This commit is contained in:
parent
9ce6bc9460
commit
7f6b524d5b
|
|
@ -97,6 +97,7 @@ func TestRoundTrip(t *testing.T) {
|
|||
|
||||
func TestPolicyGeneration(t *testing.T) {
|
||||
grid := []struct {
|
||||
Gossip bool
|
||||
Role Subject
|
||||
AllowContainerRegistry bool
|
||||
Policy string
|
||||
|
|
@ -111,6 +112,18 @@ func TestPolicyGeneration(t *testing.T) {
|
|||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_master_strict_ecr.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleMaster{},
|
||||
AllowContainerRegistry: false,
|
||||
Policy: "tests/iam_builder_master_gossip.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleMaster{},
|
||||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_master_gossip_ecr.json",
|
||||
},
|
||||
{
|
||||
Role: &NodeRoleNode{},
|
||||
AllowContainerRegistry: false,
|
||||
|
|
@ -121,6 +134,18 @@ func TestPolicyGeneration(t *testing.T) {
|
|||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_node_strict_ecr.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleNode{},
|
||||
AllowContainerRegistry: false,
|
||||
Policy: "tests/iam_builder_node_gossip.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleNode{},
|
||||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_node_gossip_ecr.json",
|
||||
},
|
||||
{
|
||||
Role: &NodeRoleBastion{},
|
||||
AllowContainerRegistry: false,
|
||||
|
|
@ -131,6 +156,18 @@ func TestPolicyGeneration(t *testing.T) {
|
|||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_bastion.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleBastion{},
|
||||
AllowContainerRegistry: false,
|
||||
Policy: "tests/iam_builder_bastion.json",
|
||||
},
|
||||
{
|
||||
Gossip: true,
|
||||
Role: &NodeRoleBastion{},
|
||||
AllowContainerRegistry: true,
|
||||
Policy: "tests/iam_builder_bastion.json",
|
||||
},
|
||||
}
|
||||
|
||||
for i, x := range grid {
|
||||
|
|
@ -178,7 +215,11 @@ func TestPolicyGeneration(t *testing.T) {
|
|||
Role: x.Role,
|
||||
Partition: "aws-test",
|
||||
}
|
||||
b.Cluster.SetName("iam-builder-test.k8s.local")
|
||||
if x.Gossip {
|
||||
b.Cluster.SetName("iam-builder-test.k8s.local")
|
||||
} else {
|
||||
b.Cluster.SetName("iam-builder-test.nonexistant")
|
||||
}
|
||||
|
||||
p, err := b.BuildAWSPolicy()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,226 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": "ec2:AttachVolume",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:ResourceTag/k8s.io/role/master": "1"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetEncryptionConfiguration",
|
||||
"s3:ListBucket",
|
||||
"s3:ListBucketVersions"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"ec2:CreateAction": [
|
||||
"CreateSecurityGroup"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:security-group/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteTags"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:security-group/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"ec2:CreateAction": [
|
||||
"CreateVolume",
|
||||
"CreateSnapshot"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:volume/*",
|
||||
"arn:aws-test:ec2:*:*:snapshot/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteTags"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:volume/*",
|
||||
"arn:aws-test:ec2:*:*:snapshot/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:DescribeAutoScalingGroups",
|
||||
"autoscaling:DescribeAutoScalingInstances",
|
||||
"autoscaling:DescribeLaunchConfigurations",
|
||||
"autoscaling:DescribeScalingActivities",
|
||||
"autoscaling:DescribeTags",
|
||||
"ec2:AttachVolume",
|
||||
"ec2:AuthorizeSecurityGroupIngress",
|
||||
"ec2:CreateSecurityGroup",
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteRoute",
|
||||
"ec2:DeleteSecurityGroup",
|
||||
"ec2:DeleteVolume",
|
||||
"ec2:DescribeAccountAttributes",
|
||||
"ec2:DescribeAvailabilityZones",
|
||||
"ec2:DescribeInstanceTypes",
|
||||
"ec2:DescribeInstances",
|
||||
"ec2:DescribeLaunchTemplateVersions",
|
||||
"ec2:DescribeRegions",
|
||||
"ec2:DescribeRouteTables",
|
||||
"ec2:DescribeSecurityGroups",
|
||||
"ec2:DescribeSubnets",
|
||||
"ec2:DescribeTags",
|
||||
"ec2:DescribeVolumes",
|
||||
"ec2:DescribeVolumesModifications",
|
||||
"ec2:DescribeVpcs",
|
||||
"ec2:DetachVolume",
|
||||
"ec2:ModifyInstanceAttribute",
|
||||
"ec2:ModifyVolume",
|
||||
"elasticloadbalancing:AddTags",
|
||||
"elasticloadbalancing:CreateListener",
|
||||
"elasticloadbalancing:CreateTargetGroup",
|
||||
"elasticloadbalancing:DeleteListener",
|
||||
"elasticloadbalancing:DescribeListeners",
|
||||
"elasticloadbalancing:DescribeLoadBalancerAttributes",
|
||||
"elasticloadbalancing:DescribeLoadBalancerPolicies",
|
||||
"elasticloadbalancing:DescribeLoadBalancers",
|
||||
"elasticloadbalancing:DescribeTargetGroups",
|
||||
"elasticloadbalancing:DescribeTargetHealth",
|
||||
"elasticloadbalancing:ModifyListener",
|
||||
"elasticloadbalancing:RegisterTargets",
|
||||
"iam:GetServerCertificate",
|
||||
"iam:ListServerCertificates",
|
||||
"kms:CreateGrant",
|
||||
"kms:Decrypt",
|
||||
"kms:DescribeKey",
|
||||
"kms:Encrypt",
|
||||
"kms:GenerateDataKey*",
|
||||
"kms:GenerateRandom",
|
||||
"kms:ReEncrypt*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:SetDesiredCapacity",
|
||||
"autoscaling:TerminateInstanceInAutoScalingGroup",
|
||||
"ec2:AttachVolume",
|
||||
"ec2:AuthorizeSecurityGroupIngress",
|
||||
"ec2:CreateRoute",
|
||||
"ec2:DeleteRoute",
|
||||
"ec2:DeleteSecurityGroup",
|
||||
"ec2:DeleteVolume",
|
||||
"ec2:DetachVolume",
|
||||
"ec2:ModifyInstanceAttribute",
|
||||
"ec2:ModifyVolume",
|
||||
"ec2:RevokeSecurityGroupIngress",
|
||||
"elasticloadbalancing:AddTags",
|
||||
"elasticloadbalancing:ApplySecurityGroupsToLoadBalancer",
|
||||
"elasticloadbalancing:AttachLoadBalancerToSubnets",
|
||||
"elasticloadbalancing:ConfigureHealthCheck",
|
||||
"elasticloadbalancing:CreateLoadBalancerListeners",
|
||||
"elasticloadbalancing:CreateLoadBalancerPolicy",
|
||||
"elasticloadbalancing:DeleteListener",
|
||||
"elasticloadbalancing:DeleteLoadBalancer",
|
||||
"elasticloadbalancing:DeleteLoadBalancerListeners",
|
||||
"elasticloadbalancing:DeleteTargetGroup",
|
||||
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
|
||||
"elasticloadbalancing:DeregisterTargets",
|
||||
"elasticloadbalancing:DetachLoadBalancerFromSubnets",
|
||||
"elasticloadbalancing:ModifyListener",
|
||||
"elasticloadbalancing:ModifyLoadBalancerAttributes",
|
||||
"elasticloadbalancing:ModifyTargetGroup",
|
||||
"elasticloadbalancing:RegisterInstancesWithLoadBalancer",
|
||||
"elasticloadbalancing:RegisterTargets",
|
||||
"elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer",
|
||||
"elasticloadbalancing:SetLoadBalancerPoliciesOfListener"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateSecurityGroup",
|
||||
"ec2:CreateSnapshot",
|
||||
"ec2:CreateVolume",
|
||||
"elasticloadbalancing:CreateListener",
|
||||
"elasticloadbalancing:CreateLoadBalancer",
|
||||
"elasticloadbalancing:CreateTargetGroup"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateSecurityGroup",
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws-test:ec2:*:*:vpc/*"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
}
|
||||
|
|
@ -0,0 +1,233 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": "ec2:AttachVolume",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:ResourceTag/k8s.io/role/master": "1"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetEncryptionConfiguration",
|
||||
"s3:ListBucket",
|
||||
"s3:ListBucketVersions"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"ec2:CreateAction": [
|
||||
"CreateSecurityGroup"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:security-group/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteTags"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:security-group/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"ec2:CreateAction": [
|
||||
"CreateVolume",
|
||||
"CreateSnapshot"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:volume/*",
|
||||
"arn:aws-test:ec2:*:*:snapshot/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteTags"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:ec2:*:*:volume/*",
|
||||
"arn:aws-test:ec2:*:*:snapshot/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:DescribeAutoScalingGroups",
|
||||
"autoscaling:DescribeAutoScalingInstances",
|
||||
"autoscaling:DescribeLaunchConfigurations",
|
||||
"autoscaling:DescribeScalingActivities",
|
||||
"autoscaling:DescribeTags",
|
||||
"ec2:AttachVolume",
|
||||
"ec2:AuthorizeSecurityGroupIngress",
|
||||
"ec2:CreateSecurityGroup",
|
||||
"ec2:CreateTags",
|
||||
"ec2:DeleteRoute",
|
||||
"ec2:DeleteSecurityGroup",
|
||||
"ec2:DeleteVolume",
|
||||
"ec2:DescribeAccountAttributes",
|
||||
"ec2:DescribeAvailabilityZones",
|
||||
"ec2:DescribeInstanceTypes",
|
||||
"ec2:DescribeInstances",
|
||||
"ec2:DescribeLaunchTemplateVersions",
|
||||
"ec2:DescribeRegions",
|
||||
"ec2:DescribeRouteTables",
|
||||
"ec2:DescribeSecurityGroups",
|
||||
"ec2:DescribeSubnets",
|
||||
"ec2:DescribeTags",
|
||||
"ec2:DescribeVolumes",
|
||||
"ec2:DescribeVolumesModifications",
|
||||
"ec2:DescribeVpcs",
|
||||
"ec2:DetachVolume",
|
||||
"ec2:ModifyInstanceAttribute",
|
||||
"ec2:ModifyVolume",
|
||||
"ecr:BatchCheckLayerAvailability",
|
||||
"ecr:BatchGetImage",
|
||||
"ecr:DescribeRepositories",
|
||||
"ecr:GetAuthorizationToken",
|
||||
"ecr:GetDownloadUrlForLayer",
|
||||
"ecr:GetRepositoryPolicy",
|
||||
"ecr:ListImages",
|
||||
"elasticloadbalancing:AddTags",
|
||||
"elasticloadbalancing:CreateListener",
|
||||
"elasticloadbalancing:CreateTargetGroup",
|
||||
"elasticloadbalancing:DeleteListener",
|
||||
"elasticloadbalancing:DescribeListeners",
|
||||
"elasticloadbalancing:DescribeLoadBalancerAttributes",
|
||||
"elasticloadbalancing:DescribeLoadBalancerPolicies",
|
||||
"elasticloadbalancing:DescribeLoadBalancers",
|
||||
"elasticloadbalancing:DescribeTargetGroups",
|
||||
"elasticloadbalancing:DescribeTargetHealth",
|
||||
"elasticloadbalancing:ModifyListener",
|
||||
"elasticloadbalancing:RegisterTargets",
|
||||
"iam:GetServerCertificate",
|
||||
"iam:ListServerCertificates",
|
||||
"kms:CreateGrant",
|
||||
"kms:Decrypt",
|
||||
"kms:DescribeKey",
|
||||
"kms:Encrypt",
|
||||
"kms:GenerateDataKey*",
|
||||
"kms:GenerateRandom",
|
||||
"kms:ReEncrypt*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:SetDesiredCapacity",
|
||||
"autoscaling:TerminateInstanceInAutoScalingGroup",
|
||||
"ec2:AttachVolume",
|
||||
"ec2:AuthorizeSecurityGroupIngress",
|
||||
"ec2:CreateRoute",
|
||||
"ec2:DeleteRoute",
|
||||
"ec2:DeleteSecurityGroup",
|
||||
"ec2:DeleteVolume",
|
||||
"ec2:DetachVolume",
|
||||
"ec2:ModifyInstanceAttribute",
|
||||
"ec2:ModifyVolume",
|
||||
"ec2:RevokeSecurityGroupIngress",
|
||||
"elasticloadbalancing:AddTags",
|
||||
"elasticloadbalancing:ApplySecurityGroupsToLoadBalancer",
|
||||
"elasticloadbalancing:AttachLoadBalancerToSubnets",
|
||||
"elasticloadbalancing:ConfigureHealthCheck",
|
||||
"elasticloadbalancing:CreateLoadBalancerListeners",
|
||||
"elasticloadbalancing:CreateLoadBalancerPolicy",
|
||||
"elasticloadbalancing:DeleteListener",
|
||||
"elasticloadbalancing:DeleteLoadBalancer",
|
||||
"elasticloadbalancing:DeleteLoadBalancerListeners",
|
||||
"elasticloadbalancing:DeleteTargetGroup",
|
||||
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
|
||||
"elasticloadbalancing:DeregisterTargets",
|
||||
"elasticloadbalancing:DetachLoadBalancerFromSubnets",
|
||||
"elasticloadbalancing:ModifyListener",
|
||||
"elasticloadbalancing:ModifyLoadBalancerAttributes",
|
||||
"elasticloadbalancing:ModifyTargetGroup",
|
||||
"elasticloadbalancing:RegisterInstancesWithLoadBalancer",
|
||||
"elasticloadbalancing:RegisterTargets",
|
||||
"elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer",
|
||||
"elasticloadbalancing:SetLoadBalancerPoliciesOfListener"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"ec2:CreateSecurityGroup",
|
||||
"ec2:CreateSnapshot",
|
||||
"ec2:CreateVolume",
|
||||
"elasticloadbalancing:CreateListener",
|
||||
"elasticloadbalancing:CreateLoadBalancer",
|
||||
"elasticloadbalancing:CreateTargetGroup"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
},
|
||||
{
|
||||
"Action": "ec2:CreateSecurityGroup",
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws-test:ec2:*:*:vpc/*"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"Action": "ec2:AttachVolume",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"aws:ResourceTag/k8s.io/role/master": "1"
|
||||
}
|
||||
},
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"ec2:CreateAction": [
|
||||
"CreateSecurityGroup"
|
||||
]
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"ec2:CreateAction": [
|
||||
"CreateVolume",
|
||||
"CreateSnapshot"
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Action": "ec2:AttachVolume",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"aws:ResourceTag/k8s.io/role/master": "1"
|
||||
}
|
||||
},
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"ec2:CreateAction": [
|
||||
"CreateSecurityGroup"
|
||||
]
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
"Action": "ec2:CreateTags",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local",
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant",
|
||||
"ec2:CreateAction": [
|
||||
"CreateVolume",
|
||||
"CreateSnapshot"
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
"aws:RequestTag/KubernetesCluster": "true"
|
||||
},
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:ResourceTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.k8s.local"
|
||||
"aws:RequestTag/KubernetesCluster": "iam-builder-test.nonexistant"
|
||||
}
|
||||
},
|
||||
"Effect": "Allow",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/cluster-completed.spec",
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/igconfig/node/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetEncryptionConfiguration",
|
||||
"s3:ListBucket",
|
||||
"s3:ListBucketVersions"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:DescribeAutoScalingInstances",
|
||||
"ec2:DescribeInstanceTypes",
|
||||
"ec2:DescribeInstances",
|
||||
"ec2:DescribeRegions",
|
||||
"iam:GetServerCertificate",
|
||||
"iam:ListServerCertificates",
|
||||
"kms:GenerateRandom"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/cluster-completed.spec",
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/igconfig/node/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetEncryptionConfiguration",
|
||||
"s3:ListBucket",
|
||||
"s3:ListBucketVersions"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"autoscaling:DescribeAutoScalingInstances",
|
||||
"ec2:DescribeInstanceTypes",
|
||||
"ec2:DescribeInstances",
|
||||
"ec2:DescribeRegions",
|
||||
"ecr:BatchCheckLayerAvailability",
|
||||
"ecr:BatchGetImage",
|
||||
"ecr:DescribeRepositories",
|
||||
"ecr:GetAuthorizationToken",
|
||||
"ecr:GetDownloadUrlForLayer",
|
||||
"ecr:GetRepositoryPolicy",
|
||||
"ecr:ListImages",
|
||||
"iam:GetServerCertificate",
|
||||
"iam:ListServerCertificates",
|
||||
"kms:GenerateRandom"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
}
|
||||
|
|
@ -1,15 +1,5 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/cluster-completed.spec",
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/igconfig/node/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:Get*"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/cluster-completed.spec",
|
||||
"arn:aws-test:s3:::kops-tests/iam-builder-test.k8s.local/igconfig/node/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
|
|
|
|||
Loading…
Reference in New Issue