-
Notifications
You must be signed in to change notification settings - Fork 850
[DO NOT MERGE] Testing Minimal Policy #2807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,191 +1,232 @@ | ||||
| { | ||||
| "Version": "2012-10-17", | ||||
| "Statement": [ | ||||
| "Version" : "2012-10-17", | ||||
| "Statement" : [ | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DescribeAvailabilityZones", | ||||
| "ec2:DescribeInstances", | ||||
| "ec2:DescribeSnapshots", | ||||
| "ec2:DescribeTags", | ||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not actually call this anywhere in the driver besides in a testing function that does not actually need it: aws-ebs-csi-driver/pkg/cloud/cloud_test.go Line 3666 in 33be568
So I have removed it from the policy. |
||||
| "ec2:DescribeVolumes", | ||||
| "ec2:DescribeVolumesModifications", | ||||
| "ec2:DescribeVolumeStatus" | ||||
|
Comment on lines
7
to
12
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These calls have |
||||
| ], | ||||
| "Resource": "*" | ||||
| "Resource" : "*" | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateSnapshot", | ||||
| "ec2:ModifyVolume" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateVolume", | ||||
| "ec2:CopyVolumes" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "aws:RequestTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateVolume", | ||||
| "ec2:CopyVolumes" | ||||
| ], | ||||
| "Resource": [ | ||||
| "arn:aws:ec2:*:*:volume/vol-*" | ||||
| ] | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "aws:RequestTag/CSIVolumeName" : "*" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:AttachVolume", | ||||
| "ec2:DetachVolume" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CopyVolumes" | ||||
| ], | ||||
| "Resource": [ | ||||
| "arn:aws:ec2:*:*:volume/*", | ||||
| "arn:aws:ec2:*:*:instance/*" | ||||
| ] | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/vol-*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateVolume", | ||||
| "ec2:EnableFastSnapshotRestores" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateSnapshot" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:snapshot/*" | ||||
| "Resource" : "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "aws:RequestTag/CSIVolumeSnapshotName" : "*" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateTags" | ||||
| ], | ||||
| "Resource": [ | ||||
| "arn:aws:ec2:*:*:volume/*", | ||||
| "arn:aws:ec2:*:*:snapshot/*" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateSnapshot" | ||||
| ], | ||||
| "Condition": { | ||||
| "StringEquals": { | ||||
| "ec2:CreateAction": [ | ||||
| "CreateVolume", | ||||
| "CreateSnapshot", | ||||
| "CopyVolumes" | ||||
| ] | ||||
| "Resource" : "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "aws:RequestTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:DeleteTags" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateSnapshot", | ||||
| "ec2:ModifyVolume" | ||||
| ], | ||||
| "Resource": [ | ||||
| "arn:aws:ec2:*:*:volume/*", | ||||
| "arn:aws:ec2:*:*:snapshot/*" | ||||
| ] | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateVolume", | ||||
| "ec2:CopyVolumes" | ||||
| "ec2:EnableFastSnapshotRestores" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "aws:RequestTag/ebs.csi.aws.com/cluster": "true" | ||||
| "Resource" : "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateVolume", | ||||
| "ec2:CopyVolumes" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:AttachVolume", | ||||
| "ec2:DetachVolume" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "aws:RequestTag/CSIVolumeName": "*" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:AttachVolume", | ||||
| "ec2:DetachVolume" | ||||
| ], | ||||
| "Resource" : "arn:aws:ec2:*:*:instance/*" | ||||
| }, | ||||
| { | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteVolume" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteVolume" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "ec2:ResourceTag/CSIVolumeName": "*" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/CSIVolumeName" : "*" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteVolume" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "ec2:ResourceTag/kubernetes.io/created-for/pvc/name": "*" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/kubernetes.io/created-for/pvc/name" : "*" | ||||
mdzraf marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateSnapshot" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteSnapshot", | ||||
| "ec2:LockSnapshot" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "aws:RequestTag/CSIVolumeSnapshotName": "*" | ||||
| "Resource" : "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/CSIVolumeSnapshotName" : "*" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteSnapshot", | ||||
| "ec2:LockSnapshot" | ||||
| ], | ||||
| "Resource" : "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:CreateSnapshot" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateTags" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "aws:RequestTag/ebs.csi.aws.com/cluster": "true" | ||||
| "Resource" : [ | ||||
| "arn:aws:ec2:*:*:volume/*", | ||||
| "arn:aws:ec2:*:*:snapshot/*" | ||||
| ], | ||||
| "Condition" : { | ||||
| "StringEquals" : { | ||||
| "ec2:CreateAction" : [ | ||||
| "CreateVolume", | ||||
| "CreateSnapshot", | ||||
| "CopyVolumes" | ||||
| ] | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:DeleteSnapshot" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:CreateTags" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "ec2:ResourceTag/CSIVolumeSnapshotName": "*" | ||||
| "Resource" : "arn:aws:ec2:*:*:volume/*", | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| }, | ||||
| { | ||||
| "Effect": "Allow", | ||||
| "Action": [ | ||||
| "ec2:DeleteSnapshot" | ||||
| "Effect" : "Allow", | ||||
| "Action" : [ | ||||
| "ec2:DeleteTags" | ||||
| ], | ||||
| "Resource" : [ | ||||
| "arn:aws:ec2:*:*:volume/*", | ||||
| "arn:aws:ec2:*:*:snapshot/*" | ||||
| ], | ||||
| "Resource": "arn:aws:ec2:*:*:snapshot/*", | ||||
| "Condition": { | ||||
| "StringLike": { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" | ||||
| "Condition" : { | ||||
| "StringLike" : { | ||||
| "ec2:ResourceTag/ebs.csi.aws.com/cluster" : "true" | ||||
| } | ||||
| } | ||||
| } | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.