Custom SAST Rules
Overview
Arnica allows customers to create, manage and edit their own custom SAST rules to identify specific risks across the company. This capability allows customers to override any of Arnica's default rules to improve accuracy, change the description or update the default risk severity. To simplify the process of creating and editing SAST rules, Arnica leverages the default open source SAST rule schema developed by Semgrep. Rules that are built and tested directly within Semgrep's rules playground can be pasted directly into Arnica's custom SAST rule builder.
Running custom rules
Arnica maintains a list of global and tenant-specific rules.

Tenant-specific rules
Each Semgrep execution collects the global rules in a form of a dictionary. If the rule identifier is unique, it is appended to the dictionary. However, if the rule identifier has the same name as one of the global rule identifiers, it will override the global rule.
How to configure custom SAST rules
Adding a new rule
Work on the rule and test it in the Semgrep Playground
Navigate to the policies page and expand
Code Risks
and thenSAST
.Click on
Add
and paste the rule from the Semgrep Playground.

Best Practice: Introduce new rules over time and without merge blocking applied Logic in newly added rules will be applied in the next source code scan and may produce new findings within default branches.
Ensure that the checkbox indicates that the rule is valid and click on
OK
.Click on
Save
at the bottom of all policies.
Override an existing rule
Copy the rule ID that needs to be overridden from the SAST finding details or from other sources. Ensure it has the full identifier, such as
javascript.sequelize.security.audit.sequelize-injection-express.express-sequelize-injection
Follow the steps from the
Add a new rule
section above.
Last updated
Was this helpful?