AWS S3 allows you to restrict access to buckets using JSON policies. Great when you need a bucket to be accessible to a gateway, CDN on specified IP addresses only. Typical use is hosting a static web site using a bucket, while restricting direct public access to it.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::www.example.com/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"192.2.0.1",
"192.2.0.2"
]
}
}
}
]
}
Storj has ways of managing access too, but none seems to cut it. There are the Access Management Console, and the Uplink CLI. The latter is descibred as
.. a flexible command that allows you to restrict and generate new access grants with a variety of restrictions. By adding --register, the uplink will use the default --auth-service flag to determine where to exchange the restricted access grant for an access key, secret key, and endpoint.
https://docs.storj.io/dcs/api-reference/uplink-cli/share-command/ mentions --base-url
, --url
, and --auth-service
, but with little explanation or examples, and I am stuck here.
So is there a way i can limit access to Storj bucket to (through) a hostname (CNAME) or a list of IP addresses?