diff --git a/internal/infrastructure/openshell/runtime.go b/internal/infrastructure/openshell/runtime.go index a5ad92433..25583e9fa 100644 --- a/internal/infrastructure/openshell/runtime.go +++ b/internal/infrastructure/openshell/runtime.go @@ -279,7 +279,13 @@ func (r *Runtime) spec(l Launch) (*v1.SandboxSpec, error) { if err != nil { return nil, err } - endpoints = append(endpoints, v1.PolicyNetworkEndpoint{Host: host, Port: uint32(port)}) //nolint:gosec // G115: a parsed port is 1 to 65535. + // Package registries name scoped packages with an encoded slash + // (@scope%2Fname), which the gateway's HTTP filter refuses unless + // the endpoint allows it, and it allows it only on a REST endpoint. + endpoints = append(endpoints, v1.PolicyNetworkEndpoint{ + Host: host, Port: uint32(port), //nolint:gosec // G115: a parsed port is 1 to 65535. + Protocol: "rest", Access: v1.NetworkAccessPresetFull, AllowEncodedSlash: true, + }) } rules["egress"] = v1.NetworkPolicyRule{Name: "egress", Endpoints: endpoints, Binaries: []v1.PolicyNetworkBinary{{Path: anyBinary}}} }