-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Initial research #1
Comments
It looks like I need to create specific, dedicated users for this - because only users (not roles) can have long-living access key / secret credentials according to the FAQ at https://aws.amazon.com/iam/faqs/ |
So if I want to create a bucket called
Need to do all of this using |
CLI design:
(I considered This creates credentials for the specified bucket.
This outputs the result of |
How should the root credentials be passed? I'm going to mostly leave this up to But I will also support |
Some import boto3
s3 = boto3.resource("s3")
# Creating a bucket in a region
bucket = s3.create_bucket(
Bucket="simonw-s3-credentials-test",
CreateBucketConfiguration={"LocationConstraint": "us-west-1"}
)
# Listing all buckets
for b in s3.buckets.all():
print(b)
# Listing all access keys
iam = boto3.client("iam")
paginator = iam.get_paginator("list_access_keys")
for response in paginator.paginate():
print(response) |
From the docstring: response = client.create_user(
Path='string',
UserName='string',
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
) Having an option to add tags - maybe That
Not particularly informative! But then I tracked down the documentation here: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html This is a little more useful:
I rather like the sound of this: being able to restrict these created user accounts to ONLY be able to operate within S3 seems like a great added defense in depth. One catch: what format should these strings be? GitHub code search showed me some examples, and also lead me to this file which looks like a list of default available policy ARNs: https://github.com/daviddawha/ArchivesSpaceDevUNR/blob/488b5b83f9ac66a6013e9a0a02d25734886dee02/gems/gems/fog-aws-2.0.0/lib/fog/aws/iam/default_policy_versions.json Short version: it looks like the two magic strings I care about for this application are:
I'm going to apply these to created users by default, and offer a |
Further research is happening in other issues now. |
The goal of this tool is to provide a CLI for creating IAM access credentials - an access key and a secret key - that are restricted to either reading from a specific bucket, writing to a specific bucket or read/write to a specific bucket.
The goal is to never have to go through the manual process described in dogsheep/dogsheep-photos#4 ever again.
The text was updated successfully, but these errors were encountered: