Skip to content

http.host facet: rules on https.unknown (and the Block button) cannot match the host #849

Description

@piscisaureus

Follow-up from #802 (unknown_host = "inspect").

There is no http.host facet: rules see method, path, query,
headers and body, req.Host is not exposed, and http.headers["Host"]
is empty because http.ReadRequest moves it to req.Host. So a rule on
https.unknown cannot say "allow *.npmjs.org, deny the rest", which
is the obvious use of inspect.

Concrete consequence: the dashboard "Block" button on an inspected
request (cmd/clawpatrol/rulegen.go, httpRuleCondition) generates
endpoint = https.unknown with method + path only, so blocking
GET / on one unknown host blocks GET / on every unknown host, with
no warning in the UI.

Fix: plumb the SNI host into the https facet as http.host (the MITM
already forwards on the SNI, not the agent's Host header), teach
rulegen to include it for https.unknown, and document it in
rules.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions