You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@shawaj@robputt - We store the private key at the HPT and the hotspots have the public key to verify the paylaod that is sent. In order to verify requests coming in at hm-diag for /version or /initFile.txt we can make some kind of signed API key that can be passed in the Authorization HTTP header.
HPT knows the miner's IP and MAC address from the DHCP lease file. So perhaps we can encrypt the miner's MAC address using the GPG key and send it to hm-diag as the access key / authorization header?
Currently the key pair is only used for signing payloads for shutdown etc but current key also supports encryption/decryption.
Suggested new flow
When a new miner is detected, HPT generates a new API key by encrypting the miner's MAC address with the GPG signing key.
All requests sent from the HPT to the miner contain header Authorization: Bearer <API_KEY>
On hm-diag for endpoints that require it, the API_KEY is first validated (can be implemented as an authentication decorator).
Related to #464
/initFile.txt and /version endpoints should have a way to bypass them via some kind of auth.
Maybe via the gpg key we already use in manufacturing for the shutdown endpoint?
Ref https://github.com/NebraLtd/Hotspot-Production-Tool
The text was updated successfully, but these errors were encountered: