I have a bucket with the file in it
I've granted full access to test-user1 (who has AdministratorAccess policy in IAM) through the bucket policy
"Version": "2012-10-17",
"Id": "Policy1595762326470",
"Statement": [
{
"Sid": "Stmt1595762736524",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:user/test-user1"
},
"Action": [
"s3:*"
],
"Resource": "arn:aws:s3:::test-user1-bucket"
}
]
}
Bucket uses AWS-KMS (CMK encryption) for that bucket and test-user1 is not among the key users list of that сustomer managed key
The Key Policy is below:
{
"Id": "key-consolepolicy-3",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:root"
},
"Action": "kms:*",
"Resource": "*"
},
{
"Sid": "Allow access for Key Administrators",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:user/kolyaiks_iam"
},
"Action": [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:TagResource",
"kms:UntagResource",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion"
],
"Resource": "*"
},
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:user/kolyaiks_iam"
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "*"
},
{
"Sid": "Allow attachment of persistent resources",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:user/kolyaiks_iam"
},
"Action": [
"kms:CreateGrant",
"kms:ListGrants",
"kms:RevokeGrant"
],
"Resource": "*",
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": "true"
}
}
}
]
}
Can test-user1 download and read the file from the bucket? If yes, why does he can?