question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Add method to load_keys

See original GitHub issue

Problem Suppose we have a secret store that has layout like this: image

I would like to have a method to list all the keys.

Solution I have tried following piece of code in Vault_loader.py as:

def load_keys(obj, path):
    client = get_client(obj)
    return client.list('/secret/metadata/{}'.format(path))

It uses /secret/metadata endpoint for Vault and returns the dict that also contains keys.

Sample output:

{'request_id': '<redacted>',
 'lease_id': '',
 'renewable': False,
 'lease_duration': 0,
 'data': {'keys': ['secret1', 'secret2', 'secret3']},
 'wrap_info': None,
 'warnings': None,
 'auth': None}

I can then do

vault_loader.load_keys(settings, 'sample/')['data']['keys']                                                    
['secret1', 'secret2', 'secret3']

Describe alternatives you’ve considered IMHO, It only fits to use this solution because we have number of different credentials we want to store and retrieve. Another solution would be to dump all credentials under one secret in JSON format like this image

The problem with that is if we have a lot of credentials(keys) in one secret(or environment) then updating one key would mean that I have to load entire data and then update relevant key and write the entire data again.

Additional context You may contact me on Google Chat/email(Red Hat) if you want to discuss our use case. I am fairly new to Vault/Dynaconf, excuse if my understanding is different that how this all is intended to be used.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rochacbrunocommented, Sep 3, 2019

Hi @VaultVulp @kedark3 I understood that the goal is just o have a helper function to list all the envs existing on the vault server before one can iterate over it and use setenv ot using_env to switch to them.

I’ll make my suggestiong on the PR #214

0reactions
kedark3commented, Sep 3, 2019

Thanks @rochacbruno

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux console/Keyboard configuration
The loadkeys utility can do this. First, create a keymap file. This keymap file can be anywhere, but one method is to mimic...
Read more >
7. DNSSEC — BIND 9 9.18.4 documentation
Cryptographic authentication of DNS information is possible through the DNS Security (“DNSSEC-bis”) extensions, defined in RFC 4033, RFC 4034, and RFC 4035.
Read more >
[RFC,0/2] Create CAAM HW key in linux keyring and use in ...
The capacity to generate or load keys already available in the Linux key ... Franck LENORMAND (2): drivers: crypto: caam: key: Add caam_tk...
Read more >
[all] RFC: Factory function naming convention · Issue #210
The current naming convention is that these function wrappers are (usually) a lowercase-initial version of their respective class names. This is ...
Read more >
Load keys from signed PE binaries
Now, "keyctl add" will already handle X.509 certificates that are so signed, but Microsoft's signing service will only sign runnable EFI PE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found