Interview Prep/DevSecOps/Secrets management: Vault, External Secrets and SOPS

A GitHub Actions secret appears in plain text in the job log even though secrets are supposed to be masked

BeginnerTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → Masking only matches the exact stored string. A value that was base64-encoded, URL-encoded, split into lines (a multi-line JSON key) or derived from the secret is not masked.

Diagnose → Search the log for the transformed form, and check for steps that do echo $SECRET | base64, cat key.json or set -x.

Fix → Delete the log run (Actions UI, or gh run delete <id>) and rotate the secret. Mask derived values before using them:

TOKEN=$(echo "$RAW" | base64 -d)
echo "::add-mask::$TOKEN"

Prevent → Never print secrets, avoid set -x in steps that handle them, and store structured credentials as a single-line value.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS