say I have a condition like where I want that if the request is not from these ips ["192.0.2.0/24","203.0.113.0/24"]
and if the request doesn't have a referrer among the following [example1.com, example2.com ]
then deny it. I know individually I can do something like this:
{
"Sid": "6",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my_bucket/*",
"Condition": {
"IpAddress":{
"aws:SourceIp": ["192.0.2.0/24","203.0.113.0/24"]
}
}
}
{
"Sid": "7",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::indeev5-dev-media/*/video/*",
"Condition": {
"StringNotLike": {
"aws:Referer": [
"http://example1.com/*",
"http://example2.com/*",
]
}
}
}
but how can I do an "and" here.I.e check for both conditions at the same time. I had posted a question which kinda had the same end objective so any pointers would be highly appreciated here. In short what I want to do is deny all requests which are not from the referrer list except the ones which are from the ip list. Thanks