Σύγκριση υποβολών
2 Υποβολές
32544c8f68
...
ca0c8a94fb
Συγγραφέας | SHA1 | Ημερομηνία | |
---|---|---|---|
ca0c8a94fb | |||
5870102aa9 |
@ -54,31 +54,16 @@ bool SandboxLinux::enable(std::vector<std::string> fsPaths)
|
||||
}
|
||||
for(unsigned int i = 0; i < fsPaths.size(); i++)
|
||||
{
|
||||
exile_append_path_policy(policy, EXILE_FS_ALLOW_READ | EXILE_FS_ALLOW_WRITE, fsPaths[i].c_str());
|
||||
exile_append_path_policy(policy, EXILE_FS_ALLOW_ALL_READ | EXILE_FS_ALLOW_ALL_WRITE, fsPaths[i].c_str());
|
||||
}
|
||||
policy->drop_caps = 1;
|
||||
policy->not_dumpable = 1;
|
||||
policy->no_new_privs = 1;
|
||||
policy->mount_path_policies_to_chroot = 1;
|
||||
policy->vow_promises = EXILE_SYSCALL_VOW_STDIO | EXILE_SYSCALL_VOW_WPATH | EXILE_SYSCALL_VOW_CPATH |
|
||||
EXILE_SYSCALL_VOW_RPATH | EXILE_SYSCALL_VOW_INET | EXILE_SYSCALL_VOW_UNIX |
|
||||
EXILE_SYSCALL_VOW_THREAD;
|
||||
|
||||
if(exile_append_group_syscall_policy(policy, EXILE_SYSCALL_ALLOW, EXILE_SYSCGROUP_DEFAULT_ALLOW) != 0)
|
||||
{
|
||||
Logger::error() << "Sandbox: Failed to add whitelist!";
|
||||
exile_free_policy(policy);
|
||||
return false;
|
||||
}
|
||||
if(exile_append_group_syscall_policy(policy, EXILE_SYSCALL_ALLOW, EXILE_SYSCGROUP_SOCKET | EXILE_SYSCGROUP_FUTEX | EXILE_SYSCGROUP_PATH | EXILE_SYSCGROUP_SCHED | EXILE_SYSCGROUP_TIME) != 0)
|
||||
{
|
||||
Logger::error() << "Sandbox: Failed to add socket group!";
|
||||
exile_free_policy(policy);
|
||||
return false;
|
||||
}
|
||||
if(exile_append_syscall_default_policy(policy, EXILE_SYSCALL_DENY_KILL_PROCESS) != 0)
|
||||
{
|
||||
Logger::error() << "Sandbox: Default policy";
|
||||
exile_free_policy(policy);
|
||||
return false;
|
||||
}
|
||||
if(exile_enable_policy(policy) != 0)
|
||||
{
|
||||
Logger::error() << "Sandbox: Activation of seccomp blacklist failed!";
|
||||
|
Submodule submodules/cpp-httplib updated: 824e7682e4...b324921c1a
Submodule submodules/exile.h updated: 1b4c5477a5...4824c6eaa9
Αναφορά σε νέο ζήτημα
Block a user