near / near-one-project-tracking

A repository for tracking work items that NEAR One is working on.
0 stars 0 forks source link

[ProjectTracking] Security Release Process Step 2: Reproducible Builds #14

Open Ekleog-NEAR opened 9 months ago

Ekleog-NEAR commented 9 months ago

Goals

Background

After Step 1, our security release process will be the following:

  1. We make a patch
  2. We sparsely test it
  3. We send it to the trusted validator group
  4. Once enough of these validators have deployed it, we publish the patch

This proposal focuses on the “distributing the patch” part (steps 3-4) of this process. The “testing” part (step 2) is orthogonal to this proposal, as whatever we choose to do, we need to test with the patch still being secret.

Why should NEAR One work on this

When we need to make a protocol upgrade for a security fix, validators who are not in the trusted group will be kicked out for one epoch, as they are not able to patch their binary ahead-of-time.

Also, if the security vulnerability can lead to bad things happening to validators (eg. DoS), then validators would be vulnerable to the attack, especially during the time between when we publish the patch and when they apply it.

What needs to be accomplished

We can publish binaries in a way that other validators can confirm we did not maliciously introduce vulnerabilities (or were hacked), and we commit to the binaries. Non-trusted validators can then use these binaries to not be kicked in the epoch following the security protocol upgrade, or to mitigate the attack while they don’t know of the patch yet.

In order to do that, we should be publishing reproducible builds.

The steps to do this would be

Main use case

With this change, we could publish binary-only security releases, without validators having to trust us. It means we may also be able to restrict again the size of the trusted validator group, to make sure the people aware of security vulnerabilities are as few as possible before the network is patched.

Links to external documentations and discussions

Discussion has already started on the full design document.

Estimated effort

The estimated time is one quarter-person.

Assumptions

None

Pre-requisites

Security Release Process Step 1, which is much easier to do, should be performed first, in order to list the validators that will receive the patch and not only the binary.

Out of scope

None

Task list

### Tasks
- [ ] make our release builds reproducible
- [ ] define with the validator community whether they’re fine with just having hashes in github, or whether we need a long-lived private key to sign the builds
- [ ] change our release process to also publish (reproducible) binaries and their hashes
- [ ] change our security release process to match the new process described here