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

pip-audit or Trivy reports a CVE in a Python package, but `pip install -U` says it is already the latest

IntermediateTroubleshootingSAST, SCA and secrets scanning in CI
Answer

Likely causes → A pinned upper bound in another dependency holds it back, or the scanner reads a stale lockfile (requirements.txt, poetry.lock) rather than the installed env.

Diagnose →

pip-audit -r requirements.txt
pipdeptree -r -p cryptography
pip index versions cryptography

Fix → Bump the constraining parent, regenerate the lock (pip-compile --upgrade-package cryptography or poetry update cryptography), and rescan.

Prevent → Scan the lockfile that is actually deployed, and keep locks regenerated by automation.

All DevSecOps questions Roadmap: Security in the pipeline

More on SAST, SCA and secrets scanning in CI