Recover a Pulumi Stack Wedged by an Interrupted Update
Detect pending operations and a held lock on a Pulumi stack after an interrupted update, then clear them with pulumi cancel and pulumi refresh behind an approval, then verify the stack is clean.
Audit HashiCorp Vault Transit Engine encryption key rotation and version staleness with Kestra. Enforce cryptographic compliance with automated Slack alerts.
In enterprise security architectures utilizing HashiCorp Vault's Transit Secrets Engine for cryptography-as-a-service, encryption keys protect sensitive workloads across payment gateways, PII databases, and authentication tokens. Industry standards (including PCI-DSS, SOC 2, and HIPAA) strictly mandate cryptographic key rotation within defined lifespans (typically 90 days). Neglected key rotation elevates blast radiuses in the event of compromised credentials and risks immediate compliance certification revocation.
This blueprint implements an automated Day 2 Operations governance gate that audits HashiCorp Vault Transit key metadata on a scheduled cadence. It inspects the creation timestamp of the latest key version, evaluates its age against organizational SLA thresholds, alerts security teams via Slack upon overdue staleness, and optionally executes an automated key rotation behind an explicit dry-run safety gate.
schedule (io.kestra.plugin.core.trigger.Schedule) initiates the audit cycle every 6 hours (disabled by default for initial setup).probe_key_metadata (io.kestra.plugin.core.http.Request) invokes the Vault Transit API GET /v1/{mount}/keys/{key_name} using the configured VAULT_TOKEN to retrieve version history, minimum decryption version, and timestamp metadata.evaluate_key_age (io.kestra.plugin.scripts.python.Script) parses the JSON response, determines the age of the latest key version in days, and outputs a typed compliance verdict (COMPLIANT, ROTATION_OVERDUE, or PROBE_FAILED).route_by_compliance (io.kestra.plugin.core.flow.Switch) branches based on the calculated verdict.COMPLIANT), log_compliant_status logs verified version and age metrics.ROTATION_OVERDUE), alert_rotation_overdue dispatches an operational alert to Slack using io.kestra.plugin.slack.notifications.SlackIncomingWebhook. If auto_rotate is enabled and dry_run is false, rotate_transit_key generates a fresh key version automatically.log_audit_completion writes a final audit recap for execution tracking and lineage.errors block intercepts unexpected connection failures or authentication errors and alerts Slack.auto_rotate and dry_run).Tracking Vault key rotation with manual calendar reminders or isolated cron scripts creates operational blind spots, lacks audit lineage, and increases the risk of unhandled secret rotation failures. Kestra provides a declarative workflow engine with centralized secret management, conditional flow branching, execution history, and native Slack alerting without writing or maintaining custom monitoring daemons.
vault secrets enable transit).payment-encryption-key).sys/mounts, transit/keys/*).To run HashiCorp Vault locally in development mode while avoiding host port 8080 conflicts:
docker run -d --name vault-dev -p 8200:8200 -e 'VAULT_DEV_ROOT_TOKEN_ID=root' hashicorp/vault:latest
Initialize a transit key in the dev container:
docker exec -it vault-dev vault secrets enable transit
docker exec -it vault-dev vault write -f transit/keys/payment-encryption-key
If Kestra is running inside a Docker network, connect the Vault container to Kestra network:
docker network ls
docker network connect YOUR_KESTRA_NETWORK vault-dev
VAULT_TOKEN: Vault administrative or service token with read permissions on the Transit engine.SLACK_WEBHOOK: Incoming Webhook URL for Slack alerting.Note for Kestra Open-Source (OSS): Secrets are provided as base64-encoded environment variables formatted as
SECRET_<NAME>on the Kestra server or worker environment.
| Name | Type | Default | Allowed Values | Description |
|---|---|---|---|---|
vault_addr |
STRING | "http://localhost:8200" |
HTTP/HTTPS URL | Base endpoint URL of Vault server |
key_name |
STRING | "payment-encryption-key" |
Valid key name | Target Transit encryption key name |
transit_mount |
STRING | "transit" |
Valid mount path | Transit Secrets Engine mount path |
max_key_age_days |
INT | 90 |
Positive integer | Maximum key version age before alert |
auto_rotate |
SELECT | "false" |
"true", "false" |
Automated key rotation toggle |
dry_run |
SELECT | "true" |
"true", "false" |
Dry run simulation flag |
{{ outputs.evaluate_key_age.vars.verdict }}: Compliance verdict (COMPLIANT, ROTATION_OVERDUE, PROBE_FAILED).{{ outputs.evaluate_key_age.vars.latest_version }}: Current active primary version of the Transit key.{{ outputs.evaluate_key_age.vars.age_days }}: Calculated age in days of the latest key version.{{ outputs.evaluate_key_age.vars.key_type }}: Cryptographic algorithm and key type (e.g. aes256-gcm96).VAULT_TOKEN and SLACK_WEBHOOK in your Kestra namespace secrets.COMPLIANT with the key version and age printed.schedule trigger to audit key rotation periodically.LIST /v1/{mount}/keys.POST /v1/{mount}/rewrap/{key_name}) to update stored ciphertexts after key rotation.VAULT_TOKEN policy grants read capability on transit/keys/{key_name} and update on transit/keys/{key_name}/rotate.auto_rotate: "true" AND dry_run: "false" are explicitly supplied.