r/StackoverReddit • u/Mysterious-Stock5125 • Jun 11 '24
Question How do I interpret GitHub CodeQL CLI results?
It's my first time trying out CodeQL. I've setup a few Python scripts for analysis via the CLI. I ran the create database command and analyze command with a queries that look for the top 25 CWEs by MITRE, and specified that the results should be a CSV file. My issue is interpreting the results. The severity levels I got are only {'error', 'warning'}. I expected {'critical', 'high', 'medium', 'low'}. I read https://github.blog/changelog/2021-07-19-codeql-code-scanning-new-severity-levels-for-security-alerts/ and https://docs.github.com/en/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts but I'm still not clear on what these results mean. Are 'error' and 'warning' necessarily about security here? I am only interested in security vulnerabilities and I only used queries that look specifically for CWEs. My assumption based on what I read is that error = {critical and high} and warning = {medium and low} and note = none.
1
u/chrisrko Moderator Jun 12 '24
Interpreting GitHub CodeQL CLI results can be a bit confusing, especially when trying to map severity levels to the security vulnerability context. Let's break down your situation. :)
Understanding Severity Levels in CodeQL CLI
The severity levels you're seeing (
error,warning,note) are specific to CodeQL and do not directly map to the more detailed severity levels (critical,high,medium,low) used in some other contexts, such as the GitHub Code Scanning alerts. Here's a basic mapping of how CodeQL CLI results can be interpreted:criticalorhighseverity in the context of security vulnerabilities.mediumorlowseverity in security contexts.Mapping CodeQL Results to Security Context
Given your specific interest in security vulnerabilities and your use of queries focusing on the top 25 CWEs by MITRE, it's important to correctly interpret the severity of the findings:
criticalandhighseverity vulnerabilities.mediumandlowseverity vulnerabilities.Practical Steps to Interpret Your Results
Severity Levels in Context: If you want to align the results with the
critical,high,medium,lowseverity levels, consider this general guideline:criticalorhigh.mediumorlow.Further Clarification
If the above mapping doesn't provide enough clarity, you can also:
critical,high,medium,lowseverity levels directly.1
u/chrisrko Moderator Aug 08 '24
INFO!!! We are moving to r/stackoverflow !!!!
We want everybody to please be aware that all future posts and updates from us will from now on be on r/stackoverflow
We made an appeal to gain ownershift of r/stackoverflow because it has been abandoned, and it got granted!!
So please migrate with us to our new subreddit r/stackoverflow ;)