-
Notifications
You must be signed in to change notification settings - Fork 0
Custom API Endpoint for Machine Account Key Creation #670
Copy link
Copy link
Open
Description
High-Level Summary
Develop a custom API endpoint in Milo for creating MachineAccountKey resources that supports automated key pair generation.
Motivation
Providing a way for users to create machine account keys without having to generate their own key pairs simplifies the onboarding process and ensures that keys are generated following security best practices. Returning the private key only once during creation prevents it from being stored in Milo, enhancing security.
Goals
- Implement a custom
POSTendpoint forMachineAccountKeyat/v1alpha1/namespaces/{namespace}/machineaccountkeys. - Accept an optional
publicKeyfield in the request body. - If the
publicKeyis null or omitted:- Automatically generate a secure RSA (2048-bit) key pair.
- Populate the
publicKeyfield in theMachineAccountKeyresource spec. - Return the generated private key in the response status body.
- If the
publicKeyis provided:- Use the provided public key in the
MachineAccountKeyresource. - Do not return a private key in the response.
- Use the provided public key in the
- Return the created
MachineAccountKeyresource in the response body in all scenarios. - Ensure the endpoint properly integrates with the Kubernetes API to create the resource.
Non-Goals
- Storing the private key anywhere in Milo's backend or status.
- Providing a mechanism to retrieve the private key after the initial creation response.
- High-level key rotation logic (handled by the controller).
- Implementation of the
auth-provider-zitadelcontroller (this is tracked in another ticket).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status