Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellar ip restriction example #471

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions content/doc/addons/cellar.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,55 @@

The original ACL should apply to all of your objects after that.


### IP restrictions

If you need to restrict your S3 Cellar to certain IPs, you can use a policy.

Check failure on line 385 in content/doc/addons/cellar.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/doc/addons/cellar.md#L385

[Vale.Spelling] Did you really mean 'IPs'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'IPs'?", "location": {"path": "content/doc/addons/cellar.md", "range": {"start": {"line": 385, "column": 51}}}, "severity": "ERROR"}
To do so, you can use the template below in a `policy.json` file. This example show how to block actions from any IP that isn't `192.168.1.6`.

- Replace the `<bucket-name>` with your bucket name in the policy file.
- Change the `Effect` to `Allow` or `Deny` depending on your needs.
- Change the IP address under `Condition` to select which IP should trigger the rule.

```json {filename="IP-restriction-policy.json"}
{
"Version": "2012-10-17",
"Id": "S3PolicyIPRestrict",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::<bucket>",
"arn:aws:s3:::<bucket>/*"
],
"Condition" : {
"IpAddress" : {
"aws:SourceIp": ["0.0.0.0/0"]
},
"NotIpAddress": {
"aws:SourceIp": ["192.168.1.6/32"]
}
}
}
]
}
```

To apply the policy, use this command:
```
s3cmd setpolicy ./policy.json s3://<bucket-name>
```

To delete the policy, use this command:
```
s3cmd delpolicy ./policy.json s3://<bucket-name>
```

### User access

Cellar doesn't natively support creating different user accesses for the same add-on. Granting access to your Cellar add-on grants full access to all of your buckets. To grant limited access to a bucket, do the following:
Expand Down
Loading