Skip to content

Treat corporate commit emails as warnings in email-privacy-exempt repos - #2

Merged
paul-abb merged 1 commit into
mainfrom
infosec/exposure-check-email-exempt
Oct 29, 2026
Merged

paul-abb merged 1 commit into
mainfrom
infosec/exposure-check-email-exempt

Conversation

@paul-abb

Copy link
Copy Markdown
Collaborator

What does this PR change?

In repositories marked with the org custom property email-privacy-exempt=true (today only switch), a corporate email in a commit's author, committer or message becomes a warning instead of a failure. The secret scan is unchanged and still fails the check. Every other repository keeps the strict rule.

Why

The org ruleset that requires this workflow (26167854, evaluate) excludes exempt repos, copying the "Email filter" rulesets. That leaves switch, the most active public repo, with no secret scanning from this check at all. Replaying the check over switch (152 open PRs, 244 merged in the last 30 days):

  • corporate email would fail 32% of open and 74% of merged PRs (staff and contractor commit addresses; the reason the repo is exempt from the Email filter);
  • gitleaks would fail 2 of 152 open and 6 of 244 merged PRs, all test fixtures (none since 10-14).

With this change switch can be brought under the ruleset for secrets without blocking most of its PRs on email.

How

The metadata step reads GET /repos/{repo}/properties/values with the job's github.token (metadata read, which every token has), and treats the repo as exempt only when email-privacy-exempt is exactly "true". If the call fails for any reason it prints a warning and applies the strict rule, so an API error can't turn the email check off. The value comes from the API, not from the PR, so a PR can't change it. When exempt, the step summary says so.

Testing

  • The lookup, run with a user token against live repos: switch → exempt; .github, switch-trust-sdk-py → strict; a nonexistent repo → warning plus strict.
  • actionlint clean; YAML parses.
  • Whether github.token can read custom property values in a required-workflow run is confirmed on the first evaluate-mode run in switch after the ruleset is updated; if it can't, switch fails strict (safe direction) and the step prints the warning.

Tracking: INFOSEC-652.

🤖 Generated with Claude Code

@paul-abb
paul-abb merged commit d16ac42 into main Oct 29, 2026
4 checks passed
@paul-abb
paul-abb deleted the infosec/exposure-check-email-exempt branch October 29, 2026 22:42
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.

1 participant