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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 089a4d21c925f07e667839c0345fbd02c3ba5970cf7b424e4be83fffad7fe1a8 |
|
MD5 | e7c6767442c17b49175510c4621019a6 |
|
BLAKE2b-256 | 86a19cd828a6565773dd45ec6879ba4671f0cb21f2e69b9a8f8380f12704a0ac |
Close
Hashes for ops_py_azure_key_vault_report-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9d99fa8c0ef643535dfa9d71352dd0ef36c2d0e4e8bded0671e5548561f0bb1 |
|
MD5 | 64c46d44a3b6bf648def55a7e0cd4be2 |
|
BLAKE2b-256 | f7ed238a38a4e786f58d080037fbc26af375aa38a291a1c833bea321346c1495 |