[P2] security: optional signature verification for MLnode PoC endpoints#537
Closed
x0152 wants to merge 2 commits into
Closed
[P2] security: optional signature verification for MLnode PoC endpoints#537x0152 wants to merge 2 commits into
x0152 wants to merge 2 commits into
Conversation
Collaborator
Author
|
Current PR covers POC as the most critical - direct reward theft. Firstly would be good to understand if this direction makes sense. I should update PR description to clarify scope |
Collaborator
Collaborator
Author
|
@akup If the poc api update is coming, let's postpone #537 and #417 until after that. #717 can go in this upgrade - it's optional, shouldn't be affected by PoC API changes and enables cloud-hosted MLNode setups #537 and #417 for security and stability should go on top of the new api once it is validated on mainnet, to avoid regressions what do you think about that? |
Collaborator
Author
Collaborator
Collaborator
Author
|
Agreed - let's include this in v0.2.13 |
Collaborator
|
Hi @x0152, are you ready to include this PR in the next upgrade? |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MLnode api endpoints are currently unauthenticated, allowing an attacker who can reach the mlnode port to hijack POC by sending their own callback_url
Adds request signing using the existing signerAccount key. Network Node signs requests with
X-Signatureheader, mlnode verifies using SIGNER_PUBKEY environment variable. For standard deployment where mlnode is on the same machine, it works automatically since SIGNER_PUBKEY defaults to ACCOUNT_PUBKEYFor remote mlnode setups, you need to set SIGNER_PUBKEY manually. If SIGNER_PUBKEY is not set, verification is skipped for backward compatibility
Get public key on network node:
Start mlnode with signature verification: