Web Application Security

HOWTO: Prevent your AWS credentials and other secrets from being exposed in code repositories

Uber had AWS credentials exposed on GitHub. As thousands of other companies do. It has been known for a while that nuggets such as private keys and credentials can be found with the GitHub search functionality or with Google dorks so looking for sensitive information in GitHub repositories is not new.

So how can you protect your company’s assets?

Check your repositories now

There is a great tool that you should use to check for any secrets exposed in your private and public code repositories. It is Gitrob developed by Michael Henriksen from the SoundCloud security team.

Gitrob helps organizations find sensitive information lingering in publicly available files on GitHub. This command line tool goes through all public organization and member repositories and matches filenames against a range of patterns for files that typically contain sensitive or dangerous information.

It is a good idea to schedule this kind of a scan on a continuous basis.

Gitrob (https://github.com/michenriksen/gitrob)

Prevent secrets from being committed to the repos

Once the repos are checked, have a look at git-secrets* to prevent your developers from committing sensitive information such as passwords to your code in the first place.

git-secrets is developed by Michael Dowling from AWS team.

git-secrets scans commits, commit messages, and — no-ff merges to prevent adding secrets into your git repositories. If a commit, commit message, or any commit in a — no-ff merge history matches one of your configured prohibited regular expression patterns, then the commit is rejected.

git-secrets (https://github.com/awslabs/git-secrets)

Tags: Data Breach

Recent Posts

The CISO’s Dilemma: How To Scale AI Securely

Your board wants AI. Your developers are building with it. Your budget committee is asking…

6 days ago

Agent-to-Agent Attacks Are Coming: What API Security Teaches Us About Securing AI Systems

AI systems are no longer just isolated models responding to human prompts.  In modern production…

7 days ago

Everyone Knows About Broken Authorization – So Why Does It Still Work for Attackers?

Broken authorization is one of the most widely known API vulnerabilities.  It features in the…

2 weeks ago

From Shadow APIs to Shadow AI: How the API Threat Model Is Expanding Faster Than Most Defenses

The shadow technology problem is getting worse.  Over the past few years, organizations have scaled…

4 weeks ago

Inside Modern API Attacks: What We Learn from the 2026 API ThreatStats Report

API security has been a growing concern for years. However, while it was always seen…

4 weeks ago

CISO Spotlight: Craig Riddell on Curiosity, Translation, and Why API Security is the New Business Imperative

It’s an unusually cold winter morning in Houston, and Craig Riddell is settling into his…

1 month ago