Interview Prep/DevSecOps/SAST, SCA and secrets scanning in CI

SonarQube marks a real SQL injection as "fixed" after a refactor, but the code still concatenates input

AdvancedTroubleshootingSAST, SCA and secrets scanning in CI
Answer

Likely causes → A false negative: the data flow now crosses a wrapper method, reflection, or a framework the analyzer does not model, so taint tracking lost the source.

Diagnose → Trace source to sink manually, then confirm with a second engine:

semgrep --config p/sql-injection src/
codeql database create db --language=java && codeql database analyze db java-security-extended.qls --format=sarif-latest -o out.sarif

Fix → Fix the code with parameterised queries. Add a custom rule (Semgrep taint mode or a CodeQL source/sink model) for the wrapper so it is detected next time.

Prevent → Do not treat "0 findings" as proof. Pair SAST with code review on security-sensitive modules and DAST on the running endpoint.

All DevSecOps questions Roadmap: Security in the pipeline

More on SAST, SCA and secrets scanning in CI