You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config-linux.md
+59-1Lines changed: 59 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -624,6 +624,19 @@ The following parameters can be specified to set up seccomp:
624
624
*`SECCOMP_FILTER_FLAG_TSYNC`
625
625
*`SECCOMP_FILTER_FLAG_LOG`
626
626
*`SECCOMP_FILTER_FLAG_SPEC_ALLOW`
627
+
*`SECCOMP_FILTER_FLAG_NEW_LISTENER`
628
+
*`SECCOMP_FILTER_FLAG_TSYNC_ESRCH`
629
+
630
+
***`listenerPath`***(string, OPTIONAL)* - specifies the path of UNIX domain socket over which the runtime will send the [seccomp state](#seccompstate) data structure, using `SCM_RIGHTS` for file descriptors.
631
+
This socket MUST use `AF_UNIX` domain and `SOCK_STREAM` type.
632
+
The runtime MUST send exactly one [seccomp state](#seccompstate) per connection.
633
+
The connection MUST NOT be reused and it MUST be closed after sending a seccomp state.
634
+
If sending to this socket fails, the runtime MUST [generate an error](runtime.md#errors).
635
+
This field MUST be set if and only if the flag `SECCOMP_FILTER_FLAG_NEW_LISTENER` is used.
636
+
637
+
***`listenerMetadata`***(string, OPTIONAL)* - specifies an opaque data to pass to the seccomp agent.
638
+
This string will be sent as a field in the [seccomp state](#seccompstate).
639
+
This field MUST NOT be set if `listenerPath` is not set.
627
640
628
641
***`syscalls`***(array of objects, OPTIONAL)* - match a syscall in seccomp.
629
642
While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries.
@@ -633,7 +646,7 @@ The following parameters can be specified to set up seccomp:
633
646
***`names`***(array of strings, REQUIRED)* - the names of the syscalls.
634
647
`names` MUST contain at least one entry.
635
648
***`action`***(string, REQUIRED)* - the action for seccomp rules.
636
-
A valid list of constants as of libseccomp v2.4.0 is shown below.
649
+
A valid list of constants as of libseccomp v2.5.0 is shown below.
637
650
638
651
*`SCMP_ACT_KILL`
639
652
*`SCMP_ACT_KILL_PROCESS`
@@ -642,6 +655,7 @@ The following parameters can be specified to set up seccomp:
642
655
*`SCMP_ACT_TRACE`
643
656
*`SCMP_ACT_ALLOW`
644
657
*`SCMP_ACT_LOG`
658
+
*`SCMP_ACT_NOTIFY`
645
659
646
660
***`errnoRet`***(uint, OPTIONAL)* - the errno return code to use.
647
661
Some actions like `SCMP_ACT_ERRNO` and `SCMP_ACT_TRACE` allow to specify the errno
@@ -685,6 +699,50 @@ The following parameters can be specified to set up seccomp:
685
699
}
686
700
```
687
701
702
+
### <aname="seccompstate" />The Seccomp State
703
+
704
+
The seccomp state is a data structure passed via a UNIX socket.
705
+
The container runtime MUST send the seccomp state over the UNIX socket as regular payload serialized in JSON.
706
+
The container runtime MUST also send the file descriptor(s) via `SCM_RIGHTS`: the seccomp file descriptor returned by the seccomp syscall and, optionally, the process file descriptor (e.g as returned by `pidfd_open(2)` or by `clone(2)` with the `CLONE_PID` flag).
707
+
The container runtime MAY use several `sendmsg(2)` calls to send the aforementioned data.
708
+
If more than one `sendmsg(2)` is used, the file descriptors MUST be sent only in the first call.
709
+
710
+
The seccomp state includes the following properties:
711
+
712
+
***`ociVersion`** (string, REQUIRED) is version of the Open Container Initiative Runtime Specification with which the seccomp state complies.
713
+
***`seccompFd`** (int, REQUIRED) is the index of the file descriptor in the `SCM_RIGHTS` array refering to the seccomp notify file descriptor.
714
+
The value MUST be 0.
715
+
***`pid`** (int, REQUIRED) is the process ID, as seen by the runtime, on which the seccomp filter is applied (target process).
716
+
***`pidFd`** (int, OPTIONAL) is the index of the file descriptor in the `SCM_RIGHTS` array referring to the target process file descriptor.
717
+
If present, this value MUST NOT be zero.
718
+
***`metadata`** (string, OPTIONAL) is the string set in `listenerMetadata`.
719
+
If the `listenerMetadata` is set, then the runtime MUST set this field too.
720
+
***`state`** (map, REQUIRED) is the [state](runtime.md#state) of the container.
721
+
722
+
Example:
723
+
724
+
```json
725
+
{
726
+
"ociVersion": "0.2.0",
727
+
"seccompFd": 0,
728
+
"pid": 4422,
729
+
"pidFd": 1,
730
+
"state": {
731
+
"ociVersion": "0.2.0",
732
+
"id": "oci-container1",
733
+
"status": "creating",
734
+
"pid": 4422,
735
+
"bundle": "/containers/redis",
736
+
"annotations": {
737
+
"myKey": "myValue"
738
+
}
739
+
}
740
+
}
741
+
```
742
+
743
+
Note that if `state.status` is `creating`, the seccomp filter is created following the [`start`](runtime.md#start) command and `.pid` has the same value as `.state.pid`.
744
+
And if `state.status` is `running`, the seccomp filter is created following an `exec` command and `.pid` has a different value than `.state.pid`.
745
+
688
746
## <aname="configLinuxRootfsMountPropagation" />Rootfs Mount Propagation
689
747
690
748
**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation.
// Version is the version of the specification that is supported.
39
+
Versionstring`json:"ociVersion"`
40
+
// SeccompFd is the index of the file descriptor in the `SCM_RIGHTS` array referring to the seccomp notify file descriptor. It is always zero.
41
+
SeccompFdint`json:"seccompFd"`
42
+
// Pid is the process ID, as seen by the runtime, on which the seccomp filter is applied (target process).
43
+
Pidint`json:"pid"`
44
+
// PidFd is is the index of the file descriptor in the `SCM_RIGHTS` array referring to the target process file descriptor (e.g as returned by `pidfd_open(2)` or by `clone(2)` with the `CLONE_PID` flag).
45
+
PidFdint`json:"pidFd,omitempty"`
46
+
// Opaque metadata copied from the listenerMetadata seccomp field.
0 commit comments