Skip to content

Commit

Permalink
Add DisableNewPrivileges setting for linux
Browse files Browse the repository at this point in the history
This is a security setting that could be used to prevent processes in the
container from gaining additional privileges.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
  • Loading branch information
mrunalp committed Jan 6, 2016
1 parent 4060e6c commit 7e542a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions runtime-config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,17 @@ Its value is either slave, private, or shared.
```json
"rootfsPropagation": "slave",
```

## Disable new privileges

Setting `disableNewPrivileges` to true prevents the processes in the container from gaining additional privileges.
[The kernel doc](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt) has more information on how this is achieved using a prctl system call.


* **`disableNewPrivileges`** *(bool, optional)* - controls whether container processes can gain additional privileges

###### Example

```json
"disableNewPrivileges": true,
```
4 changes: 3 additions & 1 deletion runtime_config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ type LinuxRuntime struct {
SelinuxProcessLabel string `json:"selinuxProcessLabel"`
// Seccomp specifies the seccomp security settings for the container.
Seccomp Seccomp `json:"seccomp"`
// RootfsPropagation is the rootfs mount propagation mode for the container
// RootfsPropagation is the rootfs mount propagation mode for the container.
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
// disableNewPrivileges controls whether additional privileges could be gained by processes in the container.
DisableNewPrivileges *bool `json:"disableNewPrivileges,omitempty"`
}

// Namespace is the configuration for a linux namespace
Expand Down

0 comments on commit 7e542a6

Please sign in to comment.