Skip to content

docs(windows): document the EDR signal surface - #17856

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/win-edr-posture-docs
Sep 2, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/win-edr-posture-docs

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​403 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​403

ELI5

Windows security software (Microsoft Defender for Endpoint) opened six security incidents against Orca on one company's laptops in eight days. Orca isn't malware and Defender isn't broken — Orca just does a lot of things that look exactly like what attackers do. This adds a document explaining which behaviours those are, why we do them, and what admins have to configure so their security team stops getting paged.

What Changed

Docs only. No code.

  • New docs/reference/windows-edr-posture.md — the reference doc.
  • AGENTS.md — a short ## Windows EDR Signal Surface entry under Considerations, plus a one-line bullet in the Cross-Platform Support list (where the other Windows reference docs are indexed).
  • .gitignore — allowlist the new file; docs/** is ignored by default and tracked reference docs are opted in individually.

The doc covers:

  1. What the tenant saw — six incidents against 1.4.192 in eight days, four evidence clusters (update / spawn / process-table / computer-use), all behavioural process-tree scoring rather than signature hits, two escalating to multi-stage incidents with ATT&CK tactic mappings.
  2. The behaviours, and why each exists — each shape mapped to the concrete file that produces it and to the engineering reason it is there:
  3. Signing is not the gate — reputation is signer plus hash-keyed prevalence; a free OV cert shared across OSS projects carries no independent SmartScreen/MAPS reputation, and every release resets prevalence.
  4. What we do not know — the two evidence gaps are stated as gaps, not smoothed over.
  5. Guidance for engineers — a don't/instead checklist, cross-referencing windows-process-enumeration.md and windows-setup-shell.md.
  6. Guidance for administrators — AV path exclusions do not suppress EDR behavioural alerts; an MDE alert suppression rule scoped to the process tree is what stops incidents being created. Plus: check for the "Block executable files from running unless they meet a prevalence, age, or trusted list criterion" ASR rule.
  7. Computer use: decide before you deploy — an explicit pre-deployment warning. On a monitored endpoint, an alert reading "Screenshots were taken unexpectedly on this device" is not something a SOC dismisses on sight.

Why

The incident set is real, recent, and reproducible-by-construction: nothing about it was a misconfiguration, and every alert was an accurate description of code we deliberately wrote. Two audiences needed something written down.

Engineers, so the next -EncodedCommand or per-operation spawn loop gets weighed against its detection cost before it ships. Several of the individual sites are being addressed in parallel changes; this doc is the standing posture, not a changelog, and it says so — it does not assert that any site has already changed.

Administrators, because the obvious remediation is the wrong one. Adding Orca's directories to Defender AV path exclusions and expecting the incidents to stop does not work: these are MDE EDR behavioural alerts, and path exclusions do not suppress them the way they suppress scan detections. Without this written down, an enterprise rollout produces open incidents nobody knows how to close, and the computer-use feature in particular generates a Collection-tactic incident that lands on a SOC with no context.

Two framing constraints the doc holds to deliberately: Defender is not malfunctioning — it is describing the code accurately — and Orca is not malware. These are legitimate capabilities whose behavioural signature overlaps with attack techniques.

Linked Issue

N/A — no tracking issue; this documents an externally reported incident set.

Visual Proof

N/A — documentation only, no UI or runtime behaviour changes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Docs-only change, so there is no behaviour to test:

  • node config/scripts/check-changed-code-quality.mjs → "no changed JavaScript or TypeScript since origin/main".
  • Verified every relative Markdown link in the new doc and in AGENTS.md resolves to a file on disk.
  • Confirmed the repo has no Markdown linter or docs link-checker in pnpm lint or CI (oxfmt is JS/TS only; the remark-* dependencies are renderer runtime, not tooling), so there is no docs lint to run.
  • Verified docs/reference/windows-edr-posture.md is no longer ignored after the .gitignore allowlist entry.

No automated tests: the change adds no code paths.

AI Disclosure

Internal contributor — section not applicable.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: the doc describes Orca's own detection surface and how to configure suppression for it; it contains no credentials, no exploit, and names no customer, tenant, or individual. Cross-platform: Windows-scoped, no effect on macOS/Linux. Remote SSH, Mobile, backwards compatibility, performance: unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Update — review corrections (617c725)

Blocking 1 & 2 — the PowerShell flag inventory was wrong and incomplete. It listed five files under "encoded, policy-bypassing PowerShell", but system-fonts.ts uses -Command and desktop-script-provider-bridge.ts uses -File — both spell the bypass only, never -EncodedCommand. It also omitted windows-interactive-login-spawn.ts (bypass + encoded) and windows-mobile-firewall.ts, which encodes a script and launches it elevated via Start-Process -Verb RunAs — a stronger shape than anything the paragraph named. Replaced with three explicitly separated tiers (bypass + encoding / encoding alone / bypass alone), regenerated and verified against rg -- '-EncodedCommand|-ExecutionPolicy' src/.

One addition beyond the reviewer's list: the doc now warns that a raw grep under-reports. installer-utils.ts and hook-settings.ts reach -EncodedCommand through wrapWindowsPowerShellEncodedCommand and never spell the flag, so they don't appear in that rg at all. Anyone regenerating the list from the suggested command would drop them.

Non-blocking 3 & 4. Re-attributed the in-payload Set-ExecutionPolicy move to #16576; #16003's measured denial keyed on -WindowStyle Hidden + -EncodedCommand, not on the bypass. Added the launcher's own caveat — dropping -WindowStyle Hidden was a tradeoff whose suppression "was never measured" and "remains unverified on a real box" — since the doc sets that honesty standard for itself.

5. Timing figures now carry their conditions: p50, Windows 11, 1050 processes.

6 (operationally load-bearing). The admin suppression-rule guidance now covers two ways an exact-path rule misses real activity: materialization stages into a <version>.staging-<hex> sibling before the rename, so a version-pinned rule misses the tree mid-update — exactly when incidents A/B/C fire — and the root falls back to Electron's userData when LOCALAPPDATA is unset. Recommends a prefix match on …\Orca\daemon-host\.

8. Deleted the duplicated AGENTS.md section; kept the indexed bullet, with a short clause carrying the signing-is-not-the-gate point.

9. "No data on Hermes" now says the gap is telemetry, not surface — hermes-startup-query.ts does spell -EncodedCommand.

7 and 10 (optional, both taken). Noted that the uninstaller names are electron-builder-generated and appear in no repo file; dropped the volatile line count on runtime.ps1.

Computer-use accuracy. Added a paragraph noting that a persistent runtime host removes the bottom two rows of that table (per-operation MSIL recompilation and the interpreter burst), framed as in flight and unmerged, with a pointer to check the code rather than the paragraph. Screen capture and SendInput are called out as inherent to the feature and unaffected by any refactor.

Re-verified: check-changed-code-quality.mjs → no changed JS/TS; all relative Markdown links resolve; all 31 repo file paths cited in the doc exist on disk.

Six Microsoft Defender for Endpoint incidents fired against Orca 1.4.192 in
eight days on one enterprise Windows 11 / Intune tenant. All six were
behavioural process-tree scoring, not signature hits; two escalated to
multi-stage incidents mapped to ATT&CK Execution and Collection.

Add a reference doc mapping each attack-technique-shaped behaviour to the code
that produces it and to why it exists: the renamed daemon image (T1036), the
per-process PEB read, encoded policy-bypassed PowerShell (T1049), caret-escaped
cmd.exe lines, and computer-use screen capture plus runtime-compiled MSIL
(T1113). Records that signing is not the gate -- reputation is signer plus
hash-keyed prevalence -- and carries the two evidence gaps the report noted.

Adds an engineer checklist, deployment guidance for admins (AV path exclusions
do not suppress EDR behavioural alerts; an MDE alert suppression rule does), and
an explicit pre-deployment warning about computer use.
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a Windows EDR reference explaining Orca behaviors that resemble attacker techniques and indexes it from the repository guidance. It also allowlists the new tracked reference document.

  • Documents observed Defender incident clusters and maps them to current Windows implementation behavior.
  • Adds engineering guidance intended to reduce EDR-sensitive process shapes.
  • Adds administrator guidance for alert suppression, AV exclusions, ASR configuration, and computer-use deployments.

Confidence Score: 2/5

This PR should not merge until the incomplete suppression recipe and unsafe directory-level AV-exclusion guidance are corrected.

Administrators following the document can leave multiple named incident clusters unsuppressed, while the recommended scan exclusions create a security blind spot in user-writable application directories.

Files Needing Attention: docs/reference/windows-edr-posture.md

Security Review

The recommended directory-level AV exclusions cover user-writable LOCALAPPDATA trees, allowing unrelated or replaced payloads placed beneath those directories to evade scan detection. The guidance should warn about this boundary and prescribe the narrowest safely enforceable scope. How this was verified: Repository code creates and writes the relocated daemon beneath the current user's LOCALAPPDATA, while the new document explicitly says its recommended path exclusions suppress scan detections.

Important Files Changed

Filename Overview
docs/reference/windows-edr-posture.md Adds a detailed EDR posture reference, but its primary suppression recipe omits several documented incident processes and its AV-exclusion advice broadens trust over user-writable directories.
AGENTS.md Correctly indexes the new Windows EDR guidance and summarizes the implementation shapes engineers should reconsider.
.gitignore Narrowly allowlists the new reference document under the otherwise ignored docs tree.

Reviews (1): Last reviewed commit: "docs(windows): document the EDR signal s..." | Re-trigger Greptile

Comment on lines +273 to +276
actually produced. Take the titles from your own incidents rather than from
this list.
- **File paths** — `Orca.exe` and `orca-terminal-daemon.exe` under
`%LOCALAPPDATA%\Programs\orca\` and `%LOCALAPPDATA%\Orca\daemon-host\`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Suppression recipe omits incident processes

When an administrator follows this recipe for the documented update or computer-use incidents, the rule conditions cover only Orca.exe and orca-terminal-daemon.exe, excluding the updater/uninstaller processes and computer-use PowerShell tree identified earlier. Incidents A–C and E–F therefore continue being created despite applying the documented remediation.

Comment on lines +282 to +285
Add AV path exclusions for those two directories as well — they cut scan cost on
a tree that is rewritten on every update — but understand the division of
labour. The exclusions reduce scanning; **the suppression rule is what stops
incidents being created.**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Exclusions cover user-writable directories

If a local process or compromised user writes another payload beneath these per-user LOCALAPPDATA directories, the recommended directory-level AV exclusions suppress scan detection for that payload as well as Orca. Warn administrators about this boundary and prescribe the narrowest safely enforceable exclusion scope.

How this was verified: Repository code creates and writes the relocated daemon beneath the current user's LOCALAPPDATA, while this guidance states that the recommended path exclusions suppress scan detections.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ One minor precision nit inline — otherwise this is a thorough, accurately-sourced reference doc.

Reviewed changes

  • docs/reference/windows-edr-posture.md — new reference doc mapping Orca's Windows behaviours that behavioural EDR scores as attack-technique-shaped (daemon image rename, per-process memory reads, encoded policy-bypassed PowerShell, caret-escaped cmd.exe /c, computer-use screen capture / synthetic input / runtime MSIL) to the code that produces them, with engineer and administrator guidance.
  • AGENTS.md — adds a ## Windows EDR Signal Surface consideration and a one-line cross-platform bullet linking the new doc.
  • .gitignore — allowlists the new tracked reference doc under the existing docs/** ignore.

I verified the load-bearing claims against source: the daemon relocation comment and daemon-host-uninstall.nsh guard, the process-table Memory | CommandLine | CreationTime flags and OpenProcess/PEB cost, the exact -ExecutionPolicy Bypass -EncodedCommand spellings in windows-port-scan.ts / ssh-remote-powershell.ts / setup-agent-sequencing.ts / windows-cmd-runner-delayed-launch.ts, the WINDOWS_POWERSHELL_HOOK_SWITCHES = '-NoProfile' reduction, buildWindowsCmdShimCommandLine's /d /v:off /s /c + caret escaping, runtime.ps1 (1321 lines, Add-Type, SendInput, CopyFromScreen), the signing config, and the three reg.exe sites. All check out.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment thread docs/reference/windows-edr-posture.md Resolved
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Windows EDR posture reference document covering observed MDE incidents, process and PowerShell signals, reputation behavior, engineering alternatives, administrator suppression guidance, and computer-use deployment decisions. Updates AGENTS.md with related Windows EDR guidance. Updates .gitignore so the new reference document remains tracked.

Merge Risk: 🟡 Moderate · up to 4866f

The PR adds Windows EDR guidance, but the current documentation still risks encouraging overly broad AV exclusions that do not stop behavioral alerts, and it contains smaller accuracy, synchronization, and formatting issues. Merge should wait for correction or explicit owner acceptance of these bounded risks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: Windows EDR signal-surface documentation.
Description check ✅ Passed The description is substantially complete and follows the repository template. It explains the change, rationale, testing, scope, and review considerations. The Linked Issue field is marked N/A with a…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is substantially complete and follows the repository template. It explains the change, rationale, testing, scope, and review considerations. The Linked Issue field is marked N/A with an explanation because the PR documents an externally reported incident set.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: a03480ce-6725-403c-9741-b40ae367a47a

📥 Commits

Reviewing files that changed from the base of the PR and between e7f1536 and 6b8eccd.

📒 Files selected for processing (3)
  • .gitignore
  • AGENTS.md
  • docs/reference/windows-edr-posture.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread AGENTS.md Outdated
- **Windows setup scripts**: the setup/issue-command runner is a `.cmd` batch file unless the script starts with a `#!` line — never derive that from the user's terminal-shell preference, and never launch a `.cmd` runner with a bare `cmd.exe /c` from a Git Bash pane (MSYS rewrites the `/c`). See [`docs/reference/windows-setup-shell.md`](./docs/reference/windows-setup-shell.md).
- **Windows child processes**: start them through `runProcess`/`spawnProcess` in `src/shared/child-process/` — never `child_process` directly. It pins `windowsHide`, refuses `shell: true`, and encodes `.cmd`/`.bat` arguments so neither `CommandLineToArgvW` nor `cmd.exe` mangles them. A ratchet test fails on any new direct import.
- **Windows process enumeration**: read the table through `src/main/windows/windows-process-table.ts`, never by forking `powershell.exe`. See [`docs/reference/windows-process-enumeration.md`](./docs/reference/windows-process-enumeration.md).
- **Windows EDR signal**: don't add `-ExecutionPolicy Bypass`, `-EncodedCommand`, `cmd.exe /c` with escaped free text, per-operation interpreter spawning, or runtime `Add-Type` compilation without reading [`docs/reference/windows-edr-posture.md`](./docs/reference/windows-edr-posture.md) first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the guidance source before regenerating AGENTS.md.

These additions are inside synchronized root guidance blocks. A later sync can overwrite direct edits to AGENTS.md. Add the Windows EDR guidance to vibe-kit/ai-doc/references/agents-core.md, then regenerate both root files with node vibe-kit/ai-doc/scripts/sync-agents-core.cjs.

Based on learnings: “Do not propose or apply direct edits to the synchronized guidance blocks in the root AGENTS.md or CLAUDE.md files, because they are generated outputs.”

Also applies to: 56-58

Source: Learnings

Comment on lines +144 to +147
The escaping is not decorative. Measured on Windows 11 against a real `.cmd`
shim, `["a b", 'c"d', "e%F%g", "h&i", "j^k"]` came back as `["a b", 'c"d',
"e^%F^%g", "h"]` — the `&` truncated the argument *and* ran the remainder as a
command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- documentation context ---'
sed -n '130,155p' docs/reference/windows-edr-posture.md
printf '%s\n' '--- helper definition and direct tests ---'
rg -n -A80 -B15 'function buildWindowsCmdShimCommandLine|const buildWindowsCmdShimCommandLine|buildWindowsCmdShimCommandLine' src/shared/child-process

Repository: stablyai/orca

Length of output: 33238


🏁 Script executed:

#!/bin/bash
sed -n '1,82p' src/shared/child-process/windows-command-line.ts
printf '%s\n' '--- argument corpus ---'
cat -n src/shared/child-process/__fixtures__/windows-argument-corpus.ts

Repository: stablyai/orca

Length of output: 6148


Mark the .cmd injection result as historical.

The current command-line encoder and regression corpus cover this case. Add the Windows version or commit that produced the measurement.

Comment on lines +267 to +269
An **MDE alert suppression rule** scoped to the process tree. Build it in
Microsoft 365 Defender (Settings → Endpoints → Alert suppression), conditioned
on:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

printf '%s\n' '--- applicable repository guidance ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target context ---'
sed -n '250,280p' docs/reference/windows-edr-posture.md

Repository: stablyai/orca

Length of output: 4603


🌐 Web query:

site:learn.microsoft.com Microsoft Defender XDR custom detection rules Alert tuning Hide alert incident creation Settings Microsoft Defender XDR Alert tuning

💡 Result:

In Microsoft Defender XDR, tuning alerts and managing incident creation involves different mechanisms depending on your goal: suppressing future alerts, modifying correlation behavior, or preventing incident generation. Alert Tuning and Suppression To tune alerts and suppress noise, you can use the Tune alert feature [1]. This allows you to define specific conditions under which alerts are automatically handled. 1. Navigate to the Alerts page or the specific alert details page in the Microsoft Defender portal [1]. 2. Select Tune alert [1]. Depending on your screen resolution, you may need to click the ellipsis (...) to find this option [1]. 3. In the Tune alert pane, you can define conditions (such as specific files, IPs, or other metadata) [1]. 4. In the Action area, select Hide alert, Resolve alert, or Set as behavior [1]. Choosing Hide alert effectively suppresses the alert for the specified conditions [1]. Managing Incident Correlation Defender XDR automatically correlates alerts into incidents [2]. You can manage how these analytics rules interact with the incident creation process: - Correlation State: You can include or exclude specific analytics rules from automatic correlation by using the correlation settings [3]. Setting this to Disabled prevents a rule from being part of the correlation logic [3]. This can also be done manually by adding the #INC_CORR# (include) or #DONT_CORR# (exclude) tag at the beginning of the rule's description [3]. - Incident Creation: If you are using Microsoft Sentinel alongside Defender XDR, be aware that alerts generated by custom detection rules in the Defender XDR portal will typically trigger incidents in Sentinel [4]. There is no direct "disable incident creation" toggle for individual custom detection rules in the XDR portal; however, you can manage incident settings in the Sentinel workspace if the alerts are being pulled into Sentinel via data connectors [4]. Custom Permissions Managing these settings requires specific permissions [5]. Ensure your account has the Detection tuning permission, which allows you to manage custom detections, alert tuning, and threat indicators [5]. Summary of Key Mechanisms Action | Mechanism --- | --- Suppress future alerts | Use Tune alert (Action: Hide alert) [1] Control incident grouping | Use Analytics rule correlation settings (#INC_CORR# / #DONT_CORR# tags) [3] Stop Sentinel incident generation | Manage incident creation rules within the Sentinel workspace [4] For more advanced management, you can also interact with these settings programmatically via the Microsoft Defender XDR API [3].

Citations:


Security Misconfiguration (CWE-16)

Update the MDE alert-tuning guidance.

Use Settings > Microsoft Defender XDR > Alert tuning and specify the Hide alert action. State that it prevents incident creation only for alerts matching the configured conditions.

Comment on lines +282 to +285
Add AV path exclusions for those two directories as well — they cut scan cost on
a tree that is rewritten on every update — but understand the division of
labour. The exclusions reduce scanning; **the suppression rule is what stops
incidents being created.**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

printf '%s\n' '--- relevant repository guidance ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target context ---'
sed -n '250,300p' docs/reference/windows-edr-posture.md

Repository: stablyai/orca

Length of output: 5566


🏁 Script executed:

printf '%s\n' '--- repository-wide conventions ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/repo-wide.md
printf '%s\n' '--- repository-wide learnings ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings/repo-wide.md

Repository: stablyai/orca

Length of output: 2899


🌐 Web query:

Microsoft Defender Antivirus exclusions lower protection excluded files can still trigger EDR alerts official documentation

💡 Result:

Yes, Microsoft Defender Antivirus exclusions do not apply to Endpoint Detection and Response (EDR) [1][2]. According to official Microsoft documentation, configuring exclusions for Microsoft Defender Antivirus—such as file, folder, process, or extension exclusions—only impacts antivirus scanning features, including scheduled scans, on-demand scans, real-time protection, and potentially unwanted app (PUA) detections [1][2][3]. Because these exclusions do not extend to other capabilities within Microsoft Defender for Endpoint, files that have been excluded from antivirus scanning can still trigger EDR alerts and generate behavioral or heuristic detections [1][2][4]. To exclude files more broadly across all Microsoft Defender for Endpoint capabilities, Microsoft recommends using custom indicators (specifically "Allow" indicators) rather than standard antivirus exclusions [1][5][2]. Using exclusions should be done sparingly, as every exclusion represents a security gap that reduces the protection level of the device [2][4][6]. An exception to note is that if you are using EDR in block mode (where Microsoft Defender Antivirus is in passive mode), the EDR engine generally respects defined antivirus exclusions [7]. However, for standard deployments where Defender Antivirus is active, the separation between antivirus exclusions and EDR monitoring remains [1][2].

Citations:


Security Misconfiguration (CWE-16)

Do not recommend recursive AV exclusions by default.

The alert suppression rule is the control for MDE incidents. Make AV exclusions conditional on a measured scan-cost problem and scope them to the narrowest required paths. Recursive exclusions for %LOCALAPPDATA%\Programs\orca\ and %LOCALAPPDATA%\Orca\daemon-host\ reduce AV protection for executable content without suppressing EDR behavioral alerts.

Comment on lines +318 to +320
organisation that monitors for Collection-tactic activity — and any organisation
running MDE with default incident creation does — will see it, and will see it
as Collection.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Limit the computer-use claim to the observed evidence.

Lines 223-224 state that the evidence covers one tenant and one policy configuration. Lines 318-320 then state that any organization running MDE with default incident creation will see and classify this activity as Collection. Replace the universal claim with tenant- and policy-dependent wording such as “may see it.”

Review corrections to the EDR posture doc.

The "encoded, policy-bypassing PowerShell" list conflated three different
shapes and was incomplete. Split it into the three tiers an EDR actually scores
differently -- bypass plus encoding, encoding alone, and bypass alone -- and add
the sites it missed, including windows-mobile-firewall.ts, which encodes a
script and launches it elevated through Start-Process -Verb RunAs. system-fonts.ts
(-Command) and desktop-script-provider-bridge.ts (-File) were listed as encoded
and are not. Notes that a raw grep under-reports, because the hook sites reach
-EncodedCommand through wrapWindowsPowerShellEncodedCommand.

Attribute the in-payload Set-ExecutionPolicy move to #16576 rather than to
#16003's measurement, which keyed on -WindowStyle Hidden + -EncodedCommand, and
record that the launcher's own tradeoff is unverified on a real box.

Admin guidance was missing two ways a suppression rule pinned to one full path
misses real activity: the .staging-<hex> sibling that exists mid-update, which
is when the update-cluster incidents fire, and the userData fallback when
LOCALAPPDATA is unset.

Also: state the measurement conditions on the process-table timings, note that
Hermes has surface even though we have no telemetry for it, note that the
uninstaller names are electron-builder-generated and in no repo file, drop a
volatile line count, and mark the per-operation computer-use shape as being
addressed by an unmerged change. Drops the duplicated AGENTS.md section, keeping
the indexed bullet.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 89e83433-e92c-48a6-a987-9f0e196baf75

📥 Commits

Reviewing files that changed from the base of the PR and between 6b8eccd and 617c725.

📒 Files selected for processing (2)
  • AGENTS.md
  • docs/reference/windows-edr-posture.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

`-EncodedCommand` was denied at `CreateProcess` with exit 126 regardless of
payload — `exit 0` was denied too. The fix was to stop *spelling* the flags:
`WINDOWS_POWERSHELL_HOOK_SWITCHES` is now just `-NoProfile`, and separately, in
#16576, the execution policy bypass moved in-payload as a process-scope

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Avoid a line-start # for the issue reference.

#16576 triggers the reported markdownlint MD018 warning. Keep the reference inline or prefix it with issue.

Proposed fix
-#16576, the execution policy bypass moved in-payload as a process-scope
+issue `#16576`, the execution policy bypass moved in-payload as a process-scope
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#16576, the execution policy bypass moved in-payload as a process-scope
issue #16576, the execution policy bypass moved in-payload as a process-scope
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 156-156: No space after hash on atx style heading

(MD018, no-missing-space-atx)

Source: Linters/SAST tools

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ One precision nit inline — the corrections in this delta are otherwise accurate and well-sourced.

Reviewed changes

  • Split the PowerShell flag inventory into three tiers — bypass+encoded, encoded-only, and bypass-only — adding windows-interactive-login-spawn.ts, the elevated windows-mobile-firewall.ts Start-Process -Verb RunAs shape, and a regenerate-with-rg caveat.
  • Re-attributed the hook-launcher history — the in-payload Set-ExecutionPolicy move is now credited to #16576, with #16003's measured denial keyed on -WindowStyle Hidden + -EncodedCommand rather than the bypass, plus the launcher's own "never measured / unverified on a real box" caveat.
  • Added timing conditions to the process-table figures — p50, Windows 11, 1050 processes.
  • Expanded the admin suppression-rule guidance — the staging-<hex> sibling and the userData fallback when LOCALAPPDATA is unset, recommending a prefix match on …\Orca\daemon-host\.
  • Tightened incidental claims — electron-builder-generated uninstaller names, the Hermes gap framed as telemetry rather than surface, and the volatile runtime.ps1 line count dropped.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏


Regenerate with `rg -- '-EncodedCommand|-ExecutionPolicy' src/` rather than
trusting the lists above, and note that a raw grep under-reports: the hook sites
reach `-EncodedCommand` through `wrapWindowsPowerShellEncodedCommand` and never

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The "never spell the flag themselves" claim is too broad: runtime-home-hook-command.ts (listed as a hook wrapper just above) spells -EncodedCommand directly in its own template and uses encodeWindowsPowerShellHookCommand, not wrapWindowsPowerShellEncodedCommand. Only hook-settings.ts actually reaches the flag purely through the wrapper, and installer-utils.ts still contains the literal in its decode regex (line 92), so rg -- '-EncodedCommand' finds it there too. Worth narrowing the caveat to hook-settings.ts.

…tion

Three claims in this doc became false once the rest of the Windows EDR set
landed, and two told engineers the opposite of what the release does.

The process-table section still described one shared snapshot taken with
`Memory | CommandLine | CreationTime`, argued that splitting the cache per
field set "would restore exactly the fan-out it exists to prevent", and
concluded the shape was unfixable because "the information is only in the
PEB". The split shipped (identity opens no handle at all), `Memory` is
retired, and the command line now comes from the kernel through
`ProcessCommandLineInformation` -- `ReadProcessMemory` is absent from the
compiled addon and a ratchet asserts it against the import table. An engineer
reading the old text would have concluded both fixes were dead ends.

The PowerShell site inventories were stale in three of four lists: the port
scan went native, every `-ExecutionPolicy Bypass` + `-EncodedCommand` pair
was dropped as a measured no-op, and of the unencoded-bypass list only
`wsl-cli-scripts.ts` survives. Regenerated against the merged tree, including
the sites that reach the flag through `wrapWindowsPowerShellEncodedCommand`
and never spell it, which a raw `rg` misses.

Incident-evidence sections are left alone: they record what the tenant observed
on 1.4.192, not what the code does now.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: aca8f4cb-d9e4-48a9-b7d9-6aaa43afb61c

📥 Commits

Reviewing files that changed from the base of the PR and between 617c725 and 4866ff7.

📒 Files selected for processing (1)
  • docs/reference/windows-edr-posture.md

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

then spawns shells, matches the textbook description closely enough that no
behavioural engine can be expected to score it low.

### Every process gets a handle, on a timer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the heading with the collection modes.

The heading says every process gets a handle. The section states that identity snapshots open no handle and only detailed CommandLine snapshots open one handle per process. Rename the heading so it does not overstate the current handle and EDR exposure.

Proposed fix
-### Every process gets a handle, on a timer
+### Detailed process snapshots may open one handle per process
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Every process gets a handle, on a timer
### Detailed process snapshots may open one handle per process

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

This delta rewrites the doc to describe remediations as shipped, but none of them exist on main — origin/main (4efc86a) still contains every behaviour the previous revision correctly labelled "in flight". The reference doc now asserts a future state as current fact, which is exactly the trap its own "Guidance for engineers" section warns against.

Reviewed changes

  • Reconciled the doc against an assumed remediation — rewrote the process-table section (Memory retired, command line via NtQueryInformationProcess), the PowerShell inventory ("No site spells the pair any more", netstat.exe as the primary port scan), and the computer-use launch line (RemoteSigned with a Bypass retry).

⚠️ The "shipped remediation" is not on main

This revision reconciles against code that has not landed. The specific false claims are anchored inline, but the ordering is the thing to resolve: either the remediation PRs merge first and this doc lands after (re-verified against the merged code), or the doc reverts to the "in flight, check the code" framing it still uses later in the same file. Shipping it as-is publishes a standing reference asserting, as fact, a process-tree shape that does not yet exist.

Technical details
# Remediation described as shipped is absent from main

## Affected sites
- docs/reference/windows-edr-posture.md:73-109 — process table claims
- docs/reference/windows-edr-posture.md:115-159 — PowerShell flag inventory claims
- docs/reference/windows-edr-posture.md:221-226 — computer-use launch line

## Required outcome
- Reconcile the doc against the actual state of `main`, or land it only after the remediation PRs merge and every "shipped" claim is re-verified against the merged source.

## Open questions for the human (optional)
- Which remediation PRs does this doc assume are merged? Are they open, and what is their merge ordering relative to this doc?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

**How an EDR reads it:** a cross-process handle plus a remote memory read against
every process on the box, repeating on a cadence, is the read half of the
telemetry that credential dumping and process injection produce. MDE surfaced it
as "suspicious memory activity". The memory read is gone: the command line now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not true on main. src/main/windows/windows-process-table.ts:199-202 still requests Memory | CommandLine | CreationTime, and its comment (lines 193-198) still says the command line is a PEB read and Memory a GetProcessMemoryInfo call. There is no NtQueryInformationProcess / ProcessCommandLineInformation anywhere in the module, and Memory is not retired.

`Get-NetTCPConnection -State Listen` script to find dev-server ports.
Enumerating listening ports is **MITRE T1049**, network service discovery, and
doing it through an encoded policy-bypassed shell is the aggravating factor
rather than the finding itself. The ordinary scan now starts no PowerShell at

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inverted against main. src/relay/windows-port-scan.ts:14-33 runs runWindowsPortScanPowerShell first (still -ExecutionPolicy Bypass -EncodedCommand, line 62); netstat.exe -ano is the fallback path (line 22), not the primary, and the fallback does not exist as -Command with no policy override.

bootstrap.
- `src/main/agent-hooks/windows-powershell-hook-launcher.ts` wraps managed hooks.

**No site spells the pair any more.** `src/main/ssh/ssh-remote-powershell.ts`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not true on main. All four named sites still spell the pair: ssh-remote-powershell.ts:8, setup-agent-sequencing.ts:268, windows-cmd-runner-delayed-launch.ts:37, and windows-interactive-login-spawn.ts:84-86 each still emit -ExecutionPolicy Bypass -EncodedCommand.

file, so the switch is not a no-op there). `src/main/system-fonts.ts` dropped it
for plain `-Command`; `src/shared/secure-path-windows-acl.ts` no longer runs
PowerShell at all, having moved to `icacls.exe`; and computer use now asks for
`-ExecutionPolicy RemoteSigned` in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not true on main. desktop-script-provider-bridge.ts:19-21 still launches runtime.ps1 with -ExecutionPolicy Bypass -File, src/main/computer/windows-powershell-execution-policy.ts does not exist (no file matches), and rg RemoteSigned src/ returns nothing. The adjacent claims are wrong too: system-fonts.ts:92 still spells -ExecutionPolicy Bypass -Command, and secure-path-windows-acl.ts:14-16 still runs powershell.exe rather than icacls.exe.

@OrcaWin
OrcaWin merged commit 2c4989e into main Sep 2, 2026
28 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Sep 3, 2026
* docs(windows): document the EDR signal surface

Six Microsoft Defender for Endpoint incidents fired against Orca 1.4.192 in
eight days on one enterprise Windows 11 / Intune tenant. All six were
behavioural process-tree scoring, not signature hits; two escalated to
multi-stage incidents mapped to ATT&CK Execution and Collection.

Add a reference doc mapping each attack-technique-shaped behaviour to the code
that produces it and to why it exists: the renamed daemon image (T1036), the
per-process PEB read, encoded policy-bypassed PowerShell (T1049), caret-escaped
cmd.exe lines, and computer-use screen capture plus runtime-compiled MSIL
(T1113). Records that signing is not the gate -- reputation is signer plus
hash-keyed prevalence -- and carries the two evidence gaps the report noted.

Adds an engineer checklist, deployment guidance for admins (AV path exclusions
do not suppress EDR behavioural alerts; an MDE alert suppression rule does), and
an explicit pre-deployment warning about computer use.

* docs(windows): correct the PowerShell flag inventory and admin paths

Review corrections to the EDR posture doc.

The "encoded, policy-bypassing PowerShell" list conflated three different
shapes and was incomplete. Split it into the three tiers an EDR actually scores
differently -- bypass plus encoding, encoding alone, and bypass alone -- and add
the sites it missed, including windows-mobile-firewall.ts, which encodes a
script and launches it elevated through Start-Process -Verb RunAs. system-fonts.ts
(-Command) and desktop-script-provider-bridge.ts (-File) were listed as encoded
and are not. Notes that a raw grep under-reports, because the hook sites reach
-EncodedCommand through wrapWindowsPowerShellEncodedCommand.

Attribute the in-payload Set-ExecutionPolicy move to stablyai#16576 rather than to
stablyai#16003's measurement, which keyed on -WindowStyle Hidden + -EncodedCommand, and
record that the launcher's own tradeoff is unverified on a real box.

Admin guidance was missing two ways a suppression rule pinned to one full path
misses real activity: the .staging-<hex> sibling that exists mid-update, which
is when the update-cluster incidents fire, and the userData fallback when
LOCALAPPDATA is unset.

Also: state the measurement conditions on the process-table timings, note that
Hermes has surface even though we have no telemetry for it, note that the
uninstaller names are electron-builder-generated and in no repo file, drop a
volatile line count, and mark the per-operation computer-use shape as being
addressed by an unmerged change. Drops the duplicated AGENTS.md section, keeping
the indexed bullet.

* docs(windows): reconcile the EDR posture doc with the shipped remediation

Three claims in this doc became false once the rest of the Windows EDR set
landed, and two told engineers the opposite of what the release does.

The process-table section still described one shared snapshot taken with
`Memory | CommandLine | CreationTime`, argued that splitting the cache per
field set "would restore exactly the fan-out it exists to prevent", and
concluded the shape was unfixable because "the information is only in the
PEB". The split shipped (identity opens no handle at all), `Memory` is
retired, and the command line now comes from the kernel through
`ProcessCommandLineInformation` -- `ReadProcessMemory` is absent from the
compiled addon and a ratchet asserts it against the import table. An engineer
reading the old text would have concluded both fixes were dead ends.

The PowerShell site inventories were stale in three of four lists: the port
scan went native, every `-ExecutionPolicy Bypass` + `-EncodedCommand` pair
was dropped as a measured no-op, and of the unencoded-bypass list only
`wsl-cli-scripts.ts` survives. Regenerated against the merged tree, including
the sites that reach the flag through `wrapWindowsPowerShellEncodedCommand`
and never spell it, which a raw `rg` misses.

Incident-evidence sections are left alone: they record what the tenant observed
on 1.4.192, not what the code does now.

---------

Co-authored-by: Orca Worker <orca-worker@localhost>

Mirror-Of: 2c4989e
OrcaWin pushed a commit that referenced this pull request Sep 6, 2026
…n-host-materialization

Conflicts, and how each was resolved:

- config/nsis/daemon-host-uninstall.nsh: main deleted it (#17906 consolidated
  every NSIS hook into config/nsis/orca-installer-hooks.nsh, because
  electron-builder accepts exactly one `nsis.include`). Took the deletion; the
  rewritten uninstall macro is ported into the hooks file in the next commit.
  Doc references repointed at the surviving file.

- docs/reference/windows-edr-posture.md: add/add. This branch's base (#17856)
  squash-landed on main, and #18151 then corrected several process-table claims
  there. Took main's corrected text and re-applied only this branch's
  daemon-host edits (the rename removal, T1036.005, the spawn-tree line, the
  checklist row).

- .gitignore, AGENTS.md: kept both sides' added lines.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* docs(windows): document the EDR signal surface

Six Microsoft Defender for Endpoint incidents fired against Orca 1.4.192 in
eight days on one enterprise Windows 11 / Intune tenant. All six were
behavioural process-tree scoring, not signature hits; two escalated to
multi-stage incidents mapped to ATT&CK Execution and Collection.

Add a reference doc mapping each attack-technique-shaped behaviour to the code
that produces it and to why it exists: the renamed daemon image (T1036), the
per-process PEB read, encoded policy-bypassed PowerShell (T1049), caret-escaped
cmd.exe lines, and computer-use screen capture plus runtime-compiled MSIL
(T1113). Records that signing is not the gate -- reputation is signer plus
hash-keyed prevalence -- and carries the two evidence gaps the report noted.

Adds an engineer checklist, deployment guidance for admins (AV path exclusions
do not suppress EDR behavioural alerts; an MDE alert suppression rule does), and
an explicit pre-deployment warning about computer use.

* docs(windows): correct the PowerShell flag inventory and admin paths

Review corrections to the EDR posture doc.

The "encoded, policy-bypassing PowerShell" list conflated three different
shapes and was incomplete. Split it into the three tiers an EDR actually scores
differently -- bypass plus encoding, encoding alone, and bypass alone -- and add
the sites it missed, including windows-mobile-firewall.ts, which encodes a
script and launches it elevated through Start-Process -Verb RunAs. system-fonts.ts
(-Command) and desktop-script-provider-bridge.ts (-File) were listed as encoded
and are not. Notes that a raw grep under-reports, because the hook sites reach
-EncodedCommand through wrapWindowsPowerShellEncodedCommand.

Attribute the in-payload Set-ExecutionPolicy move to stablyai#16576 rather than to
stablyai#16003's measurement, which keyed on -WindowStyle Hidden + -EncodedCommand, and
record that the launcher's own tradeoff is unverified on a real box.

Admin guidance was missing two ways a suppression rule pinned to one full path
misses real activity: the .staging-<hex> sibling that exists mid-update, which
is when the update-cluster incidents fire, and the userData fallback when
LOCALAPPDATA is unset.

Also: state the measurement conditions on the process-table timings, note that
Hermes has surface even though we have no telemetry for it, note that the
uninstaller names are electron-builder-generated and in no repo file, drop a
volatile line count, and mark the per-operation computer-use shape as being
addressed by an unmerged change. Drops the duplicated AGENTS.md section, keeping
the indexed bullet.

* docs(windows): reconcile the EDR posture doc with the shipped remediation

Three claims in this doc became false once the rest of the Windows EDR set
landed, and two told engineers the opposite of what the release does.

The process-table section still described one shared snapshot taken with
`Memory | CommandLine | CreationTime`, argued that splitting the cache per
field set "would restore exactly the fan-out it exists to prevent", and
concluded the shape was unfixable because "the information is only in the
PEB". The split shipped (identity opens no handle at all), `Memory` is
retired, and the command line now comes from the kernel through
`ProcessCommandLineInformation` -- `ReadProcessMemory` is absent from the
compiled addon and a ratchet asserts it against the import table. An engineer
reading the old text would have concluded both fixes were dead ends.

The PowerShell site inventories were stale in three of four lists: the port
scan went native, every `-ExecutionPolicy Bypass` + `-EncodedCommand` pair
was dropped as a measured no-op, and of the unencoded-bypass list only
`wsl-cli-scripts.ts` survives. Regenerated against the merged tree, including
the sites that reach the flag through `wrapWindowsPowerShellEncodedCommand`
and never spell it, which a raw `rg` misses.

Incident-evidence sections are left alone: they record what the tenant observed
on 1.4.192, not what the code does now.

---------

Co-authored-by: Orca Worker <orca-worker@localhost>
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