Skip to content

Fix indentation in netexec_mft.yml so the rule loads - #240

Open
jpl1337 wants to merge 1 commit into
WithSecureOpenSource:masterfrom
jpl1337:fix/netexec-mft-indentation
Open

jpl1337 wants to merge 1 commit into
WithSecureOpenSource:masterfrom
jpl1337:fix/netexec-mft-indentation

Conversation

@jpl1337

@jpl1337 jpl1337 commented Sep 21, 2026

Copy link
Copy Markdown

rules/mft/netexec_mft.yml fails to load because three keys under filter: are indented inconsistently, so they are not siblings of netexec:.

  netexec:        # 2 spaces
   netexec1:      # 3 spaces
    netexec2:     # 4 spaces — and FullPath: is also at 4, so it is not a child
    netexec3:     # 4 spaces — same

chainsaw lint on master (82fabe2):

[!] /netexec_mft.yml: did not find expected key at line 44 column 4, while parsing a block mapping at line 38 column 3
[+] Validated 52 detection rules out of 53

In a hunt it degrades gracefully rather than failing the run, which is likely why it went unnoticed:

[!] Loaded 130 detection rules (1 not loaded)

The rule has been in this state since it was added in #226 (merged 2026-04-01).

Fix

Re-indents netexec1, netexec2 and netexec3 to 2 spaces so all four blocks referenced by condition are siblings. Three lines changed; no detection logic, patterns or metadata touched.

Verification

$ chainsaw lint --kind chainsaw rules/mft
[+] Validated 53 detection rules out of 53

Parsed structure now matches what condition: netexec or netexec1 or netexec2 or netexec3 expects — all four resolve to mappings with a FullPath list (1, 2, 1 and 10 patterns respectively), and there are no stray keys left under filter.

Also re-ran a parse sweep over all 127 rule files: this was the only one that failed, and it now passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant