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

Support one or more --key options to create credentials restricted to a specific key #57

Open
simonw opened this issue Jan 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jan 18, 2022

The new --prefix option from #12 lets you set a wildcard prefix for key access - but it strikes me that it would also be useful to be able to limit access to one or more specific keys. For example, if you want to create a token that can be used to upload data to a pre-assigned UUID filename.

Related:

@simonw simonw added the enhancement New feature or request label Jan 18, 2022
@simonw
Copy link
Owner Author

simonw commented Jan 18, 2022

I need to test this, but I think that the policy for --read-only --key foo/bar.txt would be this:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject"
      ],
      "Resource": [
        "arn:aws:s3:::my-s3-bucket/foo/bar.txt"
      ]
    }
  ]
}

Can filenames contain a *? If so, how would you specify the resource for such a file when "arn:aws:s3:::my-s3-bucket/foo/bar*.txt" is presumably treated as a wildcard?

@simonw
Copy link
Owner Author

simonw commented Jan 19, 2022

Twitter conversation about the *.png edge-case: https://twitter.com/simonw/status/1483841770094227463

I confirmed there that the ARN for a file called *.png maintains the *:

image

Suggestion from https://twitter.com/smithsam/status/1483844461310451718

What happens if you use %2A to describe the * ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant