-
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
AppRole configuration example #15
Comments
Okay, after some digging around in the Vault source code I've found the answer here: https://github.com/BetterCloud/vault-java-driver/blob/master/src/main/java/com/bettercloud/vault/api/Auth.java#L411 approleAuthMount has to contain the path to the AppRoles including "approle" (in the very least), but without "/v1/auth" or anything else in front of it! So basically if you have a custom setup (like we do) and your AppRole is @gschueler : maybe you could add this info to the readme so the next person doesn't waste 2 hours reading Java source code while trying to configure the plugin. |
Hi @rlueckl, I have been trying to use the plugin with approle authentication and it worked for me. I suppose that the parameter can be configurated (not very familiar with it). Thanks |
Hi @ltamaster, you can configure the number of uses in your AppRole (see my example above: I don't know if the plugin can detect this. For example: the plugin has been using token X for some time. Then it gets a 403 from Vault, because the token expired. The plugin could retry the request, get another 403 again or it could try to get a new token by logging in with the approle again (and then retry the request). |
Hi @rlueckl , Yes, I think the plugin needs a way to refresh the token if it is expired. Luis |
Thank you very much! |
hi, we have also a similar setup:
After 30 minutes, I have create a new secred_id on the vault host:
then copy the secret_id and replace the value cu denny |
Hi @linuxmail, You don't need to generate a new secret ID. Just restart Rundeck. That's enough to trigger a new login to Vault and the freshly generated token can be used again for as long as your approle TTL or num_uses are configured. |
hi, hmm, Ok, I would try it out, but then, I have to restart rundeck every hour :-) I tried a small script to solve it:
For the Vault app role:
but ... it has not the same affect ... As I understand .. role id and secret id just username and password for login into Vault and have access to the tokens. In that case, to have the new tokens in my curl doesn't help the Vaul Rundeck plugin. Is there a way, to push the new token somewhere to the plugin or inject it ? |
2 things:
If you use the first method you don't need a new role_id or secret_id (ever). You just need a new token every time The Rundeck Vault plugin doesn't check if the token has expired and doesn't get a new token automatically. The easiest way to get a new token is to restart Rundeck, so the plugin has to login again to Vault and get a new token. I don't know if it's possible to push/inject the token to the plugin (probably not). If you use the second method (inputting a token directly into the config) you have to generate the token and put into the config then restart Rundeck every time the token has expired. You could set your approle to have a longer |
hi @rlueckl after a few days and trying .. no success. I let Rundeck restarting every 30min via Cron (service rundeckd restart) and if I visit the keystorage (for example) on the next day .. Rundeck has no access anymore. The only way to get it working again, is to recreate the secred_id. I don't know, if it helps to recreate the approle for rundeck, because I think, it always has a ttl for the secred_id. |
hi,
Looks better now. Hopefully it works on the next day too :-) |
Sorry, I didn't have time to test the plugin in the last weeks. Maybe @ltamaster can help here? (RE: token renewal) |
hi, I can tell you: it works. I created a cron Job that is restarting Rundeck after several hours and I don't have to do anything further. The only important thing you have to keep in mind: don't let Rundeck restart, while a job is running. |
Hi @ltamaster, any new about the token refresh functionality? (#15 (comment)) |
I had the issue and even recreating the secret-id didn't work. I had to completely recreate the role. |
Hi,
I need some help configuring this plugin for authentication with AppRoles. The following config with token auth works great:
But no matter what I do, AppRole based auth doesn't work. As far as I understood, the config should look something like this:
APPROLE_ID is from:
$ vault read auth/foobar/approle/role/rundeck/role-id
SECRET_ID was generated with:
$ vault write -f auth/foobar/approle/role/rundeck/secret-id
The AppRole is restricted to the IP of the Rundeck host and uses a policy which is only able to read and list
all/qa/*
:The policy looks like this:
As you can see we use a custom path in vault for AppRoles (auth/foobar/approle/role). I've tried putting different parts of this into approleAuthMount (
auth/foobar
,auth/foobar/approle
), but it still doesn't work. I get the following exception every time:(Full trace attached -> rundeck_approle_exception.log)
The text was updated successfully, but these errors were encountered: