Skip to content

Commit 5f327ba

Browse files
committed
Add NoNewPrivileges setting for linux
This is a security setting that could be used to prevent processes in the container from gaining additional privileges. Signed-off-by: Mrunal Patel <[email protected]>
1 parent 4060e6c commit 5f327ba

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

runtime-config-linux.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,3 +503,14 @@ Its value is either slave, private, or shared.
503503
```json
504504
"rootfsPropagation": "slave",
505505
```
506+
507+
## No new privileges
508+
509+
Setting `noNewPrivileges` to true prevents the processes in the container from gaining additional privileges.
510+
[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.
511+
512+
###### Example
513+
514+
```json
515+
"noNewPrivileges": true,
516+
```

runtime_config_linux.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ type LinuxRuntime struct {
3939
SelinuxProcessLabel string `json:"selinuxProcessLabel"`
4040
// Seccomp specifies the seccomp security settings for the container.
4141
Seccomp Seccomp `json:"seccomp"`
42-
// RootfsPropagation is the rootfs mount propagation mode for the container
42+
// RootfsPropagation is the rootfs mount propagation mode for the container.
4343
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
44+
// NoNewPrivileges controls whether additional privileges could be gained by processes in the container.
45+
NoNewPrivileges bool `json:"noNewPrivileges,omitempty"`
4446
}
4547

4648
// Namespace is the configuration for a linux namespace

0 commit comments

Comments
 (0)