IP access restriction on S3

0

Does AWS S3 allow you to configure a list of allowed IPs that can be uploaded to buckets?

已提問 3 年前檢視次數 257 次
1 個回答
0

Hi,

Answering to your question, yes you can restrict access to S3 bucket to specific IP address or range using a bucket policy.

The following example bucket policy allows traffic to the bucket when the request is from specified IP address or range ( aws:SourceIp):

{
"Id": "SourceIP",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSourceIP",
"Principal": "",
"Action": "s3:
",
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::BUCKET-NAME",
"arn:aws:s3:::BUCKET-NAME/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"11.11.11.11/32",
"22.22.22.22/24"
]
}
}
}
]
}

Note: Above policy allows s3 full access to all users from the specified IP address or range, but it doesn't deny all access from outside the IP address or range. If a IAM user/role from the same account is authenticated and has s3 access via IAM policy, this policy still allows the IAM to access the bucket from outside the specified IP address or range.

For example policy that denies permissions to any user to perform any S3 operations on objects in the specified S3 bucket unless the request originates from the IP address or range specified in the condition, please refer following documents.

[+] https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-3
[+] https://aws.amazon.com/premiumsupport/knowledge-center/block-s3-traffic-vpc-ip/

Regards,
Pavithra

AWS
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南