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 5, 2016
1 parent 4060e6c commit c05575c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions runtime-config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,14 @@ 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.

###### 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 c05575c

Please sign in to comment.