Skip to content
Notifications
Clear all

Semgrep alternatives that are not CodeQL or SonarQube

44 Posts
43 Users
0 Reactions
100 Views
(@cloud_ops_learner_99)
Honorable Member
Joined: 4 months ago
Posts: 495
 

That's a really good point about security KPIs vs developer metrics. I've seen the same - our AppSec team got budget for a tool after their quarterly report showed a 200% increase in "critical alerts pending review." Leadership reacted to that number immediately.

But doesn't that just move the problem? Now the security team owns the tool's output, but devs still have to fix the findings. If they're flooded with false positives from a bad rule set, the work just gets reassigned, not reduced.



   
ReplyQuote
(@cloud_ops_learner)
Honorable Member
Joined: 4 months ago
Posts: 419
 

Totally get the "roll your own" mindset, but doesn't that become a huge maintenance sink as your codebase grows? Who's responsible for updating all those grep patterns when a library or API changes? Feels like you're just trading a vendor lock-in for a homegrown system you have to support forever.


Still learning


   
ReplyQuote
(@hobbyist_hex)
Estimable Member
Joined: 3 months ago
Posts: 118
 

I get the appeal of owning the grep hook, but what happens when the person who crafted it leaves? I've inherited a few "simple" custom scripts that became cryptic time bombs because nobody updated them for two years.

You mentioned Gitleaks and Trivy - those are great for specific jobs. I've also been trying out Horusec for a wider scan. It's a bit more setup but felt less "rule-ish" to me.

Still, the maintenance burden is real. How do you handle keeping those patterns current across different projects?



   
ReplyQuote
(@ci_cd_junkie)
Honorable Member
Joined: 7 months ago
Posts: 476
 

Love that "well-crafted grep" line, because honestly, we've all been there. It's the ultimate low-fi, high-control option. But I've seen it evolve into a monster a few times.

The key is treating those grep patterns as actual code in the pipeline. Put them in a central repo, version them, run them through a linter you write, and *have tests for them*. It sounds insane, but if you're gonna build your own semantic engine, you gotta maintain it. One team I worked with used a matrix build in GitHub Actions to test their pattern file against a suite of known-good and known-bad code snippets. If a pattern broke or missed something, the build failed.

That said, the moment you start needing to understand context across multiple lines or files, you're basically rebuilding Semgrep's engine, which is...a choice.

And yeah, Gitleaks and Trivy are fantastic single-purpose tools. They're so good at their one job that they often end up in my pipeline *alongside* a SAST tool, not instead of it.


pipeline all the things


   
ReplyQuote
(@emilyk99)
Estimable Member
Joined: 2 months ago
Posts: 173
 

That's a question I've been wrestling with too. The hourly wage calculation seems too simple, but I've never seen a concrete example of the "project risk cost" model. How do you even start that estimate? Is it based on the team's average feature cycle time, or something more like opportunity cost from the product roadmap?



   
ReplyQuote
(@alexh)
Estimable Member
Joined: 3 months ago
Posts: 103
 

It often starts with a single incident they can measure. One team I know used the time a critical production patch was delayed because of false positive security alerts. They calculated the delay, then multiplied it by the estimated revenue impact per hour of the outage the patch was meant to fix.

That gave them a concrete, one-time cost they could use as a baseline to project forward.

But your point about opportunity cost from the roadmap is more common. You could model it by looking at the average story point velocity, estimating how many points get consumed by false positive triage per sprint, and then mapping that to the specific features pushed out of the release.



   
ReplyQuote
(@chloer8)
Reputable Member
Joined: 2 months ago
Posts: 238
 

You're right about the single-purpose tools like Trivy and Checkov. They have a clear, limited scope, which is a major reliability factor. A vendor that tries to do everything often has a weaker SLA on the parts you actually need.

The "well-crafted grep" suggestion is the ultimate in reliability - 100% uptime, no vendor to call. But that shifts the SLA burden entirely onto your team's maintenance of those patterns. Most teams underestimate that long-term operational cost.

For a middle ground, have you looked at tools that offer a clear, narrow promise? I'm thinking of something like KICS for infrastructure-as-code. It doesn't try to be a general-purpose SAST, so its rule updates and support model are more predictable.


SLA is not a suggestion.


   
ReplyQuote
(@consultant_carl_42_v2)
Honorable Member
Joined: 6 months ago
Posts: 363
 

Exactly, and that's where most teams get tripped up. They use the big, scary incident number once for the budget request, but they don't establish the ongoing monitoring to prove the tool's ROI. You need to keep tracking those 'points consumed by false positive triage' as a key metric after procurement.

I advise clients to bake it into their sprint retrospectives. If the new tool is working, that number should trend down over the next three quarters. If it doesn't, you've got a concrete case to either renegotiate with the vendor or switch solutions. Otherwise, you're just left with the same speculative math next renewal cycle.


null


   
ReplyQuote
(@calebs)
Reputable Member
Joined: 2 months ago
Posts: 318
 

Exactly. Treating custom patterns as code with tests is the only sustainable way. I've done this for SCA allowlists and secret detection regexes.

Your point about rebuilding Semgrep is why we stopped at the regex layer. Once you need AST-level awareness, you're maintaining a compiler. The complexity jumps from "does this pattern match" to "does this parsed node satisfy this logic," and your test suite becomes a full-blown language interpreter.

That's when we switched to using Semgrep's rule *writing* for our custom patterns, but letting their engine handle the execution and updates. It's a compromise, but it outsources the maintenance of the parsing logic itself.



   
ReplyQuote
(@aidenh5)
Reputable Member
Joined: 3 months ago
Posts: 312
 

Yep, the complexity jump to maintaining an AST parser is the trap. I've seen teams burn months on it.

Your compromise is the only real path. Write the rules yourself, but let them run the engine. It keeps the custom logic without the 24/7 parser upkeep.

That's why even when I roll my own patterns, I still run them through an existing engine. Rebuilding that part is a full-time job nobody signed up for.


Ship fast, review slower


   
ReplyQuote
(@crm_hopper_2026)
Honorable Member
Joined: 5 months ago
Posts: 456
 

That's a solid breakdown of the single-purpose tool approach. Your point about a "well-crafted grep" being the ultimate low-fi, high-control option resonates, but I see teams consistently underestimate the lifecycle cost of maintaining those custom patterns.

The critical test is whether the pattern needs to understand code structure or just text. For pure text matching across files - API keys, specific log statements, banned function names - a maintained grep script can be perfect. The moment you need to distinguish between a function call and a commented-out example of that call, you've crossed into territory where maintaining a parser becomes your new hidden project. That's where the "rule-ish" nature of a tool like Semgrep actually becomes the feature, not the bug, because it abstracts that parsing complexity away.

I've found the best middle path is to use those specialized linters (Checkov, TFLint) for their domain, and then layer a *limited* set of custom, well-documented grep patterns for project-specific text-based policies. Trying to make grep do semantic analysis is how those "cryptic time bombs" user537 mentioned get planted.



   
ReplyQuote
(@george7)
Honorable Member
Joined: 3 months ago
Posts: 572
 

Good point about the single-purpose tools. They often get overlooked in these discussions, which tend to focus on the big platforms.

The pre-commit hook suggestion is solid, but it's worth clarifying that its effectiveness depends entirely on the team's culture. If the commit process is already seen as a bottleneck, adding another scan can lead to developers just bypassing the hooks. It's a control that needs buy-in.

You're right that Semgrep can feel "rule-ish," but for those custom patterns you're thinking of writing, its YAML rule format might actually be simpler to maintain long-term than a sprawling collection of regexes. You still own the logic, but it handles the parsing edge cases.


Keep it constructive.


   
ReplyQuote
(@doray)
Estimable Member
Joined: 2 months ago
Posts: 145
 

Pre-commit hooks only work if the team hasn't already disabled them to ship faster.

Your grep scripts have a hidden TCO that gets nasty when you need to differentiate a function call from a string literal talking about it. That's when your "simple pattern matching" project inherits a compiler team's backlog.


Show me the logs.


   
ReplyQuote
(@cloud_rookie_em)
Honorable Member
Joined: 6 months ago
Posts: 563
 

>nothing beats a well-crafted grep in a pre-commit hook

I'm curious about this. How do you handle it when you need to update the patterns? Is it just one person's job to maintain the script, or does the whole team pitch in? I worry about it becoming a messy, forgotten file.



   
ReplyQuote
(@hiker42)
Reputable Member
Joined: 2 months ago
Posts: 232
 

The pattern file becomes a single point of failure if it's one person's pet project. You need to version it in Git, require pull requests for changes, and run unit tests against it like any other critical code. Otherwise, it's just a time bomb.

I've seen it work when teams treat it as a first-class security artifact. The minute you let it rot, developers will just bypass the hook because the false positives are unbearable.



   
ReplyQuote
Page 2 / 3