mirror of https://github.com/docker/cli.git
Add support for NoNewPrivileges in docker
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> Add tests for no-new-privileges Signed-off-by: Mrunal Patel <mrunalp@gmail.com> Update documentation for no-new-privileges Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
8f095a76ab
commit
d3f632156e
|
@ -605,6 +605,8 @@ with the same logic -- if the original volume was specified with a name it will
|
|||
--security-opt="label:disable" : Turn off label confinement for the container
|
||||
--security-opt="apparmor:PROFILE" : Set the apparmor profile to be applied
|
||||
to the container
|
||||
--security-opt="no-new-privileges" : Disable container processes from gaining
|
||||
new privileges
|
||||
|
||||
You can override the default labeling scheme for each container by specifying
|
||||
the `--security-opt` flag. For example, you can specify the MCS/MLS level, a
|
||||
|
@ -631,6 +633,13 @@ command:
|
|||
|
||||
> **Note**: You would have to write policy defining a `svirt_apache_t` type.
|
||||
|
||||
If you want to prevent your container processes from gaining additional
|
||||
privileges, you can execute the following command:
|
||||
|
||||
$ docker run --security-opt no-new-privileges -it centos bash
|
||||
|
||||
For more details, see [kernel documentation](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt).
|
||||
|
||||
## Specifying custom cgroups
|
||||
|
||||
Using the `--cgroup-parent` flag, you can pass a specific cgroup to run a
|
||||
|
|
|
@ -459,6 +459,8 @@ its root filesystem mounted as read only prohibiting any writes.
|
|||
"label:type:TYPE" : Set the label type for the container
|
||||
"label:level:LEVEL" : Set the label level for the container
|
||||
"label:disable" : Turn off label confinement for the container
|
||||
"no-new-privileges" : Disable container processes from gaining additional privileges
|
||||
|
||||
|
||||
**--stop-signal**=*SIGTERM*
|
||||
Signal to stop a container. Default is SIGTERM.
|
||||
|
|
Loading…
Reference in New Issue