Skip to main content

Azure Vault Loader

Azure Vault Loader is a Python command-line utility for securely loading secrets from Azure Key Vault into environment variables. It is designed to enable secure execution of commands on remote servers, by ensuring that secrets are loaded as environment variables only at the time of command execution, thereby reducing the exposure of sensitive data.

The utility makes use of Azure's role-based access control (RBAC) and Azure Key Vault, a cloud service for securely storing and accessing secrets. A "secret" in Azure Key Vault could be a password, a token, an API key, a connection string, or any other piece of data that is sensitive and needs to be kept secure.

Installation

Use the package manager pip to install Azure Vault Loader.

pip install azure-vault-loader

Usage

load_azure_secrets -k obfuscation_key -p principals -m map -u url -c command with or without arguments
  • -k, --obfuscation_key: The key used for reading an obfuscated principals file. If this option is provided, the tool will attempt to decrypt the service principals file.
  • -p, --principals: The Azure service principals. This file can be in plain JSON format or obfuscated using the obfuscate_service_principals command.
  • -m, --map: The JSON file containing secret names and the environment variable names as key-value pairs. This map dictates which Azure secrets get loaded into which environment variables.
  • -c, --command: The command to run after loading secrets. This can include one or more arguments.
  • -u, --url: The URL of your Azure Key Vault.
  • -v, --verbose: Enable verbose mode.

Secret-Environment Variables Map

The map argument requires a JSON file that contains a mapping between the secret names in your Azure Key Vault and the environment variables that they correspond to.

Here is an example of what the contents of the JSON file might look like:

{
    "databasepasswordsecret": "DB_PASSWORD",
    "apikeysecret": "API_KEY"
}

In the example above, database_password_secret and api_key_secret are the names of secrets stored in Azure Key Vault. When the load_azure_secrets command is run, the secrets corresponding to these names will be fetched from the Azure Key Vault, and then loaded into the DB_PASSWORD and API_KEY environment variables, respectively.

The purpose of this is to abstract the actual values of the secrets, allowing you to change the secrets in the Azure Key Vault without having to change your code or your environment setup. As long as the secret name and corresponding environment variable name remain the same, you can change the value of the secret in Azure Key Vault at any time, and the load_azure_secrets command will always fetch the most current value.

obfuscate_service_principals -j json -o output -k key
  • -j, --json: The JSON file containing service principals to obfuscate.
  • -o, --output: The output file for the obfuscated service principals.
  • -k, --key: The key for obfuscation.

License

Apache 2.0

Metadata

Release files for azure-vault-loader 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azure-vault-loader 0.1.0
File Size Uploaded Provenance Actions
azure_vault_loader-0.1.0.tar.gz 4.9 kB Without provenance Details for azure_vault_loader-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for azure-vault-loader 0.1.0
File Interpreter ABI Platform Actions
azure_vault_loader-0.1.0-py3-none-any.whl Python 3 none any Details for azure_vault_loader-0.1.0-py3-none-any.whl

Total release size: 14.9 kB

Release files / azure_vault_loader-0.1.0.tar.gz

Download URL azure_vault_loader-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f292dc4016bed942225a4c6ecfd2e480ae1fa87f63ac9d363cc2e7a9122ec925
BLAKE2b-256 checksum
How to use checksums
c78fbf3d4f677b8b16eff7da94d4e1621e245e7d5a7af8307c8bd91133454ad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.5

Release files / azure_vault_loader-0.1.0-py3-none-any.whl

Download URL azure_vault_loader-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c8cf224abb66af044c291caaea95e66899d39425ac7db959043dd51affef59e
BLAKE2b-256 checksum
How to use checksums
c7656c72267f7ca41fee9202861907ec54aeb90b554e128e79ed1d52a7f86d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.5

Security for azure-vault-loader 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page