Get into DevOps is a blog about methodologies, practices and tools to improve software delivery.

Monitor public repositories in a Github organisation

Monitor public repositories in a Github organisation

In large organisations using the public cloud to store code, it's unfortunately not uncommon to accidentally make something public that should be private. Whether that's due to negligence or ignorance, a leak can have dramatic consequences.

While using something like https://github.com/awslabs/git-secrets to make sure secrets are not committed with code is a very good idea, that's only half of the story. What about actual application logic; proprietary code that could enable potential attackers to learn more about you?

If one were using Github for storing code, one simple approach to prevent leaks is to monitor the list of public repositories under the organisation's account.

Luckily, Github makes this very easy via their API. To get the list of public repositories under the ANDigital organisation:

$ curl -s https://api.github.com/orgs/andigital/repos

A ready-made solution to monitor the list of public repositories, and send an e-mail on any changes, can be found here: https://github.com/mjuuso/github-public-repo-watcher

Set the script to be run periodically (in a crontab), and enjoy knowing that should something be made accidentally public, at least you'll know about it.

Persistent SSH sessions with Mosh

Getting started with metrics

Getting started with metrics