Skip to content

Extend interpreter/PowerShell network detection (more languages) #2

Description

@MalyStern

Summary

NoNet now catches interpreter one-liners and PowerShell web cmdlets, not just curl/wget (see reaches_network in the guard). The keyword lists that power it can be broadened to close more of the obvious gaps.

The task

In daemon/src/guard.rs, extend two regexes:

  • RE_NET_TOKEN — network capabilities that appear inside an interpreter one-liner. Candidates to add: Go's http.Get/http.Post/net/http, Java's URL(...).openConnection/HttpClient, HttpURLConnection, System.Net.Http.
  • RE_PS_NET — PowerShell network cmdlets. Candidates: Test-NetConnection, System.Net.WebRequest, [System.Net.Http.HttpClient].

Keep them anchored (word boundaries) so they don't over-match ordinary prose. Remember this is a documented heuristic, not a sandbox — the goal is to close obvious holes, not to be exhaustive.

Acceptance

  • New tokens added, with a short comment saying what each covers.
  • Add cases to the existing test nonet_catches_interpreter_and_powershell_network — both a new catch and a new non-over-match.
  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test green.

Why it's a good first issue

Self-contained, and the test right next to it shows exactly the shape to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions