Skip to content

Commit 1d3f4bc

Browse files
committed
docs: updated defaults and readme to clarify how to disable rules
Signed-off-by: Carl Flottmann <[email protected]>
1 parent 03be145 commit 1d3f4bc

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/macaron/config/defaults.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -629,12 +629,13 @@ check_deliverability = True
629629
# custom rulesets: this is a collection of user-provided rulesets, living inside the path provided to 'custom_semgrep_rules_path'.
630630

631631
# disable default semgrep rulesets here (i.e. all rule IDs in a Semgrep .yaml file) using ruleset names, the name
632-
# without the .yaml prefix. Currently, we disable the exfiltration rulesets by default due to a high false positive rate.
633-
# This list may not contain duplicated elements. Macaron's default ruleset names are all unique.
632+
# without the .yaml prefix (e.g. "obfuscation" for "obfuscation.yaml"). Currently, we disable the exfiltration rulesets
633+
# by default due to a high false positive rate. This list may not contain duplicated elements. Macaron's default ruleset
634+
# names are all unique.
634635
disabled_default_rulesets = exfiltration
635-
# disable individual rules here (i.e. individual rule IDs inside a Semgrep .yaml file) using rule IDs. You may also
636-
# provide the IDs of your custom semgrep rules here too, as all Semgrep rule IDs must be unique. This list may not contain
637-
# duplicated elements.
636+
# disable individual rules here (i.e. individual rule IDs inside a Semgrep .yaml file, specified under the "rules" header in the
637+
# .yaml file, with each rule ID under "- id") using rule IDs. You may also provide the IDs of your custom semgrep rules here too,
638+
# as all Semgrep rule IDs must be unique. This list may not contain duplicated elements.
638639
disabled_rules =
639640
# absolute path to a directory where a custom set of semgrep rules for source code analysis are stored. These will be included
640641
# with Macaron's default rules. The path will be normalised to the OS path type.

src/macaron/malware_analyzer/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ This feature is currently a work in progress, and supports detection of code obf
101101
- `custom_semgrep_rules`: supply to this an absolute path to a directory containing custom Semgrep `.yaml` files to be run alongside the default ones.
102102
- `disabled_custom_rulesets`: supply to this a comma separated list of the names of custom Semgrep rule files (excluding the `.yaml` extension) to disable all rule IDs in that file.
103103
104+
Here, a "semgrep ruleset" refers to the name of a Semgrep `.yaml` file without the extension. For example, the name of one of the default rulesets is `obfuscation`, as the file name is `obfuscation.yaml`. To disable all rules in that `.yaml` file would look like this:
105+
```
106+
disabled_default_rulesets = obfuscation
107+
```
108+
A "semgrep rule", or "rule ID", refers to an `- id` entry under the `rules:` heading in a Semgrep `.yaml` file. For example, the name of a rule in `obfuscation.yaml` would be `obfuscation_excessive-spacing`, which is the name specified under the `- id` entry for that rule. Disabling it would look like this:
109+
```
110+
disabled_rules = obfuscation_excessive-spacing
111+
```
112+
104113
### Contributing
105114
106115
When contributing an analyzer, it must meet the following requirements:

0 commit comments

Comments
 (0)