-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
How to pass vault namespace in AWX “HashiCorp Vault Signed SSH” type credential for role_id and secret_id based authentication #7399
Comments
@codersplanet sounds like an opportunity for a pull request to the Hashivault credential plugin. |
@haribhauhud Can you please follow these steps and confirm if it worked for you?
|
The above instructions work for testing the query, but clicking save results in the following tower.log entry:
|
+1 case 02972971 |
This should be in AWX as of #9590. Let us know if it works for you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ISSUE TYPE
SUMMARY
We have our internal private vault server for credential management, to retrieve the token from the vault we are using app_role authentication.
Below is the equivalent curl command:
curl --request POST -H "X-Vault-Namespace: " --data '{"role_id": "<ROLE_ID>", "secret_id": "<SECRET_ID>"}' http://<VAULT_ADDR>/v1/auth/approle/login
So here in this case passing namespace is mandatory for us else it will return incorrect role_id not found because we are using namespace in Vault.
As we are integrating AWX with Vault, we are using HashiCorp Vault Signed SSH for authentication using APPROLE ROLE_ID and APPROLE SECRET_ID. There are other all the required fields to pass as input to vault queries like role_name, path_to_secert, and public_key. However, there is no way to pass the vault namespace (and no code to set header) and so we are getting the result as "invalid role_id".
We have tried to hardcode the namespace in awx_web and awx_task in hashivault.py file, then it works for us.
import requests
sess = requests.Session()
headers = {'X-Vault-Namespace': 'our_ns'}
resp = sess.post(request_url, **request_kwargs, headers=headers)
resp.raise_for_status()
token = resp.json()['auth']['client_token']
Can someone please suggest to us how to pass the namespace from AWX UI or is there any other way to handle this scenario?
The text was updated successfully, but these errors were encountered: