What is CodeQL and how does its model differ from Semgrep?
IntermediateConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer
CodeQL compiles your code into a relational database (for compiled languages, by observing the build) and you query it with a Datalog-like language. That enables deep inter-procedural data-flow and control-flow analysis. It is strong for finding complex vulnerabilities and variant analysis, but scans are slower and need a build for Java, C#, Go and C/C++.
Semgrep matches on syntax trees with code-like patterns; it is fast, needs no build and rules are easy to write, but has shallower cross-file analysis in the open-source engine.
More on Application Security Testing (SAST, DAST, SCA, Secrets)
What is SAST and what are its strengths and limits?BeginnerWhat is DAST and how does it differ from SAST?BeginnerWhat is IAST and RASP?IntermediateWhat is SCA and what does it scan?BeginnerHow does a SAST tool find a SQL injection using taint analysis?AdvancedHow do you write a simple Semgrep rule?Intermediate