Skip to content

Conversation

osamakader
Copy link

@osamakader osamakader commented Sep 26, 2025

Update seccomp documentation.

AkihiroSuda
AkihiroSuda previously approved these changes Sep 29, 2025
```

*TODO: seccomp work is being done to find a good default config*
*Seccomp filtering is supported with configurable default profiles*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean with a configurable default profile. There is no default profile AFAIK.

Also, considering how extensive this doc tends to be, maybe we can add some example seccomp profile here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was about to comment the same thing -- this is talking about the default configuration for runc, and we don't have a default seccomp profile. Upstream runtimes have their own profiles but we do not yet have a default one.

But yes, a better PR would be to provide an example (maybe just taking the Podman one? I wouldn't use the Docker one since it still suffers from the EPERM issue described in moby/moby#42871.).

Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my above comment.

@AkihiroSuda AkihiroSuda dismissed their stale review September 29, 2025 10:39

"default" is misleading

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from b9cb4c8 to a221b17 Compare September 29, 2025 11:26

**Example seccomp profile:**
An example seccomp profile based on Podman's default configuration is available at:
[examples/seccomp/podman-default.json](../examples/seccomp/podman-default.json)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this JSON has to be put in the repo.
You can just put a hyperlink

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, OCI seccomp is different from libcontainer seccomp.
See how it is converted here

func SetupSeccomp(config *specs.LinuxSeccomp) (*configs.Seccomp, error) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, going to do that.

@osamakader osamakader changed the title docs: update outdated seccomp TODO comment docs: add example seccomp profile based on Podman's default Sep 29, 2025
@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch 2 times, most recently from 06ea960 to 43b3b58 Compare September 29, 2025 11:47
Note: This is an OCI seccomp profile. Runc converts OCI seccomp profiles to libcontainer format
using the `SetupSeccomp` function in `libcontainer/specconv/spec_linux.go`.

**Example OCI seccomp format:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single example should suffice

Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's make the style more in-line with the rest of the file

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from 43b3b58 to f14c63e Compare September 29, 2025 14:31
@osamakader osamakader requested a review from rata September 29, 2025 14:33
Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM now, thanks! Left an important question, though


Seccomp can be used to filter the syscalls a container can use. The filter used is quite expressive. For example, a filter can allow only a syscall when used with a specific parameter is allowed, change the errno returned or even forward it to a user-space agent to act on it.

Example OCI seccomp profile:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this example?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I built runc with seccomp tag, used runc spec then added that profile to it, and ran a container successfully.

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from f14c63e to f7e6cdc Compare September 30, 2025 11:24
@osamakader osamakader requested a review from cyphar September 30, 2025 11:25
@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from f7e6cdc to 656677b Compare September 30, 2025 11:29
Comment on lines 382 to 383
The primary
use-case is to provide an explicit allow-list of syscalls for a container, to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line break is wrong here?

Comment on lines 388 to 389
libcontainer
does not currently provide a default filter, but higher-level runtimes tend to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here?

libcontainer
does not currently provide a default filter, but higher-level runtimes tend to
define their own filters for use with runc. Here is an example OCI seccomp
profile (see *the runtime specification* *oci-runtime-seccomp* for more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is intended to be a link but it's broken?

```

*TODO: seccomp work is being done to find a good default config*
**seccomp** can be used to apply filters to the system calls used in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you broke the link too.

What @cyphar showed with the [ ] is a markdown syntax to put links. You removed it, but we want it like that for the links :)

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from 656677b to 2fe8f87 Compare September 30, 2025 12:25
@osamakader
Copy link
Author

Thanks @rata for the clarification.

@osamakader osamakader requested a review from rata September 30, 2025 12:26
@osamakader
Copy link
Author

@cyphar changes are done.

OCI seccomp profile (see
[oci-runtime-seccomp](https://github.com/opencontainers/runtime-spec/blob/v1.2.1/config-linux.md#seccomp)
for more information on how to write your own filters)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR no longer contains an example?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It refers only to the runtime spec example above only, yes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to update the commit and PR messages.

Replace outdated TODO comment with updated information about runc's seccomp support.

Signed-off-by: Osama Abdelkader <[email protected]>
@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from 2fe8f87 to e7ea570 Compare October 6, 2025 11:22
@osamakader osamakader changed the title docs: add example seccomp profile based on Podman's default docs: update seccomp documentation Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants