mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Update unprivileged_userns_restriction
parent
cea63063b5
commit
f102953a5b
1 changed files with 24 additions and 0 deletions
|
@ -1,5 +1,22 @@
|
|||
# Introduction
|
||||
|
||||
Unprivileged user namespaces are a feature of the kernel that can be used to replace many of the uses of setuid and setguid programs, and also allow for applications to create more secure sandboxes.
|
||||
|
||||
to create semiprivileged processes that can replace the use of setuid and setguid binaries. The processes wit
|
||||
|
||||
However while unprivileged user namespaces have been beneficial by reducing the need for setuid and setguid processes they expose kernel interfaces that are normally restricted to processes with privileged capabilities (root) to use by unprivileged users. Exposing more kernel interfaces than necessary to a process introduces additional security risks, and unfortunately unprivileged user namespaces are now broadly used as a step in several privilege escalation exploit chains. Basically even if unprivileged user namespaces are bug free, as long as any privileged kernel interface or combination of interfaces has a bug an unprivileged user can try to exploit that bug.
|
||||
|
||||
This has lead to many real world CVEs
|
||||
|
||||
Because of this several distro kernels carry a patch that allows for a sysctl to disable unprivileged user namespaces as a mitigation. Unfortunately the sysctl is all or nothing, disabling unprivileged might stop an exploit but also can break applications that use them. Generally an exploit targets a specific application, and as long as unprivileged user namespaces can be disabled for those applications there is not need to disable them for the entire system.
|
||||
|
||||
With introduction of restricted unprivileged user namespaces AppArmor can be used to selectively allow and disallow unprivileged user namespaces. AppArmor policy is used to selectively control access to unprivileged user namespaces on a per applications basis. ?? default deny
|
||||
|
||||
mention apparmor sysctl
|
||||
|
||||
|
||||
|
||||
|
||||
unconfined processes with capability SYS_ADMIN will
|
||||
|
||||
unprivileged_userns_clone
|
||||
|
@ -58,6 +75,13 @@ apparmor_restrict_unprivileged_userns
|
|||
|
||||
# policy
|
||||
|
||||
When restrictions on unprivileged user namespaces are enabled unconfined unprivileged processes are not allowed to create user namespaces. Unconfined unprivileged processes must be confined by a profile to be able to create user name spaces when restrictions on unprivileged user namespaces are enabled.
|
||||
|
||||
Confined processes whether privileged or unprivileged are by default also not allowed to create user namespaces. To enable them to create user namespaces the following rule should be add to the applications profile.
|
||||
|
||||
```
|
||||
allow userns create,
|
||||
```
|
||||
|
||||
# Disabling unprivileged user namespaces
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue