Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tee): gate nodes with remote attestation #588

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

mudler
Copy link
Contributor

@mudler mudler commented Oct 7, 2024

Description

This pull request introduces several enhancements and new features, primarily focusing on enabling remote attestation and TEE (Trusted Execution Environment) support, as well as some general improvements and fixes.

At high level, it boils down to 3 things, enhancing the security posture by allowing only nodes which runs signed binary in the network:

  • Making sure that every connection to a node triggers a challenging code which does Remote attestation between the nodes
  • Only signed binaries (by us) will pass successfully challenges
  • Data returned by the oracle is encrypted and can be unencrypted only by nodes running signed oracle binaries.

Implementation details

Under the hood this PR makes use of the Ego framework (https://github.com/edgelesssys/ego) to enable confidential computation by writing applications that runs in TEE (Trusted Execution Environment), otherwise called "enclaves".

The Remote attestation is done during the challenging phase where a node before accepting a connection or a work request it will challenge the other party. Similarly, when getting results from workers the challenge make sure that the node is running signed binary.

A new API endpoint is exposed to unencrypt messages from the Oracle. This is coupled with the new setting to always return encrypted data with the TEE keys, to allow external software to rely on messages coming only from the signed oracle binary (as only the signed oracle binary can decrypt that data). This allows external software to make sure that data produced by the oracle code can be verified afterward.

Notes for Reviewers

This PR:

Low hanging fruit (follow-up):

Signed commits

  • Yes, I signed my commits.

Copy link

github-actions bot commented Oct 7, 2024

PR description is too short and seems to not fulfill PR template, please fill in

Signed-off-by: mudler <[email protected]>
Signed-off-by: mudler <[email protected]>
Signed-off-by: mudler <[email protected]>
Signed-off-by: mudler <[email protected]>
Signed-off-by: mudler <[email protected]>
The connection gater intercepts all Dials - so if we try to verify the
node here we end up in a deep recursion loop as every NewStream() will
get intercepted, and open a NewStream() to verify each node.

This changeset adds a mechanism to:

- We let Verify the node once on the first connection and track the peer
  status
- Track bad and good peers: once we do the handshake once, we keep the
  host verified for a certain amount of time. After that the cache is
cleared
- We hold off connections until the peer is verified

Signed-off-by: mudler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant