Implement basic ingress filtering on controller

Validate messages received on the controller from hosts and control
nodes before handling or forwarding them.  This should prevent
performing actions that are not allowed by the role system and block
simple attacks such as spoofing the source address of a message.
This commit is contained in:
Hornwitser committed 2023-07-25 17:21:44 +02:00
1 parent 7a9aec74b5
commit 87172dfb8d
8 files changed
+339 -52

No files matched your search

+4 -4
View File
@@ -44,18 +44,18 @@ class BaseConnector extends events.EventEmitter {
return seq;
}
sendResponse(response, dst) {
sendResponse(response, dst, src = this.src) {
let seq = this._seq;
this._seq += 1;
const message = new libData.MessageResponse(seq, this.src, dst, response);
const message = new libData.MessageResponse(seq, src, dst, response);
this.send(message);
return seq;
}
sendResponseError(error, dst) {
sendResponseError(error, dst, src = this.src) {
let seq = this._seq;
this._seq += 1;
const message = new libData.MessageResponseError(seq, this.src, dst, error);
const message = new libData.MessageResponseError(seq, src, dst, error);
this.send(message);
return seq;
}