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
File details
Details for the file ops-py-azure-key-vault-report-0.0.6.tar.gz
.
File metadata
- Download URL: ops-py-azure-key-vault-report-0.0.6.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df752be52cb43ead8f2a0645f1ce2a08b338c8dd12c0cb07794dc06a897207e1 |
|
MD5 | f98da86b78b58baa97d123f9dd44dc34 |
|
BLAKE2b-256 | 1d94645bf57e03759905ff258c8e8ffd1a1eeb31b235952e3ce279d60106ede3 |
File details
Details for the file ops_py_azure_key_vault_report-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: ops_py_azure_key_vault_report-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c98753845b0cb5094e2af37cae7666266da983a31112540cb4e7ac4bb2d45754 |
|
MD5 | 726760b917b2473edc7cba1991a7273f |
|
BLAKE2b-256 | 4503c0e34e5bb18c3b28190a4915413adedac4fe1c82d943185a2d45ade2609a |