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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f7f44cd1f66a89c2cd031ec28e58ad068ba64ab929ba26aa8f772b9d76561a8 |
|
MD5 | a689df62481b269a686535000be1cdb3 |
|
BLAKE2b-256 | 1955fc12a9f07dbad5ea5be1bcee7d8830f00301035f4e24f54525d05ca73fa5 |
Close
Hashes for ops_py_azure_key_vault_report-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6de0d102f3068a3d062e83015073a4d5c43d038c0021e2f8d8d7bdf0484549f |
|
MD5 | df8b486fcb542bc8be0868fa0d77290c |
|
BLAKE2b-256 | 7dd9c2493e97e304c60dbbcfc46024953bdfdfb4046f25071671bbb3cd9c522f |