Skip to content

Add masking pattern for new GitHub App installation token format#3387

Merged
plengauer merged 5 commits into
mainfrom
copilot/adjust-secret-masking
May 14, 2026
Merged

Add masking pattern for new GitHub App installation token format#3387
plengauer merged 5 commits into
mainfrom
copilot/adjust-secret-masking

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

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 new ghs_APPID_JWT format (~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):
ghs_[0-9]+_[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+

This matches the new ghs_<AppID>_<JWT> structure where the JWT portion uses standard base64url-with-dots encoding. The old ghs_[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
    • Triggering command: /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)
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • https://api.github.com/meta
    • Triggering command: /usr/bin/curl curl -s REDACTED git pipe�� get --global cal/bin/git user.name (http block)
    • Triggering command: /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
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED mkfifo y_sh�� (http block)
  • https://api.github.com/repos/github/advisory-database/contents
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED mkfifo y_sh�� (http block)
  • https://api.github.com/repos/github/super-linter/issues
    • Triggering command: /usr/bin/wget wget -q -O - REDACTED (http block)
  • https://api.github.com/search/code
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED mktemp Zwf -p /tmp /usr/bin/cat (http block)
  • https://api.github.com/search/issues
    • Triggering command: `/usr/bin/python3 python3 -c
      import 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)

  • https://api.github.com/secret-scanning/alerts
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED git pipe�� get --global /usr/local/bin/git copilot.originalmktemp (http block)
  • webcache.googleusercontent.com
    • Triggering command: `/usr/bin/python3 python3 -c
      import urllib.request, re

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)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 26, 2026 that may be closed by this pull request
@plengauer
Copy link
Copy Markdown
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
Copilot AI requested a review from plengauer April 26, 2026 08:52
@plengauer plengauer marked this pull request as ready for review April 26, 2026 09:15
@plengauer plengauer requested a review from moflwi as a code owner April 26, 2026 09:15
Copilot AI review requested due to automatic review settings April 26, 2026 09:15
@plengauer plengauer enabled auto-merge (squash) April 26, 2026 09:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 existing ghs_[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
moflwi previously approved these changes Apr 27, 2026
@plengauer plengauer merged commit 2f9619f into main May 14, 2026
571 checks passed
@plengauer plengauer deleted the copilot/adjust-secret-masking branch May 14, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust secret masking

4 participants