fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.93k stars 409 forks source link

Serve bootstrap package from CloudFront #20765

Open noahtalerman opened 1 month ago

noahtalerman commented 1 month ago

Goal

User story
As a CPE with my Fleet hosted in a specific AWS region and who's configured Fleet to store the bootstrap package in S3,
I want to serve the bootstrap package from CloudFront
so that I can deliver the fastest download possible from the closest CloudFront region.

Context

From the customer:

Proposed solution

3 new Fleet server config options:

cloud_front_url: "123456789.cloudfront.net"
cloud_front_key_id: "K123456789"
cloud_front_signing_key: "PEM body of RSA key"

1 CloudFront URL and AWS will handle routing the machine to the closest CloudFront edge location based on DNS and other regional data.

Changes

Product

Engineering

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

QA

Risk assessment

Manual testing steps

  1. Step 1
  2. Step 2
  3. Step 3

Testing notes

Confirmation

  1. [ ] Engineer (@____): Added comment to user story confirming successful completion of QA.
  2. [ ] QA (@____): Added comment to user story confirming successful completion of QA.
noahtalerman commented 1 month ago

Thoughts on potential solution from the community:

Make sure the S3 prefix path that they store objects in is also set correctly on the CloudFront side, so that CloudFront can find the S3 object(s) to serve.

I'd suggest making each S3 object have some uniqueness in the name in order to avoid CloudFront catching weirdness.

Like, if an IT admin updates their bootstrap (or any) package and re-uploads it in place, you'd expect the CloudFront cache to get busted so that new clients download the newest version of the package.

dherder commented 3 weeks ago

@noahtalerman fo you want a separate issue to implement this same thing but for custom software packages?

noahtalerman commented 5 days ago

Luke: There's a delay (up to an hr) in which CloudFront won't be ready yet. Even if you invalidate the cache.

noahtalerman commented 5 days ago

Luke: Do we need the key_id and key?

Luke: Does the IT admin upload the S3, then wait for this to get added in CloudFront and then update the Fleet config? Or, does Fleet update the config for them?

Luke: Probably the latter.

zayhanlon commented 2 days ago

customer-starchik q4 requirement (can be evaluated today but possible for delivery any time in the quarter)

zayhanlon commented 2 days ago

@Patagonia121 i know this is a q4 key request for this customer but it wasn't selected for the current sprint due to capacity. we're focusing on a different ask from this customer. please bring it back to the next prioritization call