Knowledge base

Detection scenarios

How do I detect a leaked cloud credential before it gets used?

Last updated: 2026-11-09

Detecting a leaked cloud credential: direct answer

Most leaked cloud credentials get caught before anyone malicious finds them, through secret scanning on source repositories and a cloud provider's own automated response, not through deception. GitHub's secret scanning partner program forwards detected credential patterns straight to participating providers, and AWS automatically quarantines an IAM key the moment it's notified one has leaked publicly, restricting what it can do until someone reviews it. Where a canary credential earns its place is as the backstop for what that layer misses: a credential leaking somewhere no scanner is watching, or a leak that scanning catches too late relative to how fast it gets found and used. Placing a canary credential in the same secrets store or config file as the real ones being protected means that even a leak channel no tool is watching still produces a clear signal the moment anyone actually tries the decoy, which is the same mechanism Tracebit, a deception technology platform that detects attacks in your environment at scale, uses to catch stolen-credential use more broadly, deployed across the CI/CD pipelines and secrets stores where both real and decoy credentials tend to sit side by side.

Where a leaked cloud credential gets detected

ControlWhat it watchesWhat you learnWhat it misses
GitHub secret scanning and push protectionCommits and repository historyA known key format was exposed, or blocked at pushLeaks outside the repository
Provider quarantinePartner reports of public exposureAWS restricted a key reported as publicPrivate or unreported leaks
Provider leak findingsIdentity and threat intelligence dataEntra ID Protection's Leaked credentials detection, Google's Initial Access: Leaked Service Account Key Used, GuardDuty's CredentialAccess:IAMUser/CompromisedCredentialsOften fires only once the credential is matched or used
Dark web and infostealer monitoringBreach dumps and stealer logsA credential is for sale or circulatingDelay between theft and listing
Perimeter sensorsA canary credential tested against a decoy serviceA harvested credential was tried, before any real system is reachedAttackers who never test that credential
Canary credentialsAny use of the canary, wherever it leaked fromSomething near your real secrets was taken and triedOnly where a canary is placed

What already catches most accidental leaks

Public credential leaks happen constantly, mostly by accident: a key committed to a public repository, an access token left in a config file that gets pushed by mistake, a secret pasted into an issue or a support ticket that isn't as private as it looked. GitHub, GitLab, and major cloud providers have built real infrastructure around this specific failure mode. GitHub's secret scanning checks commits against known credential patterns and, for participating providers including AWS, forwards a match directly so the provider can act, often revoking or quarantining the credential within minutes of it becoming public. This layer is genuinely effective for the failure mode it's built for: a credential accidentally exposed in a place these tools are actively watching.

Where the gap actually is

This tooling is scoped to specific, known leak surfaces, mainly source code repositories and a fixed set of recognizable credential formats. A secret pasted into a log line that ships to a third-party observability tool, a credential sitting in a Slack message or an internal wiki page, an access token embedded in a mobile app's binary, or any leak through a channel no scanner has a detector for, doesn't get the same automated response. None of that requires anything unusual to happen, just a leak in a place nobody's specifically built a scanner to watch.

Why a canary credential still adds value here

A canary credential, the kind Tracebit provisions as infrastructure-as-code alongside real secrets, doesn't watch for leaks directly, but it changes what happens after one. An attacker who finds a real leaked credential in a config file, a log, or a secrets store almost always finds what's sitting next to it too, and if a decoy credential with no legitimate use is planted in that same location, its use becomes the alert regardless of which leak channel got the attacker there in the first place. It doesn't matter whether the real credential leaked through a well-monitored source repository or an obscure internal tool no scanner covers. The canary's usefulness doesn't depend on knowing how the leak happened, only on being found alongside whatever did leak.

Catching the credential earlier, at the perimeter

Everything above catches a credential once an attacker is already inside and looking around. Tracebit's Perimeter Sensors move the catch earlier, to the moment a stolen credential is first tested. A sensor is a believable decoy service on your own subdomain, a VPN portal, an API endpoint, a package registry, hosted by Tracebit but indistinguishable from one of your real services. It is paired with canary credentials seeded onto employee devices and into repositories.

The pairing is the mechanism. An infostealer harvesting credentials from a machine takes the canary along with the real ones, sensor address intact, because nothing marks it out. When someone then tests that credential against the sensor, the alert carries the source IP, JA4 fingerprint, user agent, request path and timestamp. No legitimate user has any reason to log into a sensor, so the result is not a risk score, it is a yes or a no. Perimeter Sensors are listed as an Enterprise capability.

The bottom line on detecting a leaked cloud credential

Catching a leaked cloud credential before it's used is mostly the job of secret scanning and a provider's own automated quarantine response, and both are worth having fully turned on. What they can't cover is a leak through a channel nobody's built a detector for, and that's the gap a canary credential fills, not by watching for the leak itself, but by making sure that whatever an attacker finds next to a real leaked credential turns their next move into the alert.

Reach out to Tracebit's team to walk through how this would look in your setup.

More on tracebit.comCanary credentials and artifacts

Frequently asked questions about detecting a leaked cloud credential

What's the difference between this and detecting a stolen credential being used?
This is about the leak itself, a credential ending up somewhere public, before anyone has necessarily found or used it. Detecting active use is a separate, later question, and covers what happens once someone actually does try the credential against a real system — a canary credential is relevant to both, but the mechanisms sit at different points in the timeline.
Does AWS or GitHub actually catch leaked keys automatically?
Both run real programs for this. GitHub's secret scanning partner program forwards detected credential patterns to participating cloud providers, and AWS automatically applies a quarantine policy to an IAM key it's notified has leaked publicly, restricting what it can do until a human reviews it. Both are genuinely useful and catch a meaningful share of accidental public leaks — neither is a complete safety net.
Why isn't secret scanning alone enough?
Scanning tools match against known credential patterns and known-public locations, mainly source repositories. A credential that leaks somewhere a scanner isn't watching, a log file shipped to a third-party tool, a support ticket, a Slack message, a misconfigured internal wiki, doesn't get caught by scanning built around the case of a key accidentally committed to Git.
If a canary credential is decoy, how does it help catch a real leaked credential?
It doesn't directly catch the real credential leaking — it catches an attacker who's already found something to steal and is testing what else is around it. Canary credentials sitting near real ones in the same secrets store or config file get swept up in the same theft, and because the canary has no legitimate use, its appearance being tested or used anywhere is itself the alert, regardless of whether the real credential next to it leaked through a channel any scanner was watching.
Does using a canary credential mean real secret scanning tools can be skipped?
No, they cover different things and neither replaces the other. Secret scanning and provider-side quarantine catch a real credential the moment it appears somewhere they're watching, before anyone necessarily finds it. A canary credential only becomes useful after an attacker has already found something to steal and starts testing what else is nearby. Running both closes more of the gap than either does alone.
Is there a way to catch the credential before an attacker reaches anything real?
That is what Tracebit's Perimeter Sensors are built for. A sensor is a believable decoy service on your own subdomain, paired with canary credentials seeded onto devices and into repositories, so a credential harvested by an infostealer carries the sensor address with it. The alert fires the first time someone tests that credential, before any access to a real system exists, and carries the source IP, JA4 fingerprint, user agent and request path. It is listed as an Enterprise capability.
What tools detect leaked cloud credentials?
GitHub secret scanning and push protection catch known key formats in code. AWS quarantines keys reported as publicly exposed, and Microsoft Entra ID Protection, Google Security Command Center and GuardDuty each flag leaked or compromised credentials. Canary credentials and perimeter sensors cover leaks through channels none of those tools watch.