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
Sentinel · 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.