User Story
As an OpenShell operator using multiple protocol: rest endpoint objects that share one host and port but use distinct path HTTP path globs, I want requests outside those endpoint paths to produce a corresponding HTTP denial log event, so that I can audit blocked sandbox egress and diagnose policy mismatches.
Problem Statement
When a network policy entry has multiple protocol: rest endpoint objects that share a host and port, an HTTP request whose path matches none of those endpoint objects' path HTTP path globs is correctly blocked with HTTP 403. However, openshell logs has no corresponding HTTP:* DENIED OCSF/shorthand event.
The log appears when REST rules deny a request. It is missing only when the request matches no endpoint path.
Impact / Why This Matters
Operators see an allowed network connection followed by an application-level 403 but cannot see the L7 policy decision that explains why it was blocked. This creates an incomplete audit trail and makes policy troubleshooting depend on manually comparing configured endpoint path HTTP path globs and REST allow rules against the application's request path.
Acceptance Criteria
Reproduction Steps
- Save this complete policy as
unmatched-path-repro.yaml:
version: 1
filesystem_policy:
include_workdir: true
read_only: [/usr, /lib, /proc, /dev/urandom, /app, /etc, /var/log]
read_write: [/tmp, /dev/null]
landlock:
compatibility: best_effort
network_policies:
github_path_scopes:
name: github-path-scopes
endpoints:
- host: api.github.com
port: 443
path: /repos/NVIDIA/OpenShell/pulls/**
protocol: rest
enforcement: enforce
rules:
- allow:
method: GET
path: /repos/NVIDIA/OpenShell/pulls/**
- host: api.github.com
port: 443
path: /repos/NVIDIA/OpenShell/commits/**
protocol: rest
enforcement: enforce
rules:
- allow:
method: GET
path: /repos/NVIDIA/OpenShell/commits/**
binaries:
- { path: /usr/bin/curl }
- Create a disposable sandbox with that policy:
openshell sandbox create --name l7-path-log-repro --policy unmatched-path-repro.yaml --no-auto-providers --no-tty -- sleep infinity
- Request the issues endpoint, whose path matches neither endpoint object's
path HTTP path glob:
openshell sandbox exec --name l7-path-log-repro -- curl -i --max-time 20 https://api.github.com/repos/NVIDIA/OpenShell/issues
- Observe an explicit local
HTTP/1.1 403 Forbidden response with detail: no L7 endpoint path matched request.
- Inspect sandbox logs:
openshell logs <sandbox-name>
- Observe an allowed connection-level event for
curl but no corresponding HTTP denial event for the issues request.
Environment
- OpenShell:
0.0.111 (openshell --version)
- Host OS: macOS 26.6.2 (build 25G83, Apple Silicon)
- Runtime: Docker Engine 29.7.2 (client and server), Docker-backed local sandbox
- Deployment or integration: local gateway;
ghcr.io/nvidia/openshell-community/sandboxes/base:latest; custom network policy entry with two protocol: rest endpoint objects sharing api.github.com:443; /usr/bin/curl requesting GET /repos/NVIDIA/OpenShell/issues
Logs
# Application result
HTTP/1.1 403 Forbidden
X-OpenShell-Policy: github_path_scopes
{
"detail": "no L7 endpoint path matched request",
"error": "policy_denied",
"host": "api.github.com",
"layer": "l7",
"method": "GET",
"path": "/repos/NVIDIA/OpenShell/issues",
"port": 443,
"protocol": "rest"
}
# Present connection-level event
NET:OPEN [INFO] ALLOWED /usr/bin/curl(...) -> api.github.com:443 \
[policy:github_path_scopes engine:opa]
# Expected after the fix; currently absent
# HTTP:GET [MED] DENIED GET http://api.github.com:443/repos/NVIDIA/OpenShell/issues \
# [policy:github_path_scopes engine:l7] \
# [reason:L7_REQUEST deny GET api.github.com:443/repos/NVIDIA/OpenShell/issues reason=no L7 endpoint path matched request]
User Story
As an OpenShell operator using multiple
protocol: restendpoint objects that share one host and port but use distinctpathHTTP path globs, I want requests outside those endpoint paths to produce a corresponding HTTP denial log event, so that I can audit blocked sandbox egress and diagnose policy mismatches.Problem Statement
When a network policy entry has multiple
protocol: restendpoint objects that share a host and port, an HTTP request whose path matches none of those endpoint objects'pathHTTP path globs is correctly blocked with HTTP 403. However,openshell logshas no correspondingHTTP:* DENIEDOCSF/shorthand event.The log appears when REST rules deny a request. It is missing only when the request matches no endpoint
path.Impact / Why This Matters
Operators see an allowed network connection followed by an application-level 403 but cannot see the L7 policy decision that explains why it was blocked. This creates an incomplete audit trail and makes policy troubleshooting depend on manually comparing configured endpoint
pathHTTP path globs and REST allow rules against the application's request path.Acceptance Criteria
pathHTTP path glob remains blocked with HTTP 403 and is not forwarded upstream.openshell logsemits a redactedHTTP:<method> … DENIEDOCSF/shorthand event for the endpoint-path-selection miss, consistent with existing L7 policy denials.Reproduction Steps
unmatched-path-repro.yaml:pathHTTP path glob:openshell sandbox exec --name l7-path-log-repro -- curl -i --max-time 20 https://api.github.com/repos/NVIDIA/OpenShell/issuesHTTP/1.1 403 Forbiddenresponse withdetail: no L7 endpoint path matched request.curlbut no corresponding HTTP denial event for the issues request.Environment
0.0.111(openshell --version)ghcr.io/nvidia/openshell-community/sandboxes/base:latest; custom network policy entry with twoprotocol: restendpoint objects sharingapi.github.com:443;/usr/bin/curlrequestingGET /repos/NVIDIA/OpenShell/issuesLogs