Skip to content

fix(sigma): act on the #351 detection review — /identity anchored, three filter_ci stubs, 4698 LOLBins gated - #359

Merged
Gerrrt merged 3 commits into
mainfrom
fix/detection-review-351
Oct 14, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
fix/detection-review-351

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

Acts on the weekly detection review in #351: seven findings adopted, two recorded as stated blind spots, four sub-proposals declined in the rule bodies so they are not re-proposed next cycle. No coverage holes were found; every change is a scoping or FP-balance call, verified against the rule body, the gates and the fixtures before being taken.

Per rule, what each change would have missed (full detail in the commit and the CHANGELOG entry):

  • linux/ssh_private_key_read — name|contains: '/identity' matched every read under an identity* directory. The SSHv1 key now has its own name|endswith: '/.ssh/identity' selection (a contains would still take ~/.ssh/identity-service/), proven by a single-event manifest row; the TN fixture gains both near-misses. The new (a or b) and not f shape is traced in the Splunk precedence allowlist.
  • cloudflare/cloudflare_api_token_created, terraform/tfc_token_backdoor, gitlab/gitlab_token_backdoor — shipped condition: selection while every folder sibling carried a DEPLOY-REQUIRED filter_ci on an action the IaC provider performs on every apply. Each gets the sibling's stub, a _ci_suppressed manifest row and a deploy-time README row. cloud/aws_login_profile_created declined in-rule.
  • cloud/entra_illicit_consent_grant — comment + falsepositives now say the unanchored allowlist can hide a grant to a different app, and name the Sentinel paths to anchor on. Comment-only.
  • lateral_movement/rdp_hijack_tscon_4688 — declined and reworded: the review read the two arms the other way round. Logic unchanged.
  • persistence/scheduled_task_suspicious_4698 — \regsvr32.exe / \rundll32.exe were bare substrings at high; they now require a co-occurring attacker-controlled target (URL/scriptlet, UNC, user-writable dir), mshta stays bare. Two traps found on the way and written into the block: a bare http matches the <Task xmlns="http://…"> root of every real 4698 (the synthetic fixtures omit the root, so no gate saw it; the new TN carries it), and a UNC prefix is '\\\\' because \ is Sigma's escape. First fixtures ever for either LOLBin, each as its own single-event manifest row with a dedicated TN file, because an aggregate TP passes when any event fires.
  • lateral_movement/passthehash_4624_fanout — filter_machine stated as a coverage decision, with why Sigma cannot narrow it.
  • impact/service_stop_burst — ' stop' → ' stop ' on the net/sc arms (the sibling's anchor); cmdlet anchoring declined in-rule; precedence allowlist row re-traced.
  • impact/account_access_removal_4725 — 4724 pooling declined in-rule.
  • registry/harbor_image_pushed_trusted_tag — retitled to match the logic; file name and pairing unchanged.
  • google_workspace/gws_external_mail_forwarding — verified against the Reports API appendix; service: user_accounts is correct, recorded in a comment.

Which layer does this belong to?

  • It is not in core/ — that tree is vendored from
    dotfiles-core and is overwritten on
    the next sync. Identical-everywhere config is fixed upstream.
  • Changes with the OS (packages, paths, an ID= gate) belong in the matching
    OS repo, not here. Changes with the analyst → defense/, detections/.

If you touched a detection

  • make drift green — the generated artifacts (COVERAGE.md,
    coverage-layer.json, the SIEM deploy forms) are regenerated, not hand-edited.
    These are byte-compared in CI; a stale one reads as an unrelated red gate.
  • make methodology green — DEFENSE-METHODOLOGY.md still describes the rules
    that exist, and the README's gate list still matches sigma.yml.
  • make validation-gates green — the new rule has validation coverage, and any
    new fixture has provenance.
  • ATT&CK technique IDs are real (make attack-tags; needs the network).
  • If a filter_* rule changed: it still has a true negative.

Environment data never enters this repo

  • No real hostnames, internal IPs, user names, credentials, or captured telemetry
    from a live estate. Fixtures are synthetic or vendor-documented — see
    docker/validation/check-fixture-provenance.sh.

Checks

  • make lint green (pinned shellcheck + bash -n/zsh -n + markdownlint) — markdownlint not run locally (no npx on the host); the three new README deploy rows and the extended Entra row are padded to the header width by hand (all 25 rows measure 434 chars). No shell changed.
  • make test green (196 passed)
  • make htpx green; HTPX-COVERAGE.md, coverage-layer.json and COVERAGE.md unchanged (no tag, stem or count moved)
  • run-cloud-validation.sh 47/47, including the three new _ci_suppressed rows
  • run-sigma-validation.sh 127/127 against zircolite v3.7.6: the three 4698 LOLBin cases and the legacy ssh key are their own rows, so each fires on its own; the rooted LOLBin TN fires the moment '>http' is loosened to 'http' (checked by hand).

Notes

Closes #351

🤖 Generated with Claude Code

…ree filter_ci stubs, 4698 LOLBins gated (#351)

The weekly review found no coverage holes and ten scoping calls. Each was checked
against the rule body, the gates and the fixtures. Seven adopted, two documented as
stated blind spots, four sub-proposals declined in the rule bodies so they are not
re-proposed next cycle.

What each change would have missed, or stops missing:

- linux/ssh_private_key_read: `name|contains: '/identity'` matched every read under a
  directory named identity* (~/identity-service/config.yml) - a standing FP stream on a
  high rule. Now '/.ssh/identity'. The TN fixture gains that exact near-miss, which the
  old value fired on.
- cloudflare/cloudflare_api_token_created, terraform/tfc_token_backdoor,
  gitlab/gitlab_token_backdoor: bare `condition: selection` while every folder sibling
  carried a DEPLOY-REQUIRED filter_ci, on actions the IaC provider performs on every
  apply. Each gets the sibling's stub, a _ci_suppressed manifest row and a README
  deploy-time row. aws_login_profile_created declined in-rule (actor != target is the
  triage criterion; medium is a triage surface).
- cloud/entra_illicit_consent_grant: comment + falsepositives record that the
  unanchored TargetResources allowlist hides a grant to a different app whenever a
  sanctioned id appears anywhere in the event, and name the Sentinel paths to anchor on.
- lateral_movement/rdp_hijack_tscon_4688: declined, reworded. The review read the arms
  the other way round - the /dest: arm is channel-independent and deliberately not
  Image-pinned; the Sysmon-only arm is the no-/dest interactive form.
- persistence/scheduled_task_suspicious_4698: \regsvr32.exe and \rundll32.exe fired at
  high as bare substrings. They now require a co-occurring attacker-controlled target
  (URL/scriptlet, UNC, user-writable dir); mshta stays bare. Two traps written into the
  block: a bare 'http' matches the <Task xmlns="http://..."> root of every real 4698 and
  would have collapsed the AND (synthetic fixtures omit the root; the new TN carries
  it), and a UNC prefix is '\\\\' because \ is Sigma's escape. Neither LOLBin had a
  fixture before; three TPs and two TNs added.
- lateral_movement/passthehash_4624_fanout: filter_machine stated as a coverage
  decision (captured machine-account hash reuse never reaches the count) and why Sigma
  cannot narrow it.
- impact/service_stop_burst: ' stop' -> ' stop ' on the net/sc arms (the anchor the
  protected-services sibling uses); a bare ' stop' also matched ' stopped' and padded the
  distinct-CommandLine burst. Cmdlet anchoring declined in-rule (piped `| Stop-Service`
  has no trailing target). Precedence allowlist row re-traced.
- impact/account_access_removal_4725: declined in-rule - 4724 pooled on purpose; the
  bulk forced reset that trips it is filter_identity_admins' job.
- registry/harbor_image_pushed_trusted_tag: retitled "Harbor artifact push or tag create
  (supply-chain triage surface)" to match the logic. File name and pairing unchanged.
- google_workspace/gws_external_mail_forwarding: verified against the Reports API
  appendix; service: user_accounts is correct. Recorded in a logsource comment.

Ledger: 124 rules, 0 added. coverage-layer.json, COVERAGE.md and HTPX-COVERAGE.md
unchanged; all three SIEM forms regenerated.

Checks run locally: sigma check, make drift, make methodology, make validation-gates,
make test, make attack-tags, make htpx, run-cloud-validation (47/47),
run-sigma-validation 123/123 (zircolite v3.7.6, with pysigma-backend-sqlite pinned to
2.0.0 locally because the committed constraints file does not resolve since #354 - a
pre-existing red gate, not touched here). The three new 4698 TPs and two TNs were also
run one event at a time: all three fire, both stay silent, and the rooted TN fires the
moment '>http' is loosened to 'http'. make markdown skipped - no npx on this host; the
README rows are padded to the header widths by hand.

Closes #351

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 19:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Legacy identity matching remains substring-based, and the new LOLBin positives are not independently enforced by CI.

2 open findings
What changed in this PR

Refines Sigma detection scoping and false-positive handling following review #351.

Changes:

  • Anchors or gates noisy SSH, scheduled-task, and service-stop detections.
  • Adds CI suppression stubs and validation fixtures for three token rules.
  • Documents accepted blind spots/declines and regenerates SIEM outputs.
File Description
CHANGELOG.md Records review outcomes.
detections/​README.md Expands deployment checklist.
detections/​sigma/​cloud/​aws_login_profile_created.yml Documents declined IaC filter.
detections/​sigma/​cloud/​entra_illicit_consent_grant.yml Documents allowlist blind spot.
detections/​sigma/​cloudflare/​cloudflare_api_token_created.yml Adds CI actor filter.
detections/​sigma/​gitlab/​gitlab_token_backdoor.yml Adds automation actor filter.
detections/​sigma/​google_workspace/​gws_external_mail_forwarding.yml Documents service verification.
detections/​sigma/​impact/​account_access_removal_4725.yml Explains event pooling.
detections/​sigma/​impact/​service_stop_burst.yml Tightens stop-command matching.
detections/​sigma/​lateral_movement/​passthehash_4624_fanout.yml Documents machine-account blind spot.
detections/​sigma/​lateral_movement/​rdp_hijack_tscon_4688.yml Clarifies rule arms and channels.
detections/​sigma/​linux/​ssh_private_key_read.yml Narrows legacy identity matching.
detections/​sigma/​persistence/​scheduled_task_suspicious_4698.yml Gates LOLBins on suspicious targets.
detections/​sigma/​registry/​harbor_image_pushed_trusted_tag.yml Retitles the triage rule.
detections/​sigma/​terraform/​tfc_token_backdoor.yml Adds pipeline actor filter.
detections/​siem/​elastic/​rules.generated.lucene Regenerates Elastic queries.
detections/​siem/​splunk/​savedsearches.generated.conf Regenerates Splunk searches.
detections/​siem/​splunk-precedence-allowlist.tsv Revalidates precedence behavior.
detections/​siem/​sentinel/​rules.generated.kql Regenerates Sentinel queries.
docker/​validation/​fixture-provenance.tsv Records fixture provenance.
docker/​validation/​sigma-cloud-manifest.tsv Registers CI-suppression cases.
docker/​validation/​sigma-fixtures/​cloud/​cloudflare_api_token_created_ci_tn.jsonl Adds Cloudflare CI negative.
docker/​validation/​sigma-fixtures/​cloud/​gitlab_token_backdoor_ci_tn.jsonl Adds GitLab CI negative.
docker/​validation/​sigma-fixtures/​cloud/​tfc_token_backdoor_ci_tn.jsonl Adds TFC CI negative.
docker/​validation/​sigma-fixtures/​linux_ssh_key_read_tn.jsonl Adds identity-directory near-miss.
docker/​validation/​sigma-fixtures/​scheduled_task_4698.jsonl Adds LOLBin positives.
docker/​validation/​sigma-fixtures/​scheduled_task_4698_tn.jsonl Adds rooted benign task negatives.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Gerrrt and others added 2 commits October 14, 2026 19:09
…e can run (#351)

The "sigma rules fire on synthetic event logs" job on this PR dies at pip install:
ResolutionImpossible, because the committed constraints pin pysigma-backend-sqlite
2.1.0 (the backend's pySigma-2 release) beside pysigma==1.5.1. #354 bumped it alone
and the job has been red on main since, with 0/123 rows executed — so the three new
4698 true positives and two true negatives in this PR could not be proven on CI.

Same one-line pin #360 and #361 carry; the full rationale and the Renovate cap live
there, and this line merges identically under either. Verified: a fresh venv built
from this file resolves (pysigma 1.5.1, backend 2.0.0) and run-sigma-validation.sh
passes 123/123 from it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… LOLBin case its own row (#351)

Two review findings on #359, both right:

- ssh_private_key_read: '/.ssh/identity' under name|contains still took
  ~/.ssh/identity-service/config.yml while the description claimed an exact match.
  The SSHv1 key is now selection_legacy with name|endswith, ORed with the id_* list
  under the shared key term. That makes the Splunk form `(a) OR (b) NOT (filter)`, so
  the binding is traced in splunk-precedence-allowlist.tsv: key gates both branches and
  the reader/pubkey filter covers both. Proven by a single-event row (tar reading
  /root/.ssh/identity) and two near-misses on the TN (identity-service/ inside and
  outside .ssh/).
- scheduled_task_suspicious_4698: the three LOLBin true positives sat in the aggregate
  TP file, which passes when ANY event fires - the existing 21 already did, so the new
  arms could go silent unnoticed. Each is now its own single-event row
  (lolbin-userdir, -scriptlet, -unc) against a dedicated LOLBin TN file carrying the
  real <Task xmlns> root. The aggregate files go back to what they held before.

run-sigma-validation.sh 127/127 (zircolite v3.7.6); drift, methodology,
validation-gates and tests green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit d016355 into main Oct 14, 2026
18 checks passed
@Gerrrt
Gerrrt deleted the fix/detection-review-351 branch October 14, 2026 19:28
Gerrrt added a commit that referenced this pull request Oct 14, 2026
#359 applied the same pysigma-backend-sqlite==2.0.0 pin with a placeholder comment
pointing at this PR for the full account; this keeps the pin and the full header
paragraph and drops the placeholder. Both CHANGELOG entries stay, this PR's first.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

detection-review: weekly Sigma corpus review

2 participants