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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ca8aaf820268fefaaf200bf1bc998331c3a59ccd34ec63fa0378b6f1ec11c46 |
|
MD5 | d249e5aa35c3b6989cc0a24df342826d |
|
BLAKE2b-256 | abe91c5c4303718c4f86cfbe9b968942bd28391c279d8e729a3c00581b0ade6d |
Close
Hashes for ops_py_azure_key_vault_report-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bbd1d45ac3840c17f092299ff8c209a63ebba29106e2aec1957d5d0724cfd0e |
|
MD5 | f04ced9f5a2746edbd449c28352c0765 |
|
BLAKE2b-256 | f45072799460293de8cb3811477b294c17fc06125a3199be68f205b83dbbf5e0 |