Compare commits

...

1 Commits

5 changed files with 41 additions and 15 deletions
+3
View File
@@ -197,6 +197,9 @@
"read_only": { "read_only": {
"type": "boolean" "type": "boolean"
}, },
"no_new_privileges": {
"type": "boolean"
},
"init": { "init": {
"type": "boolean" "type": "boolean"
}, },
+24 -12
View File
@@ -81,7 +81,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-database", "container_name": "nextcloud-aio-database",
@@ -138,7 +139,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-nextcloud", "container_name": "nextcloud-aio-nextcloud",
@@ -321,7 +323,8 @@
"read_only": true, "read_only": true,
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-redis", "container_name": "nextcloud-aio-redis",
@@ -363,7 +366,8 @@
"read_only": true, "read_only": true,
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-collabora", "container_name": "nextcloud-aio-collabora",
@@ -413,7 +417,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-talk", "container_name": "nextcloud-aio-talk",
@@ -484,7 +489,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-talk-recording", "container_name": "nextcloud-aio-talk-recording",
@@ -538,7 +544,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-borgbackup", "container_name": "nextcloud-aio-borgbackup",
@@ -665,7 +672,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-clamav", "container_name": "nextcloud-aio-clamav",
@@ -712,7 +720,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-onlyoffice", "container_name": "nextcloud-aio-onlyoffice",
@@ -798,7 +807,8 @@
], ],
"secrets": [ "secrets": [
"IMAGINARY_SECRET" "IMAGINARY_SECRET"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-fulltextsearch", "container_name": "nextcloud-aio-fulltextsearch",
@@ -850,7 +860,8 @@
], ],
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
}, },
{ {
"container_name": "nextcloud-aio-docker-socket-proxy", "container_name": "nextcloud-aio-docker-socket-proxy",
@@ -965,7 +976,8 @@
"read_only": true, "read_only": true,
"cap_drop": [ "cap_drop": [
"NET_RAW" "NET_RAW"
] ],
"no_new_privileges": true
} }
] ]
} }
+1
View File
@@ -33,6 +33,7 @@ readonly class Container {
public array $backupVolumes, public array $backupVolumes,
public array $nextcloudExecCommands, public array $nextcloudExecCommands,
public bool $readOnlyRootFs, public bool $readOnlyRootFs,
public bool $noNewPrivileges,
public array $tmpfs, public array $tmpfs,
public bool $init, public bool $init,
public string $imageTag, public string $imageTag,
+6
View File
@@ -323,6 +323,11 @@ readonly class ContainerDefinitionFetcher {
$readOnlyRootFs = $entry['read_only']; $readOnlyRootFs = $entry['read_only'];
} }
$noNewPrivileges = false;
if (isset($entry['no_new_privileges'])) {
$noNewPrivileges = $entry['no_new_privileges'];
}
$tmpfs = []; $tmpfs = [];
if (isset($entry['tmpfs'])) { if (isset($entry['tmpfs'])) {
$tmpfs = $entry['tmpfs']; $tmpfs = $entry['tmpfs'];
@@ -365,6 +370,7 @@ readonly class ContainerDefinitionFetcher {
$backupVolumes, $backupVolumes,
$nextcloudExecCommands, $nextcloudExecCommands,
$readOnlyRootFs, $readOnlyRootFs,
$noNewPrivileges,
$tmpfs, $tmpfs,
$init, $init,
$imageTag, $imageTag,
+7 -3
View File
@@ -405,10 +405,14 @@ readonly class DockerActionManager {
} }
// Disable SELinux for AIO containers so that it does not break them // Disable SELinux for AIO containers so that it does not break them
$requestBody['HostConfig']['SecurityOpt'] = ["label:disable"]; $securityOpts = ["label:disable"];
if ($container->apparmorUnconfined) { if ($container->apparmorUnconfined) {
$requestBody['HostConfig']['SecurityOpt'] = ["apparmor:unconfined", "label:disable"]; $securityOpts[] = "apparmor:unconfined";
} }
if ($container->noNewPrivileges) {
$securityOpts[] = "no-new-privileges:true";
}
$requestBody['HostConfig']['SecurityOpt'] = $securityOpts;
$mounts = []; $mounts = [];
@@ -463,7 +467,7 @@ readonly class DockerActionManager {
if (!$this->configurationManager->collaboraSeccompDisabled) { if (!$this->configurationManager->collaboraSeccompDisabled) {
// Load reference seccomp profile for collabora // Load reference seccomp profile for collabora
$seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath()); $seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath());
$requestBody['HostConfig']['SecurityOpt'] = ["label:disable", "seccomp=$seccompProfile"]; $requestBody['HostConfig']['SecurityOpt'][] = "seccomp=$seccompProfile";
} }
// Additional Collabora options // Additional Collabora options