Lockwell

Docs · Operate

Leak checks

POST /v1/scan with {"text", "prefix"}. Every secret under the prefix that the caller can read is matched against the text (up to 1 MiB).

# fail the job if its log holds any secret this identity can read, naming which to rotate
jq -Rs --arg p lw-<team>/ci/ '{text: ., prefix: $p}' build.log > payload.json
curl -sf -H "X-Vault-Token: $VAULT_TOKEN" --data @payload.json "$VAULT_ADDR/v1/scan" > scan.json
jq -r '.data.leaks[] | "leaked: \(.path) \(.field) (version \(.version))"' scan.json
jq -e '.data.leaks == []' scan.json > /dev/null
{"data": {"leaks": [{"path": "lw-<team>/ci/DEPLOY_KEY", "field": "value", "version": 3, "offsets": [118]}], "scanned": 41, "capped": false}}
  • Paths the caller can't read are skipped, never named.
  • Values under 8 characters, blank values and references are skipped.
  • Up to 2,000 secrets per call; capped says when more were left. Up to 5 offsets per leak.