Repository navigation
docs(rfc): propose the external network enforcer and native-network mode (RFC 0029) - #6117
Gal-Zaidman wants to merge 1 commit into
Conversation
ee28621 to
5d5d245
Compare
RFC 0029 lets an external enforcer enforce a native-network sandbox's network policy and inject its credentials. It connects to the gateway as a supervisor host in an enforcer role, reads configuration and provider environment through the supervisor RPCs, and acknowledges with ReportSandboxConfiguration. The gateway holds a generation's agent until the enforcer accepts it, holds credential rotations until the enforcer has them, and makes a policy revision current once both sides apply it. The Kubernetes driver selects the mode with an external_enforcer table, and RFC 0012 admits it as the one exception to egress mediation. Signed-off-by: Gal Zaidman <gzaidman@nvidia.com>
7ae8418 to
23de352
Compare
| that meets the requirements, including a supervisor Pod replacement and the | ||
| loss of the replica holding a node's shard. | ||
|
|
||
| ## Risks |
There was a problem hiding this comment.
In this proposal, we offload/circumvent every networking feature that OpenShell provides. I think we need to better articulate the associated risk with this. For example, we lose the following features (and this is just off the top of my head)
- credential injection
- ocsf logs
- sub agents
- policy proposals
- middleware
For every new network feature we bring to OpenShell, we also will need to consider if new hooks will need to get built so these external enforcers can integrate (similar to what is being requested for policy). I worry this will make OpenShell hard to maintain.
There was a problem hiding this comment.
The external enforcer fulfil the role of the supervisor enforcement layer so it receives everything the supervisor receives in this regard therefore it should have everything it needs without adding additional hooks into openshell - this is why I choose to extend the supervisor service instead of creating an additional one.
So I don't think the would add maintainability issues to openshell, but for sure an external enforce would need to declare compatibility for openshell versions and features.
It is true that with great power comes great responsibility, as the first risk in the list say "external policy enforcer is trusted. OpenShell trusts it to implement the network controls the supervisor implements in stock mode", and since the external enforcer is not shipped by openshell core, but from an external 3rd party, the 3rd party should document to its users any limitations it has, compatibility for openshell versions and feature and so on.
Gateway interceptors[1] can be a means for an external enforcer to "Block" capabilities he doesn't support.
I tried to outline the requirements from the external enforcer here[2] to make it clear it now has the responsibility, but feel free to suggest additions if you think it is too minimal.
I can rephrase section[2] to indicate responsibility list.
I can also add in the implementation PR or a follow up one, a dedicated doc for entorcer integration
[1] https://github.com/ai-openshell/openshell/pull/6117/changes#diff-c7bf652934dd9164c3b6d723b9ffb4f69a9cee02a67bd34b53cdb6f27d12746dR71
[2] https://github.com/ai-openshell/openshell/pull/6117/changes#diff-c7bf652934dd9164c3b6d723b9ffb4f69a9cee02a67bd34b53cdb6f27d12746dR260
| fails launches until the recovery timeout. The debug guide shows how to | ||
| check a Pod's network status. | ||
|
|
||
| ## Alternatives |
There was a problem hiding this comment.
Why not consider middleware? Middleware is exactly intended to provide a hook for external network enforcement systems.
There was a problem hiding this comment.
Middleware was considered, and middleware should still work with external policy enforcer (it should declare middleware which were registered to it), but it cannot be the mechanics to integrate an external enforcer.
The main reasons it doesn't fit is that the goal is to have a different enforcement point on the wire to enforce the policy on, not an additional one, the traffic need to go directly to the enforcer and not through the openshell supervisor.
As the first sentence states "Let an external policy enforcer, instead of the supervisor, enforce a sandbox's network policy and inject its credentials."
A detailed list of reasons:
1.Middleware require the agent traffic to first flow through the supervisor, not directly to the external enforcer interface, meaning:
1.1. Every connection would still leave from the supervisor's address, the motivation is that an enforcer on the wire then sees one source for every sandbox on a node
1.2. Breaks the “native network mode”, the sandbox process still need to pass all the traffic to the supervisor instead of the traffic going natively out of an interface the external enforcer controls and monitors without the kernel hooks which exist today to force the traffic to go in a certain way.
2.Middlewares come on top of supervisor enforcement, not instead of it:
2.1 The supervisor calls middleware after its own policy check and before forwarding
2.2. The enforcer would be duplicating the supervisor's enforcement, which is what deployments want to avoid
3.Middlewares are called by the supervisor not the gateway, if the policy is enforced by a non openshell component, it is better to have the policy and credentials to come a component which doesn’t have interaction with the sandbox - this creates a true Zero Trust use case
4.It only covers part of the traffic, Middleware sees only HTTP requests, HTTP responses and outgoing WebSocket text messages that the proxy has TLS-terminated and parsed, it can't see L4 connection decisions, DNS, UDP, raw TCP, tls: skip, h2c or passthrough - an enforcer has to see every packet of every protocol and drop everything else;
| sandbox's effective policy and credentials, and OpenShell needs to know the | ||
| external policy enforcer applied them before the agent runs, to prevent the | ||
| agent from running unenforced. OpenShell has no way to hand either to an | ||
| external component today. |
There was a problem hiding this comment.
Can we give some concrete examples of these product that would offload? Today, we can offload policy enforcement to external providers using middleware.
There was a problem hiding this comment.
I can add a section on NVIDIA Senty as a concrete example
|
|
||
| The mode requires a shared supervisor topology of [RFC | ||
| 0018](../0018-multi-sandbox-ha-supervisors/README.md) and | ||
| `config_delivery_mode = "poll"`; the gateway refuses to start otherwise. In |
There was a problem hiding this comment.
we'll be deprecating the polling configuration delivery mode in 0.2.0.
There was a problem hiding this comment.
I can modify it to push, just wanted to define one way of doing things and personally poll seems easier to me :)
thanks for the feedback
Summary
Propose RFC 0029, which lets an external policy enforcer enforce a Kubernetes sandbox's network policy and inject its provider credentials instead of the supervisor. Sandboxes it serves run in native-network mode, and the gateway keeps the agent from running until the enforcer has accepted the sandbox's configuration.
Related Issue
Closes #6024. The implementation follows in a separate PR, behind the
experimentalfeature.Changes
external_enforcertable: the agent's traffic leaves on the network interface the enforcer owns, without the supervisor's egress proxy or policy DNS.SupervisorHoststream with its own role and token. It reads configuration and provider environment through the existing supervisor RPCs and reports what it enforces withReportSandboxConfiguration.experimentalfeature until it runs end to end, plus risks, alternatives, and prior art.Release Notes
Testing
mise run markdown:lintpasses, including Mermaid validation.git diff --checkpasses.Checklist