Repository navigation
v0.12.29
v0.12.29 — more vendor API keys, AWS secret keys and webhook URLs are masked
With --llm-anonymize, a number of common secret formats matched no masking rule and were sent to the model endpoint whole on the alerting line, its source and context, and on the line's template minus their digits: Twilio key and account SIDs, SendGrid, npm, GitLab and Hugging Face tokens, Shopify access tokens and app secrets, PyPI upload tokens, the AWS secret access key, and the secret part of Slack and Discord webhook URLs. The fail-closed re-scan read every such line as clean. Present since v0.4.0, when --llm-anonymize was introduced. With a local Ollama nothing left the machine.
This fixes a credential leak.
Found while working on #114.
What changed:
- Twilio
SK…/AC…, SendGridSG.…, npmnpm_…, GitLab (glpat-…and 12 more documented prefixes), Hugging Facehf_…, Shopifyshpat_…/shpca_…/shppa_…/shpss_…and PyPIpypi-AgE…are masked as one placeholder each, on the raw line and on the template. - An AWS secret access key is masked when its name stands beside it (
AWS_SECRET_ACCESS_KEY=, INI, YAML, JSON includingSecretAccessKey, CLI flags) or when it follows anAKIA…/ASIA…key id. - In a Slack (
hooks.slack.com/services/…) or Discord (discord.com/api/webhooks/…) webhook URL, the IDs and the token in the path are masked; the query stays visible. - A glued Slack user token's template no longer sends its hex letters.
- The README's list of what is masked now names every vendor format, including Stripe, GitHub, Slack and Google, which were masked since v0.12.15 but not listed.
Measured:
- A test runs the whole anonymizer against v0.12.28 and requires that every byte v0.12.28 masked is still masked.
- False positives, counted over every
.gofile in a Go module cache (18,658 files), the Go standard library, 10 real journald boots and the project's test strings: 0 for every format. - Wire check against a capturing endpoint: v0.12.28 sends each secret, v0.12.29 sends none, in any field.
Costs, pinned in the tests:
- An uppercase hex run glued after
ACon a template is read as a Twilio SID. - A run of exactly 40 key characters after any masked secret is read as an AWS secret key.
- A webhook's IDs and token become one placeholder.
Install: download the binary for your OS from the assets below, or go install github.com/maxie7/logscry/cmd/logscry@latest.
Known limitations:
- An AWS secret access key with no name or key id beside it, or after a name such as
secret_key, is still sent. - GitLab tokens are matched by an inferred shape: a body shorter than 20 characters would be sent. The
_gitlab_sessioncookie is not covered. - Twilio's actual secrets (the Auth Token and API key secret) have no prefix; only the SIDs are masked.
- Slack workflow and trigger webhooks, and GovSlack, are not covered.
- The full list is in the README's Known limitations.
Tracked as #116.