Code Scanning in GitHub
Using GitHub Code Scanning to find vulnerabilities in your code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ Part of my series on Automating Cybersecurity Metrics. The Code.
🔒 Related Stories: GitHub Security | Application Security | Secure Code
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I got a call at IANS Research about GitHub security so I was reviewing some of the latest information on the topic and decided to set up GitHub Code Scanning. It’s a pretty cool feature that can help you find problems in your code. Whether or not this code scanning tool works for you depends on a few factors so you’ll have to test it out, but here’s how it works. It just takes a few steps to set it up.
Head over to your repo and click on settings.
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*pElmyQaYHeq_54tYH-IrcQ.png)
Scroll down and click on Code security and analysis.
Under settings click on Code scanning. Click Set up.
I chose the Default option. If you want to explore the Advanced option you can write additional queries to find specific vulnerabilities you are seeking.
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*HdmawJAG2A-AYueH0C587w.png)
I set this up on the repository that contains the code I’m writing for my latest blog series on security metrics automation (and cloud governance):
It takes a little while for the analysis to complete. After it does, head back to your GitHub repo and if any findings exist there will be a number next to the security link at the top of the repository. I had one. What?!
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Pdb9S1tu1oljDLUda8VvNA.png)
When I took a look at the finding, it was because I had printed out a password of a piece of test code — which I explicitly told you not to do in production code ever because the password should remain secret and not be exposed on the screen or in logs. Well, that’s an accurate finding!
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*JTCQ78Nxq1aT08tBHdKFFw.png)
In addition to what GitHub has to offer, you can integrate code scanning from Other tools. Click on the Explore workflows link.
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*VVpl1d6t_OsGlutqxol1Gw.png)
Here you can choose and test out a number of different tools, such as DevSkim which I’ve used before and is free.
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*KV5eMYIZLI_piUJ32IC-OA.png)
This is a pretty nice feature from GitHub and it’s very easy to set up.
GitHub Code Scanning uses GitHub actions so you’ll want to check the cost of that if you have a lot of repositories to scan.
Enjoy and Secure Your Code!
More on application security here:
Follow for updates.
Teri Radichel | © 2nd Sight Lab 2023
About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
![](https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*H9Ew1KCl-29nZiPR.jpeg)