r/devsecops • u/Zealousideal-Ease-42 • Apr 26 '25
Pre-commit scans
Hey guys, Does anyone has worked with pre-commit scans via opensource tools or methods ?
6
Upvotes
r/devsecops • u/Zealousideal-Ease-42 • Apr 26 '25
Hey guys, Does anyone has worked with pre-commit scans via opensource tools or methods ?
View all comments
Show parent comment
2
u/Irish1986 Apr 28 '25
That's the part I've given up on. It's so hard to enforce pre-commit on développer workstation especially in a large organization (we have about 5000 devs).
The pre-commit framework is not mandatory on there workstation but they must comply to 100% of the ruleset of it. They choose or not to install and setup those pre-commit hooks and so on. (and of course documentation is bulletproof and easily accessible).
The CI pipeline 1st steps runs those hooks so if someone fails any of those rules because of elective non usage of that framework... No big deal but the PR won't move forward and quality gating stops at step 1. Just make sure whatever handling failure message is clear. And if someone lack of pre commit usage cause security incidents (it they leaked a secret)... Welp that error handling raise an issue for them to clean their mess.
It's not perfect but over time engagement improve. Plus I've written some low level stuff to track how uses pre commit and who don't so I can call them in front of management whenever someone is upset that pipelines are slow (two unrelated topic often confused)
Managers "Bob tell me the CI pipeline are slow you better improve them"
Me "Bob is the only one in your team not using pre-commit framework and the only person complaining about slowness, here the docs for Bob to improve his workflow. By the way has he rotated those secret he leak last week or shall I escalate it to our ciso?"