-
Notifications
You must be signed in to change notification settings - Fork 21
Description
(This is related to #156, but probably needs a few more questions answered.)
I can open an RFC once we have an initial consensus.
The goal is to provide an Artifact Integrity guarantee that a given artifact was generated by a worker under our control.
In this model, the worker manager will provide a key for each provisioned worker.
- Worker Manager provides a key to provisioned workers, using cloud provider instance identity
- Worker Manager allows for key generation for hardware workers, with documentation on how to protect this key
- Worker Manager provides an endpoint to query the public key for a given worker
- Worker Manager allows for keeping important worker history, until the artifacts uploaded by those workers expire
- Workers use this key to sign the sha256 of the artifact, and submit that signature along with the other artifact metadata.
Keypair
We've gone back and forth between PKI and no PKI. In the PKI model, we would have an intermediate cert on the Worker Manager, and sign the worker cert. We would trust the root cert and verify signatures through the web of trust. This brings up questions around key rotation and revocation that we should address if we go this route.
In the non-PKI model, we could generate a small unique keypair, possibly ed25519, per worker instance. As long as the public key is associated with the worker on the Worker Manager, we can verify its signatures. This means we'll need to keep the worker information in Worker Manager as long as we need to verify its artifacts. We also need to decide if we generate the keypair in the Worker Manager and send the private key to the worker, or if we generate the keypair on the worker and send the public key to the Worker Manager.
This is the Worker Key.
We're currently assuming we're going the non-PKI model.
Cloud provisioned workers
Aiui, cloud provisioned workers have an identity document from the cloud provider. Once the worker identity is verified, we can store the public key with the rest of the worker information. If the key generation happened on the Worker Manager, we can pass down the private key to the worker.
Hardware workers
The security here will be colo- and subnet-based security. We need some way to add a keypair to the hardware workers, and get the public key into Worker Manager.
Key rotation / reused workerIds
We can generate a new key for every cloud instance, especially if they're short-lived. If we reuse cloud workerIds we need to be able to either return a set of valid public keys, or perhaps add the datetime the artifact was created to the public key request. We may also want to be able to rotate keys on a hardware worker without changing its workerId.
Public Key query endpoint
For the non-PKI solution, the Worker Manager will keep track of each worker's public key(s), and either return the set of valid public keys for a given workerId, or the valid public key for a given datetime.
Preserve important worker history until artifact expiration
For the non-PKI solution, the Worker Manager will need to keep track of the important (read: level 3) workers until their artifacts expire. Likely we'll need to specify which worker pools are "important" in configs, and we'll need a join in postgres to find the latest expiring artifacts uploaded by this workerId.
Artifact content signature
The ContentSha256 of an artifact guarantees that the artifact has not been modified between artifact upload and artifact download. By signing this ContentSha256 with the Worker Key, we also show that the artifact was uploaded by a worker under our control.