Unfortunately, security is often more about what we don’t think of than what we do, and it’s important to cover as many bases as possible.
A trend has emerged recently of scraping sites such as GitHub for sensitive information, such as passwords, access keys, and databases. This method of stealing information has become a
How widespread are Git security issues?
We took a sample of data from the public GitHub stream to get an idea of the scale of this issue. Out of the 78.3 thousand commits we checked, 62 of them matched sensitive file patterns. Though this may not sound like a lot (a mere 0.07%), when scaled, the impact is quite large.
Given data from today alone from the Github Archive, there was 459,991 push events. If you apply that 0.07% to these numbers, it equates to roughly 322. That’s over 300 databases logins, servers credentials, and SSH private keys becoming public information each day! Note also that we’re talking commits here, not projects.
With many developers pushing code several times per day, proper understanding and usage of gitignore is essential to protecting company secrets — the easiest way for criminals to break in is for you to hand them the keys. Generally speaking configuration files that contain passwords, keys, and similar info should not be public. Luckily, there is a solution!
The gitignore file was created for the purpose of preventing files from being uploaded without needing to explicitly exclude them. Any file added to the gitignore will never be included in git commits. Not only does this feature allow for system-specific files to be untouched, but it allows for insurance that sensitive files will never be uploaded. Let’s take the following directory as an example:
If we wanted to exclude the file, “example.txt”, we would simply create a file, “.gitignore”, containing this line:
Easy, right? If we wanted to exclude all text files, we would simply add the line:
Each line pertains to a specific file or set of files to exclude. Here’s an example of a full fledged gitignore file (specifically one for ruby):
## Documentation cache and generated files:
There are quite a few other useful features of the gitignore, such as directory removal or file whitelisting — we’ve included a few helpful links below if you’re interested in some of the more advanced gitignore functionality.
Before adding a
Here are a few additional resources if you’re interested in learning more:
If you’re interested in doing some digging yourself on what sorts of things aren’t being
5 keys to successful organizational design
How do you create an organization that is nimble, flexible and takes a fresh view of team structure? These are the keys to creating and maintaining a successful business that will last the test of time.Read more
Why your best tech talent quits
Your best developers and IT pros receive recruiting offers in their InMail and inboxes daily. Because the competition for the top tech talent is so fierce, how do you keep your best employees in house?Read more
Technology in 2025: Prepare your workforce
The key to surviving this new industrial revolution is leading it. That requires two key elements of agile businesses: awareness of disruptive technology and a plan to develop talent that can make the most of it.Read more