Visual Studio Code CLI starting a remote tunnel
AN0375 pairs the creation of an IDE tunnelling profile with the persistent remote session that follows, and the process-creation half of that pair is a single event: the Visual Studio Code CLI invoked with the `tunnel` verb, which is what registers the machine with the vendor's relay and yields a browser-reachable session over an outbound connection. Both the desktop installation and the standalone CLI are covered, because `code tunnel` on a desktop install delegates to the separate `code-tunnel.exe` shipped beside it and matching only `code.exe` would miss the process that actually holds the tunnel. The same verb covers the persistence variant — `tunnel service install` registers the tunnel to start at logon — so re-registration after a reboot appears here too. The JetBrains Gateway leg of the analytic is deliberately not written: its Windows launcher name varies with the Toolbox installation and a guessed binary name would be a selector that can never fire. MITRE's TunnelDomainPatterns knob applies to the network leg of the strategy, which this event does not carry; corroborate a hit with the `.vscode-cli\code_tunnel.json` profile write (Sysmon EventID 11), the other log source in this analytic. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0133, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
title: Visual Studio Code CLI starting a remote tunnelid: aa430f16-6a4c-4b99-a56b-903194e3f473status: experimentaldescription: | AN0375 pairs the creation of an IDE tunnelling profile with the persistent remote session that follows, and the process-creation half of that pair is a single event: the Visual Studio Code CLI invoked with the `tunnel` verb, which is what registers the machine with the vendor's relay and yields a browser-reachable session over an outbound connection. Both the desktop installation and the standalone CLI are covered, because `code tunnel` on a desktop install delegates to the separate `code-tunnel.exe` shipped beside it and matching only `code.exe` would miss the process that actually holds the tunnel. The same verb covers the persistence variant — `tunnel service install` registers the tunnel to start at logon — so re-registration after a reboot appears here too. The JetBrains Gateway leg of the analytic is deliberately not written: its Windows launcher name varies with the Toolbox installation and a guessed binary name would be a selector that can never fire. MITRE's TunnelDomainPatterns knob applies to the network leg of the strategy, which this event does not carry; corroborate a hit with the `.vscode-cli\code_tunnel.json` profile write (Sysmon EventID 11), the other log source in this analytic. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0133, not hand-written and not tested by its author. Any lab result is on this rule's own page.references: - https://attack.mitre.org/techniques/T1219/001 - https://attack.mitre.org/detectionstrategies/DET0133author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags: - attack.command-and-control - attack.t1219.001logsource: category: process_creation product: windowsdetection: selection_image: Image|endswith: - '\code.exe' - '\code-tunnel.exe' - '\code-insiders.exe' selection_verb: CommandLine|contains: ' tunnel' condition: selection_image and selection_verbfalsepositives: - "Sanctioned remote development. A developer running `code tunnel` to reach their own workstation or a build VM produces exactly this event; on an engineering estate this is the dominant source of matches and only the account and the host it runs on separate it from abuse, which is what MITRE's AuthorizedUserList knob is for." - "The tunnel service restarting. Once `tunnel service install` has been run legitimately, every logon re-launches the CLI with the same verb, so one approved setup keeps generating events indefinitely." - "Support and lab automation that stands up a tunnel into a short-lived test or demo machine as part of provisioning, run by IT rather than by the machine's user."level: mediumSentinel · KQL
Run this as a search.
DeviceProcessEvents| where ((FolderPath endswith "\\code.exe" or FolderPath endswith "\\code-tunnel.exe" or FolderPath endswith "\\code-insiders.exe") and ProcessCommandLine contains " tunnel")
Splunk · SPL
Run this as a search.
index=* ((Image="*\\code.exe" OR Image="*\\code-tunnel.exe" OR Image="*\\code-insiders.exe") AND CommandLine="* tunnel*")Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*\\\\code.exe" OR TO_LOWER(process.executable) LIKE "*\\\\code-tunnel.exe" OR TO_LOWER(process.executable) LIKE "*\\\\code-insiders.exe") AND TO_LOWER(process.command_line) LIKE "* tunnel*")
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\code\.exe$|\\code-tunnel\.exe$|\\code-insiders\.exe$)</field> <field name="CommandLine" type="pcre2">(?i) tunnel</field> <description>Visual Studio Code CLI starting a remote tunnel</description> <mitre> <id>T1219.001</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.