This is an excellent tool to have as a security consultant, and it just keeps getting better and better. When approaching a large codebase, it enables you to write custom rules that match on certain antipatterns you've spotted that may be unique to the codebase. That's the real value of the tool, but the repository of per-language rules is also convenient for quickly finding low-hanging fruit (like every use of a pot…
Semgrep: Semantic grep for code
31–40 of 110 posts
Re: Semgrep: Semantic grep for code
#32The name "Semantic Grep" does not give a good idea for what this tool is and what it does. The web page states: "Static analysis at ludicrous speed. Find bugs and enforce code standards" "grep" is short for "global regular expression print". It finds matches for the given regular expression and prints them. "Semantic Grep" is a static analyzer with configurable rules, style checks, etc. It does much more than search…
Re: Semgrep: Semantic grep for code
#33Earlier quoted context omitted.
It does seem potentially good for enforcing standards where the participants are willing. But you can work around it fairly easily. Like the example "python no-prints" rule: https://semgrep.dev/s/sabihb:no-prints Lots of workarounds it wouldn't find, like: import builtins builtins.print("whee")
I'm guessing the value with the rules system is, you can add new rules easily. So during a code review, if you see somebody using your example, you could create a new rule to catch that. I don't think you can go in with the mindset that it will catch everything, but rather, it's about being able to iterate quickly with your rules.
Re: Semgrep: Semantic grep for code
#34This is an excellent tool to have as a security consultant, and it just keeps getting better and better. When approaching a large codebase, it enables you to write custom rules that match on certain antipatterns you've spotted that may be unique to the codebase. That's the real value of the tool, but the repository of per-language rules is also convenient for quickly finding low-hanging fruit (like every use of a pot…
Python you can probably do that just from the standard library. ast.parse and all that.
Re: Semgrep: Semantic grep for code
#35The name "Semantic Grep" does not give a good idea for what this tool is and what it does. The web page states: "Static analysis at ludicrous speed. Find bugs and enforce code standards" "grep" is short for "global regular expression print". It finds matches for the given regular expression and prints them. "Semantic Grep" is a static analyzer with configurable rules, style checks, etc. It does much more than search…
Re: Semgrep: Semantic grep for code
#36The name "Semantic Grep" does not give a good idea for what this tool is and what it does. The web page states: "Static analysis at ludicrous speed. Find bugs and enforce code standards" "grep" is short for "global regular expression print". It finds matches for the given regular expression and prints them. "Semantic Grep" is a static analyzer with configurable rules, style checks, etc. It does much more than search…
Re: Semgrep: Semantic grep for code
#37Re: Semgrep: Semantic grep for code
#38No Windows support yet: https://github.com/returntocorp/semgrep/issues/1330
(I'm guessing from your comment that this is important to you (i.e. WSL/Docker is not a solution).)
Re: Semgrep: Semantic grep for code
#39How does Semgrep compare to ESLint+a strict tsconfig?
Re: Semgrep: Semantic grep for code
#40No Windows support yet: https://github.com/returntocorp/semgrep/issues/1330
Also kind of surprising it's written in Python given that they advertise its speed.