Skip to content
Keys and credentials

Detect exposed secrets in your GitHub repositories

A key removed from the latest commit can remain accessible in the history. PentestLouis searches for exposed credentials and explains the expected response: revocation, rotation, cleanup and prevention.

Security, with a methodDocumented scopeExplicit limitsPractical advice
01

Why deleting the file is not enough

Git keeps previous versions. Once a secret has been committed, you must first assume it may have been copied, revoke it with the provider, create a new credential and then check where it is used. Cleaning the history without rotation leaves the main risk intact.

  • Revoke or disable the compromised credential
  • Create a replacement secret with minimal permissions
  • Update the secrets manager and deployments
  • Clean the history if needed and add a pre-commit check
02

Results handled with care

A security report must not become a new source of leaks. Detected values are reduced to the strict minimum needed for identification, and reports are encrypted. Avoid copying a full key into a ticket or an external analysis tool.

03

Preventing recurrence

A lasting fix combines a secrets manager, minimal permissions, the ability to rotate and checks before push. A recurring analysis complements these measures by catching a regression that slipped through the cracks.

Frequently asked questions

Move forward with the right answers.

Scope, method and limits: what you need to know to make your choice.

Should a detected key be revoked immediately?

Yes, if it is or has been valid. Treat it as compromised, review its usage logs and replace it with one that has minimal permissions.

Is the secret copied into the report?

The report should provide enough context to identify the issue without needlessly reproducing the full value.

What types of secrets can be involved?

API keys, access tokens, database credentials, private keys and other values with sensitive patterns or context.

Go further

Keep exploring.

All resources
Put it into practice

A first step toward a safer application.

Choose your GitHub repositories and get a clear first diagnosis. Your code is accessed read-only.

Check my repositories

We use the trackers PentestLouis needs to work. With your consent, we also record your browsing, without your input and with the text of your account area masked, to improve the site, and Google can set cookies to measure how well our ads perform. Read the privacy policy