Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12297484
vault.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
870 B
Referenced Files
None
Subscribers
None
vault.py
View Options
# -------------------------------------------------------------
# Nasqueron Reports :: Credentials :: Vault
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Read credentials from Vault or OpenBao
# License: BSD-2-Clause
# -------------------------------------------------------------
import
hvac
VAULT_CA_CERTIFICATE
=
"/usr/local/share/certs/nasqueron-vault-ca.crt"
def
fetch_credentials
(
secret_path
):
vault_client
=
hvac
.
Client
(
verify
=
VAULT_CA_CERTIFICATE
,
)
tokens
=
secret_path
.
split
(
"/"
)
secret_mount
=
tokens
[
0
]
secret_path
=
"/"
.
join
(
tokens
[
1
:])
secret
=
vault_client
.
secrets
.
kv
.
read_secret_version
(
mount_point
=
secret_mount
,
path
=
secret_path
,
raise_on_deleted_version
=
True
,
)
return
secret
[
"data"
][
"data"
]
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Wed, Oct 22, 12:13 (16 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3086412
Default Alt Text
vault.py (870 B)
Attached To
Mode
rRPRT Nasqueron internal reports
Attached
Detach File
Event Timeline
Log In to Comment