Skip to content

Commit acc1c63

Browse files
committed
Merge pull request #290 from mrunalp/no_new_priv
Add NoNewPrivileges setting for linux
2 parents c8de60b + 5f327ba commit acc1c63

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
@@ -540,3 +540,14 @@ Its value is either slave, private, or shared.
540540
```json
541541
"rootfsPropagation": "slave",
542542
```
543+
544+
## No new privileges
545+
546+
Setting `noNewPrivileges` to true prevents the processes in the container from gaining additional privileges.
547+
[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.
548+
549+
###### Example
550+
551+
```json
552+
"noNewPrivileges": true,
553+
```

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)