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

Add optional header_value parameter to hashi_vault lookup #1485

Conversation

jonnyt
Copy link

@jonnyt jonnyt commented Dec 13, 2020

Add optional header_value parameter to hashi_vault lookup to support X-Vault-AWS-IAM-Server-ID

SUMMARY

Add support for the parameter header_value to support Vault policies that require X-Vault-AWS-IAM-Server-ID
as part of the GetCallerIdentity request.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

hashi_vault

ADDITIONAL INFORMATION

Without this feature the following would fail when the Hashi Vault policy requires the X-Vault-AWS-IAM-Server-ID header.

- name: Authenticate with a Vault app role
  ansible.builtin.debug:
    msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/data/test:hello auth_method=aws_iam_login role_id=ec2-instance url=https://vault-url region=us-west-2') }}"

Including the parameter header_value will pass the value along to the HVAC library, which then sends it along as the header. This would return the secret.

- name: Authenticate with a Vault app role
  ansible.builtin.debug:
    msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/data/test:hello auth_method=aws_iam_login role_id=ec2-instance url=https://vault-url region=us-west-2 header_value=https://vault-url') }}"

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added affects_2.10 community_review feature This issue/PR relates to a feature request lookup lookup plugin needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) labels Dec 13, 2020
@briantist
Copy link
Contributor

Hi @jonnyt ! Thanks for this, it looks like a good find. We've recently split this plugin out into its own collection: https://github.com/ansible-collections/community.hashi_vault

So all further development will happen there. I'll close this out here, could you re-submit your PR in that collection?

Some early feedback:

But go ahead and put the PR there and we can have further conversation and iterate on it then

close_me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request lookup lookup plugin needs_triage new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants