Repository navigation
Description
User Story
I use OpenShell to monitor egress from agent sandboxes. I need the OCSF HTTP Activity record to identify the policy that governed each request so I can group activity by policy key.
Problem Statement
When multiple network policies permit a TCP connection to the same host and port, OpenShell can report the connection's policy key on the HTTP Activity record even though a different policy allowed the HTTP request. A single request on a fresh connection is enough to hit this. Reused connections can also carry requests governed by different policies.
The plain HTTP forward proxy handles one request per connection. Its HTTP decision event sets firewall_rule from the earlier TCP authorization, while the separate HTTP evaluation returns only an allow result and a reason. Forward proxy source · HTTP policy evaluation
Impact / Why This Matters
An operator can audit a successful request under the wrong policy key. A detector that groups requests by policy can count the request against the wrong rule. The planned Close and Traffic events report connection-wide measurements, which consumers need to distinguish from request attribution. See #5919 and #5921.
Acceptance Criteria
- When multiple entries allow the TCP connection and one permits the inspected HTTP request, the HTTP Activity record identifies the entry that permitted the request. Cover a single request on a fresh connection.
- Where inspected connections support reuse, requests governed by different policy keys have the correct attribution in their own HTTP Activity records.
- If no request rule matches, or the evaluator has no single deciding rule, the event represents that outcome explicitly. It does not present a TCP policy key as a request match.
- Connection records retain their connection-level meaning. The fix preserves request allow and deny behavior.
Reproduction Steps
- Configure two OpenShell network policies for the same host and port. Give them distinct inspected HTTP rules, such as a read rule for GET and a write rule for PUT.
- Enable OCSF JSON output and create an OpenShell sandbox with the policy.
- Use a fresh proxied TCP connection to send one HTTP request that only the policy entry other than the recorded TCP match permits.
- Compare the resulting OCSF HTTP Activity record's
firewall_rulewith the policy entry that permits the request.
Environment
- OpenShell: source inspected on main at
2ac724f0e48c9ef3563cace83978f22e4f10fb42. - Relevant path: supervisor plain HTTP forward proxy with HTTP inspection enabled.
- The steps describe the reported case. This filing used source inspection and did not rerun the deployment.
Activity
pimlock commentedon Nov 24, 2026
I reproduced this with the standalone OpenShell plain HTTP forward proxy on Linux arm64 (supervisor
0.1.10-dev.94+g0d495be49). Both policy entries match the same host and port.a_readallows onlyGET /item, andb_writeallows onlyPUT /item.On a fresh proxy connection,
PUT /itemreached the upstream and returned 204. Its inspected HTTP Activity event reportedaction = Allowedandfirewall_rule = {"name":"a_read","type":"l7"}. I expectedfirewall_rule.nameto beb_write.For comparison,
GET /itemreturned 204 and correctly recordeda_read.POST /itemreturned 403 and also recordeda_read, although neither entry allowed POST. Each request used a separate curl process.Runnable reproduction, policy YAML, and captured OCSF JSON excerpts