atunnel: broker actor certificates through atelet - #708
atunnel: broker actor certificates through atelet#708Eitan Yarmush (EItanya) wants to merge 7 commits into
Conversation
|
Thanks Eitan Yarmush (@EItanya) ! Quick question before I review more deeply today. With the goal of "having a JWT available to atunnel to append on a CONNECT request to the egress" -- What parts of the this PR addresses? Here are the parts we needed (before this pr -- havent reviewed it yet);
From a very brief glance - I think your PR is attempting to do all three. Is that correct? Also, For (1), we likely need to sort out two things to make the JWTs useful:
See for ref - substrate/cmd/ateapi/internal/actoridentity/actoridentity.go Lines 135 to 138 in 3ed6aa0 |
|
Yes, with two clarifications: this PR renews JWTs, not actor certificates, and each worker has only one active actor.
I agree the issuer and subject contracts remain unresolved. This PR intentionally retains the existing issuer/subject behavior and does not implement PEP verification yet. Before verification lands, we need a stable OIDC issuer with discovery/JWKS reachable by the PEP. |
3306005 to
facebf3
Compare
| ActorResourceVersion: actor.GetMetadata().GetVersion(), | ||
| WorkerPodUid: req.GetWorkerPodUid(), |
There was a problem hiding this comment.
why do we need these?
| clientJWTIssuer = pflag.String("client-jwt-issuer", "", "The expected issuer URL for client JWTs.") | ||
| clientJWTAudience = pflag.String("client-jwt-audience", "", "The expected audience for client JWTs.") | ||
| actorIDJWTPoolFile = pflag.String("actor-id-jwt-pool", "", "The file that contains the serialized JWT authority pool for signing actor JWTs") | ||
| egressGatewayAddress = pflag.String("egress-gateway-address", "", "Address of the egress PEP. Empty disables tunneled egress.") |
There was a problem hiding this comment.
why do need egressgateway on ateapi?
| // control resolves the authenticated worker Pod to its current assignment. | ||
| control ateapipb.ControlClient | ||
| // identity revalidates that assignment and signs the actor certificate. | ||
| identity ateapipb.ActorIdentityClient |
There was a problem hiding this comment.
identity as "identityService"? feels weird to call a field identity that does not represent an identity
| // TODO: Before release, request an atunnel-specific MintCert purpose and | ||
| // require the egress PEP to reject generic actor certificates. | ||
| // The request deliberately carries no actor identity. The authenticated Pod | ||
| // UID is the only input used to select a worker and its current assignment. | ||
| workerUID, err := authenticatedWorkerUID(ctx) |
There was a problem hiding this comment.
not sure I am following the TODO comment. I thought we were saying that we need it to be an actor cert thats specifically for atunnel use.
| return identity.PodUID, nil | ||
| } | ||
|
|
||
| func restrictClientToNode(node *substratex509.PodIdentity) func(tls.ConnectionState) error { |
There was a problem hiding this comment.
can we get a more descriptive name and/or a comment that tells what you are doing in this func?
| containers: req.GetSpec().GetContainers(), | ||
| assetPaths: req.GetRuntimeAssetPaths(), | ||
|
|
||
| actorVersion: req.GetActorVersion(), |
There was a problem hiding this comment.
whats the rationale for removing the actorVersion
| // and in every ateom pod (which mounts them as overlay lowerdirs). | ||
| ImageCacheDir = filepath.Join(BasePath, "image-cache") | ||
| ImageCacheDir = filepath.Join(BasePath, "image-cache") | ||
| CredentialBrokerSocket = filepath.Join(BasePath, "credential-broker.sock") |
There was a problem hiding this comment.
can we add a comment on top of CredentialBrokerSocket?
| "google.golang.org/grpc/credentials" | ||
| ) | ||
|
|
||
| // BrokerCertificateSource owns atunnel's actor private key and obtains the |
There was a problem hiding this comment.
I could be wrong but dont we want atelet to be the one that generate the private keys?
| // Activate allows egress for one actor. There can be only one active actor per | ||
| // worker. bearerToken may be empty until actor JWT issuance is available. | ||
| func (e *Egress) Activate(dialer EgressDialer, atespace, actorName string, actorVersion int64, bearerToken string) error { | ||
| // Activate allows egress with a previously obtained actor certificate and |
There was a problem hiding this comment.
with a previously obtained actor certificate
thinking out loud - do we care about actorVersion(s)?
|
|
||
| message MintActorCertificateRequest { | ||
| // DER-encoded PKCS #10 certificate signing request. Atunnel retains the | ||
| // corresponding private key. |
There was a problem hiding this comment.
My initial thinking was that atelet is the thing we trust, and hence it generates the private keys and hands them to atunnel. Like kubelet. But your approach may be bettter, though keys would have to be regenerated across suspend/resume?
/cc Taahir Ahmed (@ahmedtd) for thoughts.
Closes #706
Summary
Testing
make verifygo test -race ./internal/atunnel