mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
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:
1 parent
7a9aec74b5
commit
87172dfb8d
8 files changed
+339
-52
No files matched your search
@@ -86,7 +86,7 @@ class InstanceDetailsSetSubscriptionsRequest {
|
||||
static type = "request";
|
||||
static src = "control";
|
||||
static dst = "controller";
|
||||
static premission = "core.instance.subscribe";
|
||||
static permission = "core.instance.subscribe";
|
||||
|
||||
/** @type {boolean} */
|
||||
all;
|
||||
@@ -144,7 +144,7 @@ class InstanceCreateRequest {
|
||||
static type = "request";
|
||||
static src = "control";
|
||||
static dst = "controller";
|
||||
static premission = "core.instance.create";
|
||||
static permission = "core.instance.create";
|
||||
|
||||
/** @type {object} */
|
||||
config;
|
||||
@@ -172,7 +172,7 @@ class InstanceConfigGetRequest {
|
||||
static type = "request";
|
||||
static src = "control";
|
||||
static dst = "controller";
|
||||
static premission = "core.instance.get_config";
|
||||
static permission = "core.instance.get_config";
|
||||
|
||||
/** @type {number} */
|
||||
instanceId;
|
||||
@@ -429,7 +429,7 @@ class InstanceSetSaveListSubscriptionsRequest {
|
||||
static type = "request";
|
||||
static src = "control";
|
||||
static dst = "controller";
|
||||
static premission = "core.instance.save.list_subscribe";
|
||||
static permission = "core.instance.save.list_subscribe";
|
||||
|
||||
/** @type {boolean} */
|
||||
all;
|
||||
@@ -669,7 +669,15 @@ class InstanceTransferSaveRequest {
|
||||
static type = "request";
|
||||
static src = ["control", "controller"];
|
||||
static dst = ["controller", "host"];
|
||||
static permission = "core.instance.save.transfer";
|
||||
static permission(user, message) {
|
||||
user.checkPermission("core.instance.save.transfer");
|
||||
if (message.data.copy) {
|
||||
user.checkPermission("core.instance.save.copy");
|
||||
} else if (message.data.sourceName !== message.data.targetName) {
|
||||
user.checkPermission("core.instance.save.rename");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** @type {number} */
|
||||
sourceInstanceId;
|
||||
|
||||
Reference in new issue
Block a user