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 for vault approle authentication #74

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

AlexShemeshWix
Copy link
Contributor

Its in the best practices of Hashicorp Vault to authenticate with time limited tokens received from approle auth endpoint.

Signed-off-by: alexshe <alexshe@wix.com>
@codecov-io
Copy link

codecov-io commented Dec 26, 2018

Codecov Report

Merging #74 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #74     +/-   ##
=========================================
+ Coverage   82.86%   82.97%   +0.1%     
=========================================
  Files          23       23             
  Lines        1418     1427      +9     
=========================================
+ Hits         1175     1184      +9     
  Misses        243      243
Impacted Files Coverage Δ
chaoslib/secret.py 90.78% <100%> (+1.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae45e9e...dba08e8. Read the comment docs.

@Lawouach
Copy link
Contributor

Thanks @AlexShemeshWix It looks generally good but I'll have to try it to fully apprehend how it works. Also, It'll have to be part of an RC2 of the chaostoolkit-lib I believe. Be patient as this might take a few days since it's holiday season here. Thanks.

@AlexShemeshWix
Copy link
Contributor Author

Yes. Take your time. Ive implemented the dirty hack of actually retriving token and injecting it to env var before i run chaos test. So its no hurry.
By the way can you post some example of how to work with secrets from vault. I could never make it work. It retrieves data from vault. I can see it but it arrives to settings packaged in vault resposne json.Not pure data ive expected.

@Lawouach
Copy link
Contributor

I see. I will try but you may be right, it may not work really well and needs fixing!

@Lawouach
Copy link
Contributor

I'm finally going to have some time soon to look at it! Thanks for your patience @AlexShemeshWix

@Lawouach Lawouach self-requested a review January 28, 2019 09:52
Copy link
Contributor

@Lawouach Lawouach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm going to fix the couple of minor comments that I would make normally:

  • add CHANGELOG entry
  • extend README entry to indicate what we support

But since I've left this PR sit there for too long, I'll do it this time :)

url = configuration.get("vault_addr")
client = hvac.Client(url=url)

if "vault_token" in configuration.keys():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be written

if "vault_token" in configuration:


if "vault_token" in configuration.keys():
client.token = configuration.get("vault_token")
elif "vault_role_id" in configuration.keys() and \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be written

if "vault_role_id" in configuration and "vault_role_secret" in configuration:

@Lawouach Lawouach merged commit 0872d9c into chaostoolkit:master Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants