kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
500 stars 99 forks source link

Embed the most recent version of root.json in our launcher binary #1705

Open RebeccaMahany opened 2 months ago

RebeccaMahany commented 2 months ago

Currently, we embed the root.json file inside our launcher binary: https://github.com/kolide/launcher/blob/main/ee/tuf/assets/tuf/root.json

We want to change how we embed this file for a couple reasons:

  1. The root.json metadata file has a one-year expiration. If the version we are shipping is expired, this can prevent launcher from being able to select the correct version of a binary until the TUF autoupdater exits its initial delay and performs an update.
  2. We don't want to have to remember to update the root.json file every time we create a new version.
  3. Shipping an outdated version of root.json means that the TUF autoupdater has to perform a couple extra HTTP calls to get the most recent version of root.json.
  4. While we could ship an outdated version of root.json and force the TUF autoupdater to immediately fetch the latest version based on that -- via a call to metadataClient.UpdateRoots() -- this would slow down launcher startup due to the extra HTTP calls, which we don't want.

Our build process should be updated to embed the most recent version of root.json in the launcher binary.

Notes for implementation:

directionless commented 2 months ago

This shouldn't be a change in pkg/make it should be a go generate somewhere.

RebeccaMahany commented 2 months ago

@directionless updated first bullet point accordingly