Output a Key Vault Secrets report
Project description
azure-key-vault-report
Description
Generates a plain text report of secrets in the specified Key Vault.
Then table is generated and sorted (from top to bottom) by:
- the oldest
Expiration
date, then by - the oldest
Last Updated
date
The table also contains a Comment
columns, which may include info about:
- Days to when the secret will expire
- Days since the secret expired
- Info if the secret has no expiration date set
- Days since the Secret was last updated
The raw list, which is used to generate the report, is fetched by invoking the following shell command as subprocess:
az keyvault secret list --vault-name NAME-OF-THE-KEY-VAULT
Installation
pip install ops-py-azure-key-vault-report
Usage
Example code:
from azure_key_vault_report import azure_key_vault_report
name = "kv-super-secrets"
kv = azure_key_vault_report.AzureKeyVaultReport(name)
kv.az_cmd()
kv.parse_results()
kv.set_report_header()
report = kv.plaintext_report()
print(report)
---------------------------------------------------------------------------------------------------------------------------------------------
Secret Name | Last Updated | Expiration | Comment
---------------------------------------------------------------------------------------------------------------------------------------------
CertificateRenewal | 2023-11-22 | 2025-11-22 | Will expire in 729 days. Updated 2 days ago.
ClientSecret | 2023-10-31 | 2024-06-25 | Will expire in 214 days. Updated 24 days ago.
ClientId | 2020-12-15 | | Has no expiration date. Updated 1074 days ago
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ops-py-azure-key-vault-report-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b78d6db46f0dd7640f7040d3733cf547bdee283a735e9d02af24c1c1681d9255 |
|
MD5 | 6feecad606e09935ad0c5e61313bb8ad |
|
BLAKE2b-256 | ba545897002e0926eb208b316a905efdbc140d19d958da206dda1363f78b36ef |
Close
Hashes for ops_py_azure_key_vault_report-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c32e26f930ae918e145c534c454dd0510cc1e72cc6293eeda3063a8ef04ad77 |
|
MD5 | 15313ed2d1f302fe844473a5b44e6a70 |
|
BLAKE2b-256 | e2aecd400d04992dbccbda40e6ff773cd5587af4b8e6b6a5ee0088740747a53d |