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

What Your Board Gets Wrong About AI Security

Editor's note: This article was originally published by Craig Riddell on LinkedIn. It has been…

6 days ago

Extending Security to MCP Servers: Closing a Critical Gap

The Model Context Protocol (MCP) is a de facto standard for providing structured access to…

2 weeks ago

Introducing Wallarm Middle East Cloud: Built for Data Residency Compliance

As API and AI adoption grows across the Middle East, so do the expectations around…

3 weeks ago

6 Lessons Security Leaders Must Learn About AI and APIs

Most organizations treating AI security as a model problem are defending the wrong layer. Security…

4 weeks ago

The Governance Gap: How the EU AI Act Makes API Security a Compliance Imperative

Your legal team just handed you a 400-page document and said "figure out compliance." The…

1 month ago

Attacking the MCP Trust Boundary

Every secure API draws a line between code and data. HTTP separates headers from bodies.…

1 month ago