-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
multiple arn options for aws backend over vault client (cli) #2817
Comments
You can't -- if you want to specify anything other than a single ARN you need to submit a policy document. |
Thanks @jefferai thats was it 👍 |
Hi @jefferai just reading again docs referring probably to this (a bit confused) https://www.vaultproject.io/intro/getting-started/dynamic-secrets.html it states:
|
Hi @hflamboauto1 , You do it via having different roles, and assigning a policy per role. |
I see .. let me explain My goal is to create Dynamic aws credentials via vault for all devs + some other users with AWS credentials and was thinking to achieve this having different policies applied granting more or less privileges. As far i understand for that I need to create a role per user so that they can call (vault How can one achieve something like "group of roles" to apply different policies per group of users with more and less previledges (merge of policies) So i guess not possible .. and a unique policy needs to describe the policy per role/user. Thanks for the hints |
That's not possible right now, sorry. |
The problem with having separate roles is that I need to know what the user is try to do in advance, which is a pain. Multiple ARN support seems like it should be trivial. Would a PR be accepted? |
@tcolgate See what @joelthompson thinks, he's the AWS expert around here :-) |
lol, thanks @jefferai :) Spent some time over the weekend looking at the code. tl;dr: This specific change should be trivial. Stepping back, I am a bit worried that this will further muddle the AWS secret backend. There are three different ways to get creds from the AWS secret backend:
The role configuration is overloaded, so that the same set of roles is used by all three of these, and the creds/ and sts/ endpoints just look at the role to see if it has the right type of data for each of these. In particular, the The specific change @tcolgate is requesting can be done in isolation without having to deal with the overloading here, but I do worry that this overloading can make future changes more difficult. If there's interest from the HashiCorp side, I could probably take a stab at this type of refactoring to clean it up (but also don't want to introduce a refactor just for the sake of a refactor). |
There's interest on our side ;-) |
Cool, will try to take a stab at it... after HashConf :) |
OMG Joel. Waiting until after HashiConf? How lazy are you? :-D |
At least this lazy, if not more :) |
Hi guys, @joelthompson have you had time to look at this yet? We're currently a bit limited by this as well. Our specific use-case is that we have a specific auto-generated policy per role that we create, but there's also an additional role that we apply to each role where we allow developers to create their additional role policies that is might be required (such as wanting to have access to a new service in AWS we've not yet added to the per-context policy). Having the ability to create roles with multiple polices would help immensely! Could we re-open this issue @jefferai ? |
Hey @paddie -- I haven't forgotten about this, but my free time unexpectedly took a steep hit last fall (and I'll add my standard disclaimer: I'm not a HashiCorp employee, just a community member who likes Vault, knows a bit about AWS, and wants to give back to the community). Thanks for the nudge :) Will hopefully get something in the next few weeks (e.g., I ran into issues getting the automated tests to work in my personal setup, so I spent some time refactoring those so that I could work on this -- see #4076). I do have one question about the particular use case. Let's say you can specify multiple policies with a role. Should Vault's behavior be:
I realize the second is a strict superset of the first, but I don't know if there's actual demand for that type of behavior and whether it's worth adding the complexity to the API and code. I've got a bunch of ideas (most probably not great) bouncing around inside my head about what to do about this, and I'd like some real-world use cases. |
Attach All would work best for me. We use one aws cress role per approle
…On Tue, 6 Mar 2018, 04:06 Joel Thompson, ***@***.***> wrote:
Hey @paddie <https://github.com/paddie> -- I haven't forgotten about
this, but my free time unexpectedly took a steep hit last fall (and I'll
add my standard disclaimer: I'm not a HashiCorp employee, just a community
member who likes Vault, knows a bit about AWS, and wants to give back to
the community). Thanks for the nudge :) Will hopefully get something in the
next few weeks (e.g., I ran into issues getting the automated tests to work
in my personal setup, so I spent some time refactoring those so that I
could work on this -- see #4076
<#4076>).
I do have one question about the particular use case. Let's say you can
specify multiple policies with a role. Should Vault's behavior be:
1. Always attach all of the policies to the generated credentials
2. Allow the user to specify which policies should be attached to the
generated creds (ensuring that the requested policies are a subset of the
allowed policies on the role)
I realize the second is a strict superset of the first, but I don't know
if there's actual demand for that type of behavior and whether it's worth
adding the complexity to the API and code. I've got a bunch of ideas (most
probably not great) bouncing around inside my head about what to do about
this, and I'd like some real-world use cases.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2817 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEo80K0hMBbDblvqenbttm1LeQdSKTbks5tbgtggaJpZM4NxZmD>
.
|
Hi @joelthompson! Thanks a ton for getting back to me on this one! I concur with @tcolgate that the attach-all approach would be the most intuitive and (probably) would also demand fewer changes to the API. When creating the role in vault, either the arn could be a list of policy arns, or simply a role arn, where we then iterate through the attached policies of the role when creating a new one. What do you think? I am rather good within the AWS domain, but very vague in the inner workings on vault just now, so if you need any help with at least the code that is needed to get the attached policies etc. let me know and I can see if I can look at it with you. |
Hey @paddie -- thanks for the offer, but I'm also quite familiar with AWS as well :) I have a few concerns with passing in a role ARN and then copying the policies attached to it. First, as of right now, the different input variables are overloaded between the different ways of getting credentials (which is the first thing I want to tackle). So, passing in a role ARN as you suggest would allow retrieving both IAM user credentials (with policies copied from the role) as well as assumed-role credentials for the role. Second, is there a reason you want IAM user creds with the same policies as a role but don't want assumed-role credentials? It seems like you can already get pretty much everything you need. Third, my personal opinion is that security tools like Vault should have as little magic and as much transparency as possible. Copying policies from a role is more magic than I would like. For example, users might confuse IAM user credentials with assumed-role credentials, and those can have subtle differences, like the fact that changes on a role should apply to already-existing credentials while policy changes to a role which Vault uses as a template to copy permissions from won't apply to existing IAM user creds that Vault has handed out, unless Vault is polling AWS to listen for changes to apply to already-provisioned IAM users. That's both more code to write and another way Vault could fail in a way that would have security implications. I think, ultimately, it would be better to not do this. Anyway, these are just my personal opinions about what this should look like in Vault; as mentioned above, I'm not employed by HashiCorp nor do I represent HashiCorp's viewpoints. I also know that I could definitely be wrong about any/all of my opinions or just be missing something, so I'd love to hear it if you think that's the case! :) |
I'll address these in a seemingly random way:
|
Hey @paddie:
|
Hi @joelthompson:
|
The AWS secret engine had a lot of confusing overloading with role paramemters and how they mapped to each of the three credential types supported. This now adds parameters to remove the overloading while maintaining backwards compatibility. With the change, it also becomes easier to add other feature requests. Attaching multiple managed policies to IAM users and adding a policy document to STS AssumedRole credentials is now also supported. Fixes hashicorp#4229 Fixes hashicorp#3751 Fixes hashicorp#2817
* Make AWS credential types more explicit The AWS secret engine had a lot of confusing overloading with role paramemters and how they mapped to each of the three credential types supported. This now adds parameters to remove the overloading while maintaining backwards compatibility. With the change, it also becomes easier to add other feature requests. Attaching multiple managed policies to IAM users and adding a policy document to STS AssumedRole credentials is now also supported. Fixes #4229 Fixes #3751 Fixes #2817 * Add missing write action to STS endpoint * Allow unsetting policy_document with empty string This allows unsetting the policy_document by passing in an empty string. Previously, it would fail because the empty string isn't a valid JSON document. * Respond to some PR feedback * Refactor and simplify role reading/upgrading This gets rid of the duplicated role upgrade code between both role reading and role writing by handling the upgrade all in the role reading. * Eliminate duplicated AWS secret test code The testAccStepReadUser and testAccStepReadSTS were virtually identical, so they are consolidated into a single method with the path passed in. * Switch to use AWS ARN parser
This is related to AWS backend and how to apply policies to the aws/role/readonly
From docs example: 1 policy ARN
What if i want to attach another one ? e.g
Write multiple comma separated .. client does not complain
but when reading: vault read aws/creds/readonly
This is basically a question on how to allow this without having to create a policy.json merging multiple policies in one file
The text was updated successfully, but these errors were encountered: