Skip to content

seccomp: reject --security-opt seccomp=profile when support is unavailable - #6960

Merged
TomSweeneyRedHat merged 1 commit into
podman-container-tools:mainfrom
leonardomoreira00:bugfix/issue_6959
Jul 14, 2026
Merged

seccomp: reject --security-opt seccomp=profile when support is unavailable#6960
TomSweeneyRedHat merged 1 commit into
podman-container-tools:mainfrom
leonardomoreira00:bugfix/issue_6959

Conversation

@leonardomoreira00

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind other

What this PR does / why we need it:

Ensures that Buildah doesn't silently ignore the explicitly specified seccomp policies when the software was built without the seccomp support.

How to verify it

See:

Which issue(s) this PR fixes:

Fixes #6959

Special notes for your reviewer:

Let me know if this implementation fits the core idea.
I had a look in the existing implementation and tried to adapt my solution.

There is no problem if this isn't considered something that needs fixing.

Does this PR introduce a user-facing change?

Reject explicit seccomp profiles when Buildah is not built with seccomp support.

Signed-off-by: Leonardo Moreira <leonardo.moreira.coutinho@gmail.com>

@nalind nalind left a comment

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.

This looks reasonable to me, since we're validating values passed at the command line and not hardwired library defaults.
LGTM, thanks!

Comment thread pkg/parse/parse.go
case "seccomp":
if !supportsSeccomp && con[1] != "unconfined" {
return fmt.Errorf("seccomp profile %q requested, but seccomp support is not enabled in this build", con[1])
}

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.

It would be nice to have "unconfined" defined in a variable somewhere, but ¯_(ツ)_/¯

@TomSweeneyRedHat

Copy link
Copy Markdown
Contributor

LGTM

@TomSweeneyRedHat

Copy link
Copy Markdown
Contributor

/lgtm

@TomSweeneyRedHat
TomSweeneyRedHat merged commit a1c3b90 into podman-container-tools:main Jul 14, 2026
44 of 46 checks passed
@TomSweeneyRedHat

Copy link
Copy Markdown
Contributor

Oh, and thanks! @leonardomoreira00 !

Comment thread pkg/parse/parse.go
case "apparmor":
commonOpts.ApparmorProfile = con[1]
case "seccomp":
if !supportsSeccomp && con[1] != "unconfined" {

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.

From podman-container-tools/podman#29337: this check results in podman-remote build --security-opt seccomp=... erroring out because it's built without seccomp support despite the server having it.

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.

seccomp: --security-opt seccomp profile is silently ignored when buildah is built without seccomp support

4 participants