Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[NOTEST][WIP]initial commit with vault+sprout integration via dynaconf #9402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kedark3
Copy link
Contributor

@kedark3 kedark3 commented Sep 24, 2019

Purpose or Intent

  • Enhancement for integrating Vault with Sprout using dynaconf. This will allow us to get the provider object that fetches creds from Vault using dynaconf. This is still a WIP as we need to upgrade our Vault server first before we could test it. Although I tested it with a different vault server and it worked alright.

@kedark3 kedark3 force-pushed the sprout_vault branch 2 times, most recently from fbaf419 to 288dbd1 Compare September 24, 2019 17:49
@izapolsk izapolsk self-requested a review November 7, 2019 16:13
@izapolsk izapolsk self-assigned this Nov 7, 2019
"""Log into Vault, renew the token, and return the Vault client"""
vault = Client(url=url, token=token, verify=False)
if not vault.is_authenticated():
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it login in this case ?

from dynaconf import LazySettings
from hvac import Client

VAULT_APPROLE = 'cfme-qe-infra'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd turn all this stuff into class

# and VAULT_SKIP_VERIFY=true to disable ssl verification

echo 'login with kerberos - make sure you are admin by reading listed policies'
vault login -method=ldap -tls-skip-verify=true username=<user>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it ask for this value or look for it in env variables ?

from cfme.utils.log import logger
from sprout.vault.vault import settings

providers_data = conf.cfme_data.get("management_systems", {})
Copy link
Contributor

Choose a reason for hiding this comment

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

sprout is deployed along with test framework. do we really need to add it's own providers and vault files ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants