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

Dynamic Fingerprint Configuration #264

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Conversation

bowd
Copy link
Collaborator

@bowd bowd commented Jul 24, 2024

Description

I can't take it anymore. We need to do a full release cycle every time we an SSL Fingerprint changes, and on top of that we've moved away from using leaf SSL fingerprints to do this less often, thus being less secure in practice.

This PR adds the long awaited dynamic configuration of SSL certificates from a global source of truth, and what better source of truth than a blockchain! So first head over to the new Oracle SSL Fingerprint Registry.

tl;dr SSLFingerprintRegistry is an HSM owned contract that keeps a mapping from Exchange ID to SSL Fingerprint to serve as a source of truth for the oracle client.

The implementation is quite simple, there as a new service (SSLFingerprintService) that reads all fingerprints from the chain, keeps them in mapping and subscribes to update events in order to update the mapping. The service is passed into the DataAggregator and ultimately each ExchangeAdaptor, there it's used to get the fingerprint in lieu of the static attribute.

Failure modes:

  • Blockchain is down - oracle is down
  • Websockets subscription for the update events dies - oracle restart will update fingerprints
  • Somebody takes control of our HSM - highly unlikely but they would need to orchestrate a man-in-the-middle attack while updating the fingerprint registry, and taking control of the HSM amounts to taking control of our infrastructure access.

Other changes

N/A

Tested

  • Unit tests
  • Manual testing with on-chain updates

Related issues

90% of on-call requests.

Backwards compatibility

Nope.

Copy link

gitguardian bot commented Jul 24, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13147284 Triggered Generic High Entropy Secret 89a89ea test/app.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link

socket-security bot commented Jul 24, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] Transitive: filesystem, network +8 2.68 MB types
npm/[email protected] environment, filesystem, network Transitive: eval, unsafe +67 2.17 MB jonchurch
npm/[email protected] environment, filesystem, unsafe Transitive: eval, shell +37 5.36 MB kul

🚮 Removed packages: npm/@types/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

@nvtaveras nvtaveras merged commit f6164f3 into main Dec 20, 2024
5 checks passed
@nvtaveras nvtaveras deleted the feat/dynamic-fingerprint-config branch December 20, 2024 11: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.

2 participants