Skip to content

docs: update seccomp documentation#4902

Merged
lifubang merged 1 commit into
opencontainers:mainfrom
osamakader:fix-outdated-seccomp-todo
Oct 14, 2025
Merged

docs: update seccomp documentation#4902
lifubang merged 1 commit into
opencontainers:mainfrom
osamakader:fix-outdated-seccomp-todo

Conversation

@osamakader

@osamakader osamakader commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

Update seccomp documentation.

AkihiroSuda
AkihiroSuda previously approved these changes Sep 29, 2025
Comment thread libcontainer/SPEC.md Outdated
```

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

Copy link
Copy Markdown
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
Copy Markdown
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.).

cyphar
cyphar previously requested changes Sep 29, 2025

@cyphar cyphar left a comment

Copy link
Copy Markdown
Member

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
Comment thread libcontainer/SPEC.md Outdated

**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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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
Comment thread libcontainer/SPEC.md Outdated
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
Copy Markdown
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

@rata rata left a comment

Copy link
Copy Markdown
Member

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

Comment thread libcontainer/SPEC.md Outdated
Comment thread libcontainer/SPEC.md Outdated
Comment thread libcontainer/SPEC.md Outdated
Comment thread libcontainer/SPEC.md Outdated
@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

@rata rata left a comment

Copy link
Copy Markdown
Member

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

Comment thread libcontainer/SPEC.md Outdated

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
Copy Markdown
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
Copy Markdown
Contributor 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.

Comment thread libcontainer/SPEC.md Outdated
@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 thread libcontainer/SPEC.md Outdated
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
Copy Markdown
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 thread libcontainer/SPEC.md Outdated
Comment on lines +388 to +389
libcontainer
does not currently provide a default filter, but higher-level runtimes tend to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and here?

Comment thread libcontainer/SPEC.md Outdated
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
Copy Markdown
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?

Comment thread libcontainer/SPEC.md Outdated
```

*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
Copy Markdown
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
Copy Markdown
Contributor Author

Thanks @rata for the clarification.

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

Copy link
Copy Markdown
Contributor Author

@cyphar changes are done.

Comment thread libcontainer/SPEC.md
@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
Comment thread libcontainer/SPEC.md Outdated
Comment thread libcontainer/SPEC.md Outdated
vulnerabilities, so a strong seccomp filter is highly recommended.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Here is an example" is probably a leftover from earlier versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, thanks. done.

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from e7ea570 to 85582c1 Compare October 8, 2025 19:00
@osamakader osamakader requested a review from kolyshkin October 8, 2025 19:02
@osamakader

Copy link
Copy Markdown
Contributor Author

@cyphar Do you mind adding you as co-author here? since the changes now almost yours.

@osamakader osamakader requested a review from AkihiroSuda October 8, 2025 20:26
Comment thread libcontainer/SPEC.md Outdated
libcontainer does not provide a default filter, but higher-level
runtimes tend to define their own filters for use with runc (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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: missing period

@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from 85582c1 to afd8e4b Compare October 11, 2025 20:36
@lifubang lifubang requested a review from Copilot October 12, 2025 00:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the seccomp documentation in the libcontainer specification by replacing a TODO placeholder with comprehensive information about seccomp functionality and usage.

  • Replaces a TODO comment with detailed explanation of seccomp functionality
  • Adds information about filter expressions, actions, and security benefits
  • Includes reference to OCI runtime seccomp documentation for filter creation guidance

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread libcontainer/SPEC.md Outdated
emitting a log entry, or permitting the syscall to execute).

The primary use-case is to provide an explicit allow-list of syscalls for a
container, to reduce the kernel API attack surface exposed the container.

Copilot AI Oct 12, 2025

Copy link

Choose a reason for hiding this comment

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

Missing word 'to' - should read 'exposed to the container'.

Suggested change
container, to reduce the kernel API attack surface exposed the container.
container, to reduce the kernel API attack surface exposed to the container.

Copilot uses AI. Check for mistakes.
@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from afd8e4b to fb37d8f Compare October 12, 2025 11:01
Comment thread libcontainer/SPEC.md Outdated
Replace outdated TODO comment with updated information about runc's seccomp support.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
@osamakader osamakader force-pushed the fix-outdated-seccomp-todo branch from fb37d8f to e0632cc Compare October 13, 2025 19:41
@osamakader osamakader requested a review from lifubang October 13, 2025 19:42

@lifubang lifubang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks.

@lifubang lifubang dismissed cyphar’s stale review October 14, 2025 00:11

I think all your requested changes have been addressed.

@lifubang lifubang merged commit 721d066 into opencontainers:main Oct 14, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants