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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0683ed73f5ed338c37ba58bc93b0e72f4b8c136fa66bca2dec1b44af4c9e8fe9 |
|
MD5 | e9c91072399c95ac4333ef25027e5923 |
|
BLAKE2b-256 | 71a173bf5af03a2e306a449b6656a4f00f9de7e1930a93820834477ab7f222a9 |
Close
Hashes for ops_py_azure_key_vault_report-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35bee440e819cfaa01046be3efe53801dbd9b355d82ff639df0db7364981ac3b |
|
MD5 | 1dcf9ce51b2196ac14e0c7a779d01ed3 |
|
BLAKE2b-256 | 45b5f809d205c62ba87e5ad21dffa275e468af94ffe8592b24f1d428f9cb14d0 |