Sub topic 4
The partner program: how providers learn about leaked tokens
This chapter assumes you know what secret scanning does and that GitHub recognizes provider-specific token formats, both covered in earlier chapters. It explains what happens on the provider's side when a token leaks.
Two audiences for one detection
When a token matches a known pattern, two different parties can be told:
- The repository owner or administrators. They receive a secret scanning alert in the repository, if the feature is enabled.
- The service provider that issued the token. This happens through the secret scanning partner program.
The partner program is the second path. A provider such as a cloud vendor, a payments company or a package registry joins the program and tells GitHub what its tokens look like. When one appears in a public repository, GitHub tells the provider directly.
How a report travels
A provider registers a pattern, usually a regular expression for its token format, and an HTTPS endpoint that accepts reports. GitHub then scans public content for that pattern. After a match, GitHub sends the endpoint a message containing:
- the matched token
- the repository and file location where it was found
- a signature, so the provider can confirm the request really came from GitHub
The provider checks the token against its own systems. Only the provider can tell whether the token is real and still active. What it does next is its own policy. It might revoke the token, issue a replacement, or email the account holder.
What the program does not cover
The partner program does not replace the features you turn on yourself.
| Question | Partner program | Secret scanning alerts on your repository |
|---|---|---|
| Who is notified? | The token's provider | You and other repository admins |
| Where does it scan? | Public content | Repositories where you enabled it |
| Do you need to configure it? | No | Yes |
| What is the outcome? | The provider may revoke the token | An alert for you to triage |
A provider that revokes a token does not clean up your repository. The secret is still in the commit history, and the alert, if you have one, still needs a resolution. Later chapters cover that cleanup.
Why this matters in practice
Automated scanners crawl public repositories for credentials. A token can be used by someone else within minutes of a push. Partner reporting shortens the time between exposure and revocation, because the provider does not wait for you to notice.
This has two consequences you will see in practice:
- A token may stop working before you open the alert. A failed API call can be the first sign of a leak.
- You may get an email from a provider about a leak in a repository you have not looked at recently.
In both cases, find the commit, confirm what was exposed, and continue with the revoke-and-rotate steps in the remediation chapter.
Summary
- Providers join the partner program by registering a token pattern and a reporting endpoint.
- GitHub sends matches in public content to the provider with location details and a signature.
- The provider decides whether to verify, revoke or notify.
- Repository alerts and push protection are separate, and you still have to act on them.
Exercise
A teammate pushes an API key to a public repository. An hour later the key stops working, and no one has opened the repository's secret scanning alert. What is the most likely explanation, and what should the team still do?
Show answer
The key's provider is in the secret scanning partner program. GitHub reported the match to the provider, which revoked the key. The team should still treat the key as compromised and issue a new one. They should also resolve the repository alert with an accurate reason and remove the secret from the code and history. They should not assume the exposure was harmless because the key stopped working.