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

Beholder CSA Authentication #877

Merged
merged 19 commits into from
Nov 8, 2024

Conversation

4of9
Copy link
Contributor

@4of9 4of9 commented Oct 22, 2024

What

  • Adds CSA authentication support to Beholder, including LOOPPs
  • Adds the CSA public key as an Otel resource attribute
  • A signer is used to craft a static header that is included on all Otel messages. LOOPPs don't have access to the CSA keystore, so the auth header is passed through env config

Notes

Design Context

Challenges

Two main challenges were in mind when arriving at an authentication mechanism for Beholder:

  • There are many node operators with many nodes, so leaning on an existing system would be preferred. Rolling something out that required new credentials to be exchanged would have a lot of operational overhead
  • The Chainlink node is first sending telemetry to a sidecar collector and then to the gateway

Why no mTLS

mTLS can secure the connection between the sidecar collector and the gateway, while also providing identity and authentication

This was decided against as we wouldn't be able to lean on an existing system. While CSA keys do power mTLS today in WSRPC, they're being used in a non-standard way with the certificates being generated in-memory. To use these certificates in the sidecar collector would require writing them to disk (a new security consideration).

Furthermore, mTLS is one of the reasons WSRPC is being deprecated. Since it needs to be what terminates TLS, we're not able to use L7 load balancers with more advanced security features. Using mTLS in the Gateway would put us in a similar position. It's feasible this could be made to work with a load balancer that supports mTLS, but this wasn't greatly explored

Why auth header

Headers can be passed through from the Chainlink node, to the sidecar collector, and up to the Gateway. We can also leverage the existing CSA keys as a means of identifying nodes. Thus, using a header for authentication seemed like the path of least resistance.

@4of9 4of9 force-pushed the INFOPLAT-1071-beholder-csa-signer-auth_2 branch from f6a504c to e6e43bc Compare October 29, 2024 14:13
@4of9 4of9 force-pushed the INFOPLAT-1071-beholder-csa-signer-auth_2 branch from 65a2d33 to 67152b5 Compare October 29, 2024 20:18
pavel-raykov
pavel-raykov previously approved these changes Nov 7, 2024
// where the byte value of <public_key_hex> is what's being signed
func BuildAuthHeaders(signer func([]byte) []byte, pubKey []byte) map[string]string {
messageBytes := pubKey
signature := signer(messageBytes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/nit but do we need to support multiple signing functions? Can we lock the functionality down in this module to save consumers from possibly duplicating/using invalid signing methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I think realistically we'll just be supporting ed25519 unless something takes the place of CSA keys

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed here 88df7ab

@patrickhuie19 patrickhuie19 merged commit 914b88b into main Nov 8, 2024
11 checks passed
@patrickhuie19 patrickhuie19 deleted the INFOPLAT-1071-beholder-csa-signer-auth_2 branch November 8, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants