Skip to content

egress: add egress gateway support - atenet-egress - #693

Open
Lior Lieberman (LiorLieberman) wants to merge 2 commits into
agent-substrate:mainfrom
LiorLieberman:pr2-atenet-egress
Open

egress: add egress gateway support - atenet-egress#693
Lior Lieberman (LiorLieberman) wants to merge 2 commits into
agent-substrate:mainfrom
LiorLieberman:pr2-atenet-egress

Conversation

@LiorLieberman

Copy link
Copy Markdown
Collaborator

Added pluggable egress PEP support. (Feedback on atenet-egress name is welcomed - will open a separate PR to rename atenet-router to atenet-ingress )

#559 shipped the actor egress data path without any egress gateway. This adds an Envoy deployment that terminates actor CONNECTs. It requires downstream mTLS, so only a worker's atunnel can reach it.

The gateway consists of an Envoy and an atenet router --standalone ext_proc sidecar.

The same ext_proc binary now serves both directions. Direction is decided by
the accepting listener via the xds.listener_name CEL attribute, not by
anything in the request, so an ingress client cannot reach the egress handler
by crafting a CONNECT (and maybe thats not ideal? feedback is welcomed!).

handleEgressRequestHeaders checks the method,
validates the worker-asserted actor identity headers, authenticates them
against the control plane with GetActor, and rejects actors that are not
RUNNING or whose asserted version is stale.

With that change, atelet's Run/Restore requests grow two fields it now
populates on the way down to ateom:

  • egress_gateway_address, from the new cluster-wide
    --egress-gateway-address flag, which the manifests point at
    atenet-egress.ate-system.svc:443. This is the value that arms the
    nftables REDIRECT; from here actor TCP egress leaves through the gateway
    rather than the worker's masquerade.

  • actor_version, the Actor resource version ate-api observed when it
    assigned the worker. atunnel asserts it to the gateway, and the gateway
    fails closed when its own GetActor read is older, so a stale control-plane
    view cannot authorize egress for an Actor whose assignment has since
    moved. atelet rejects Run/Restore without it.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

The gateway terminates actor's CONNECT request.
It requires downstream mTLS, so only a worker's atunnel can reach it. The gateway consists of an Envoy and an `atenet router --standalone` ext_proc sidecar.
demos/egress is a small Actor that fetches a URL it is given and echoes the
upstream status and body back, which makes the egress path observable from
outside the sandbox. hack/install-demo-egress.sh registers it as a
--deploy-demo-egress fixture and hack/verify-egress-demo.sh drives it and
checks the atenet-egress logs for the corresponding authorized CONNECT.

TestActorEgress in the networking suite covers the same path automatically:
it creates an Actor from the demo template, POSTs a fetch request through
atenet-router, and asserts 200. The suite's actor helper is parameterised by
template so the ingress test keeps using the counter fixture.
@LiorLieberman

Copy link
Copy Markdown
Collaborator Author

FYI Dmitry Berkovich (@dberkov)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant