Secrets filter leaves the tail of a secret when another secret is its prefix
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by locating Lemans::SecretsFilter and its tests, then read how it builds the Regexp.union from secret values. Add coverage for a shorter secret that prefixes a longer one, including the stated expected output, and run the focused filter tests. Done means the full longer value is redacted regardless of secret order.
Written by the indexing model from the issue text.
Description
Lemans::SecretsFilter builds one Regexp.union over the secret values in the order ENV lists them. Regexp alternation takes the first alternative that matches at a position, so when one secret is a prefix of another, a shorter secret listed first wins. Only the shared prefix is redacted, and the rest of the longer secret is written to result.json and the run artifacts.
Reproduce
filter = Lemans::SecretsFilter.new([ "tok-0123456789", "tok-0123456789-extended-secret" ])
filter.filter("a=tok-0123456789-extended-secret")
# => "a=<filtered>-extended-secret"
Expected
# => "a=<filtered>"
This happens with SecretsFilter.default whenever two *_KEY/*_TOKEN/*_SECRET/*_JWT variables hold values where one starts with the other, and the shorter one comes first in ENV.
- Dominant language
- Ruby
- Stars
- 99
- Forks
- 11
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rails/lemans
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
This is great.Open
Difficulty 1/5 Under an hour Newbie friendliness 10/100
Similar issues
-
開発用DockerイメージにPlaywrightのシステム依存を追加するPossibly taken @momocus claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sakazuki-org/sakazuki#1453 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jenkins-infra/jenkins.io#9615 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimePossibly taken @Goldziher claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Metric tooltips that contradict how the metric is calculatedPossibly taken @aniadeadu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WikiEducationFoundation/WikiEduDashboard#7303 · 1 comment ·
Maintainers usually reply within 1 day
-
WhatsApp Cloud template sync saves a partial template list when one page of the Graph API response failsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days