Feature #617
closedExtend imrest APIs to support new pairing and registration methods
100%
Description
This is to allow Jarvis to connect to the server and submit requests via the imrest interface.
Updated by Hammel over 6 years ago
- Subject changed from Extend imwww APIs to support new pairing and registration methods to Extend imrest APIs to support new pairing and registration methods
- Description updated (diff)
- Status changed from New to In Progress
- % Done changed from 0 to 30
Implemented but needs testing. The update is that the inbound message body has a UUID in JSON format, re: { uuid: <value> } that then becomes a filename under /etc/ironman/jarvis/<uuid>. Also supports the GET monitor API, including support in imwww to save a descriptor (re: Location) when configuring the monitor's networks.
Updated by Hammel over 6 years ago
Implementing SSL has become problematic, probably because I can't quite grasp all the nuances of getting it right (not to mention the problems of dealing with self-signed certs). But it also now seems like overkill. What I really want is the same process the sensors are using with the monitor:
- Exchange UUID key at registration: each monitor has a unique UUID and each Jarvis node has unique UUID.
- Encrypt a message with aes(UUID+IV+message).
- Send IV plus encrypted message in the clear (http, not https)
- Decrypt using UUID+IV
The UUID is never sent except in the registration so it's a low-probability of getting intercepted - the user has to enable registration. So while the message and IV are sent in the open, the message itself is encrypted. You can know who is talking but not what is being said. At least not easily.
This will simplify message passing considerably. It's probably hackable, but not easily. And even the hacking could be reduced by using a sneaker-net input of remote end point keys.
I need to implement this on both end points: monitor (imrest) and Jarvis.
Updated by Hammel over 6 years ago
- % Done changed from 30 to 50
This has been implemented in Jarvis for decoding messages that were encrypted on on the NodeJS side. It's been shown to work by having Jarvis ask for /monitor, which returns the monitor descriptor using AES encryption inside a JSON packet that contains an IV and a message.
Since AES 128 is being used the encryption key (Jarvis' UUID) is shorted to 16 bytes on both ends.
This code is committed and pushed.
Now I need to reverse the process by encrypting in Jarvis and decrypting on the NodeJS side. This will be tested using the /device API from Jarvis to monitor.
Updated by Hammel over 6 years ago
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
Implemented, tested and pushed. Tested by having Jarvis request a device state change and having the monitor print out the state change request text.
Closing issue.