Interview Prep/DevSecOps/Application Security Testing (SAST, DAST, SCA, Secrets)

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.

All DevSecOps questions Roadmap: Security in the pipeline

More on Application Security Testing (SAST, DAST, SCA, Secrets)