Repository navigation
docs(windows): document the EDR signal surface - #17856
Conversation
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 SummaryThis 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.
Confidence Score: 2/5This 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
|
| 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
| 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\`. |
There was a problem hiding this comment.
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.
| 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.** |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
ℹ️ 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-escapedcmd.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 Surfaceconsideration and a one-line cross-platform bullet linking the new doc..gitignore— allowlists the new tracked reference doc under the existingdocs/**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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
📝 WalkthroughWalkthroughAdds 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 Merge Risk: 🟡 Moderate · up to 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)
Full details: Description checkExplanation 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 CoverageExplanation 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: a03480ce-6725-403c-9741-b40ae367a47a
📒 Files selected for processing (3)
.gitignoreAGENTS.mddocs/reference/windows-edr-posture.md
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| - **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. |
There was a problem hiding this comment.
📐 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
| 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. |
There was a problem hiding this comment.
🔒 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-processRepository: 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.tsRepository: 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.
| An **MDE alert suppression rule** scoped to the process tree. Build it in | ||
| Microsoft 365 Defender (Settings → Endpoints → Alert suppression), conditioned | ||
| on: |
There was a problem hiding this comment.
🔒 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.mdRepository: 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:
- 1: https://learn.microsoft.com/en-us/defender-xdr/investigate-alerts
- 2: https://learn.microsoft.com/en-us/defender-xdr/alerts-incidents-correlation
- 3: https://learn.microsoft.com/en-us/defender-xdr/exclude-analytics-rules-correlation
- 4: https://learn.microsoft.com/en-us/answers/questions/1741656/stop-creating-incidents-in-sentinel-for-every-aler
- 5: https://learn.microsoft.com/en-us/defender-xdr/custom-permissions-details
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.
| 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.** |
There was a problem hiding this comment.
🔒 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.mdRepository: 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.mdRepository: 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:
- 1: https://learn.microsoft.com/en-us/defender-endpoint/defender-endpoint-exclusions-overview
- 2: https://learn.microsoft.com/en-us/defender-endpoint/configure-contextual-file-folder-exclusions-microsoft-defender-antivirus
- 3: https://learn.microsoft.com/en-us/defender-endpoint/configure-exclusions-microsoft-defender-antivirus
- 4: https://learn.microsoft.com/en-us/defender-endpoint/microsoft-defender-antivirus-exclusions-overview
- 5: https://learn.microsoft.com/en-us/defender-endpoint/defender-endpoint-false-positives-negatives
- 6: https://learn.microsoft.com/en-us/defender-endpoint/defender-endpoint-exclusions-common-mistakes
- 7: https://learn.microsoft.com/en-us/defender-endpoint/edr-in-block-mode
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.
| 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. |
There was a problem hiding this comment.
🎯 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.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 89e83433-e92c-48a6-a987-9f0e196baf75
📒 Files selected for processing (2)
AGENTS.mddocs/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 |
There was a problem hiding this comment.
📐 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.
| #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
There was a problem hiding this comment.
ℹ️ 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 elevatedwindows-mobile-firewall.tsStart-Process -Verb RunAsshape, and a regenerate-with-rgcaveat. - Re-attributed the hook-launcher history — the in-payload
Set-ExecutionPolicymove is now credited to #16576, with #16003's measured denial keyed on-WindowStyle Hidden+-EncodedCommandrather 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 theuserDatafallback whenLOCALAPPDATAis 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.ps1line count dropped.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: aca8f4cb-d9e4-48a9-b7d9-6aaa43afb61c
📒 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 |
There was a problem hiding this comment.
🎯 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.
| ### Every process gets a handle, on a timer | |
| ### Detailed process snapshots may open one handle per process |
There was a problem hiding this comment.
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 (
Memoryretired, command line viaNtQueryInformationProcess), the PowerShell inventory ("No site spells the pair any more",netstat.exeas the primary port scan), and the computer-use launch line (RemoteSignedwith aBypassretry).
⚠️ 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?
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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`, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
* 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
…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.
* 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>

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.
docs/reference/windows-edr-posture.md— the reference doc.AGENTS.md— a short## Windows EDR Signal Surfaceentry 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:
daemon-host-relocation.ts) → T1036, and why it exists (surviving the NSIS updater'staskkill /IM Orca.exe);OpenProcess+ PEB read (windows-process-table.ts) → "suspicious memory activity", and why it exists ([Bug]: orca-terminal-daemon spawns powershell.exe every ~2s to poll Win32_Process, floods PowerShell Transcription logs under enterprise GPO (unaffected by Resource Manager toggle) #15209's ~289 GB of transcripts, [Bug]: Worktree deletion fails with "Failed to physically stop every PTY" — orphaned claude.exe/node.exe/cmd.exe processes on Windows #9045/[Bug]: Right-click delete fails for Hermes worktrees — PTY process does not respond to SIGTERM #10475, [Bug]: Windows - Agent Session scanning might be making the app laggy #15036's ~700 ms per pane);-ExecutionPolicy Bypass -EncodedCommand(windows-port-scan.ts,shell-ready.ts,windows-powershell-hook-launcher.ts) → T1049 plus "Suspicious PowerShell command line", including [Bug]: Claude Code agent-hooks (claude-hook.cmd) fail with "Permission denied" when invoked by the hook runner #16003's measuredCreateProcessdenial as prior art;cmd.exe /c(windows-command-line.ts) → obfuscated-command-line scoring;runtime.ps1,desktop-script-provider-bridge.ts) → T1113,SendInput, and runtimeAdd-TypeMSIL.windows-process-enumeration.mdandwindows-setup-shell.md.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
-EncodedCommandor 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
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".AGENTS.mdresolves to a file on disk.pnpm lintor CI (oxfmtis JS/TS only; theremark-*dependencies are renderer runtime, not tooling), so there is no docs lint to run.docs/reference/windows-edr-posture.mdis no longer ignored after the.gitignoreallowlist entry.No automated tests: the change adds no code paths.
AI Disclosure
Internal contributor — section not applicable.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand 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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (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.tsuses-Commandanddesktop-script-provider-bridge.tsuses-File— both spell the bypass only, never-EncodedCommand. It also omittedwindows-interactive-login-spawn.ts(bypass + encoded) andwindows-mobile-firewall.ts, which encodes a script and launches it elevated viaStart-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 againstrg -- '-EncodedCommand|-ExecutionPolicy' src/.One addition beyond the reviewer's list: the doc now warns that a raw grep under-reports.
installer-utils.tsandhook-settings.tsreach-EncodedCommandthroughwrapWindowsPowerShellEncodedCommandand never spell the flag, so they don't appear in thatrgat all. Anyone regenerating the list from the suggested command would drop them.Non-blocking 3 & 4. Re-attributed the in-payload
Set-ExecutionPolicymove to #16576; #16003's measured denial keyed on-WindowStyle Hidden+-EncodedCommand, not on the bypass. Added the launcher's own caveat — dropping-WindowStyle Hiddenwas 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'suserDatawhenLOCALAPPDATAis unset. Recommends a prefix match on…\Orca\daemon-host\.8. Deleted the duplicated
AGENTS.mdsection; 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.tsdoes 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
SendInputare 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.