Developers bypass your pre-commit secret scan with `git commit --no-verify`. How do you close the gap?
IntermediateScenarioPipeline Security Scanning
Answer
Situation read → Client-side hooks are advice, not enforcement. They can always be skipped.
What I'd do →
- Keep the pre-commit hook for fast feedback (
pre-commitframework with gitleaks). - Enforce the same scan in CI as a required status check on the protected branch.
- Turn on server-side push protection (GitHub secret scanning push protection, GitLab push rules).
- Run a scheduled full-history scan across all repos.
Why → Defence in depth: the hook helps the honest developer, the server-side control stops the rest.
Interview tip → "Never rely on client-side controls for enforcement."
More on Pipeline Security Scanning
You are asked to add security to an existing CI pipeline. Where do SAST, SCA, secrets scanning and DAST each go?BeginnerGitleaks flags an AWS access key in a pull request. The developer says it is a test key. What do you do?BeginnerDevelopers fear security scans will slow the pipeline from 6 to 20 minutes. How do you roll them out?BeginnerA SAST tool reports 2,000 findings on a legacy repo the first time you run it. How do you introduce it without freezing delivery?IntermediateA developer insists a scanner finding is a false positive. What is your process?BeginnerSCA flags a critical CVE in a transitive dependency and no patched version exists. What are your options?Intermediate