AlexanderParker / clacks

Clacks Peer to Peer Messaging System
MIT License
1 stars 0 forks source link

Consider message retrieval via GET rather than sending via POST #2

Closed AlexanderParker closed 4 years ago

AlexanderParker commented 4 years ago

Having open ports that can receive POST messages from any public IP with from means no local means of controlling traffic through the node is not ideal.

Switching to a pull mechanism allows individual nodes to control traffic locally, throttling GET requests based on available resources, and blocking POSTs at a firewall level.

GET flooding is still possible, but easier to detect and handle at a firewall level and target nodes are not subject to arbitrarily-sized payloads they may not be able to cope with.

AlexanderParker commented 4 years ago

"But brain", I hear myself say, if nodes are able to GET from whatever targets they want to, then a nefarious node could map message distribution by sequentially and repeatedly requesting items from a range of target nodes queues, which could reveal or narrow down message sources. Or they could GET then discard a target cluster's queues to try and stop the spread of certain message groups.

POSTing messages gives the node control over distribution. which in an ideal world would be random. To map the network or filter a specific type of message, the nefarious actor would instead have to introduce many nodes into the network, and hope that their target clusters POST data to their evilNet frequently enough to build up a profile of activity.

So a GET mechanism gives a touch more local control over resources and traffic, while POST makes the overall network concept more robust and less susceptible to certain attacks, it would seem.

Sticking with POST for now, unless a compelling argument or testing appears to support contrary.