Yes it indeed is possible. Better starting point for you would be read S3 access control.
But by default the buckets created on S3 aren't public. So the default behaviour should be that it will only be accessible to person/program who/which has knowledge of your access and secret key.
You may also edit bucket permission in order to give access to a particular AWS account or an email id.
In order to restrict access to certain IPs, you may create additional bucket policy.
Restricting Access to Specific IP Addresses
This statement grants permissions to any user to perform any S3 action
on objects in the specified bucket. However, the request must
originate from the range of IP addresses specified in the condition.
The condition in this statement identifies 192.168.143.* range of
allowed IP addresses with one exception, 192.168.143.188.
Note that the IPAddress and NotIpAddress values specified in the
condition uses CIDR notation described in RFC 2632. For more
information, go to http://www.rfc-editor.org/rfc/rfc4632.txt.
{
"Version": "2012-10-17",
"Id": "S3PolicyId1",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::bucket/*",
"Condition" : {
"IpAddress" : {
"aws:SourceIp": "192.168.143.0/24"
},
"NotIpAddress" : {
"aws:SourceIp": "192.168.143.188/32"
}
}
}
]
}
For more, read here and here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…