We store RPMs required for our deployment in a S3 bucket, we are hosting a yum repo on the bucket to make it easier for updating RPMS.
Currently, our bucket is accessible publicly over the S3 endpoint (s3.amazonaws.com) and open to the world for access as we currently can’t pull down yum packages from a private S3 repo.
We need to harden the security of the Repo bucket to enable authentication based access to S3 over s3.amazonaws.com endpoint. Any suggestion towards it ? Thanks !
`{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Allow Access From QA, dev",
"Effect": "Deny",
"NotPrincipal": {
"AWS": [
"arn:aws:iam::XXXXXXX:root"
]
},
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::test-repo",
"arn:aws:s3:::test-repo/*"
],
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
"X.X.X.X/32"
]
},
"StringNotEquals": {
"aws:sourceVpce": "vpce-xxxxxxx"
}
}
}
]
}
`