Add masking pattern for new GitHub App installation token format#3387
Merged
Conversation
Closed
Owner
|
Hello, thanks for contributing for the first time! |
…_APPID_JWT) Agent-Logs-Url: https://github.com/plengauer/Thoth/sessions/694cfeaf-b6d8-46d5-a484-7f1e4aabc764 Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Adjust secret masking for job level instrumentation
Add masking pattern for new GitHub App installation token format
Apr 26, 2026
plengauer
approved these changes
Apr 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions job instrumentation to continue redacting GitHub App installation tokens as GitHub rolls out a new stateless ghs_<AppID>_<JWT> format, ensuring tokens don’t leak into OTLP logs/metrics/traces.
Changes:
- Added a new
ghs_<AppID>_<JWT>masking regex alongside the existingghs_[a-zA-Z0-9]{36}rule. - Applied the new rule consistently across all five existing redaction surfaces (log attributes/body, metric attributes, span attributes/name).
moflwi
previously approved these changes
Apr 27, 2026
moflwi
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub is rolling out a new stateless format for App installation tokens starting April 27th 2026. The existing pattern
ghs_[a-zA-Z0-9]{36}only matches the old 40-char opaque tokens and will miss the newghs_APPID_JWTformat (~520 chars, variable length).Changes
actions/instrument/job/inject_and_init.sh: Added new masking pattern alongside the existing one in all 5 redaction locations (log attributes, log body, metric attributes, span attributes, span name):This matches the new
ghs_<AppID>_<JWT>structure where the JWT portion uses standard base64url-with-dots encoding. The oldghs_[a-zA-Z0-9]{36}pattern is retained for tokens issued before the rollout (valid up to 1h, their normal expiry).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
github.blog/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)/usr/bin/curl curl -s REDACTED(dns block)https://api.github.com/meta/usr/bin/curl curl -s REDACTED git pipe�� get --global cal/bin/git user.name(http block)/usr/bin/curl curl -fsSL REDACTED git conf�� --global ] | @tsv k/_actions/plengauer/opentelemetry-github/v5.50.0/actions/instrument/job/bin/git(http block)https://api.github.com/repos/github/advisory-database/usr/bin/curl curl -fsSL REDACTED mkfifo y_sh��(http block)https://api.github.com/repos/github/advisory-database/contents/usr/bin/curl curl -fsSL REDACTED mkfifo y_sh��(http block)https://api.github.com/repos/github/super-linter/issues/usr/bin/wget wget -q -O - REDACTED(http block)https://api.github.com/search/code/usr/bin/curl curl -fsSL REDACTED mktemp Zwf -p /tmp /usr/bin/cat(http block)https://api.github.com/search/issuesimport urllib.request, json
Try GitHub API search for issues mentioning the new format
url = 'REDACTED'
req = urllib.request.Request(url, headers={
cat pipe�� /usr/bin/mkfifo cat /usr/bin/cat /usr/bin/mktemp mkfifo /usr/bin/cat cat pipe�� /usr/bin/rm cat /usr/bin/cat /usr/bin/sleep rm /usr/bin/rm cat` (http block)
Try to get cached version via Wayback machine or similar
urls = [
'REDACTED',
] mktemp pipe�� -p /tmp /usr/bin/rm /usr/bin/cat mkfifo /usr/bin/cat rm Hmx_�� ub.com/rate_limit cat /usr/bin/cat /usr/bin/sleep rm /usr/bin/git cat` (dns block)