-
Notifications
You must be signed in to change notification settings - Fork 106
Allow container_runtime_domain runtime fifo_files transition #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Seems to be triggered by
bats -t -f "podman kill - test signal handling in containers" test/system/130-kill.bats
The commit addresses the following AVC denial:
type=PROCTITLE msg=audit(03/17/25 12:12:47.095:1509) : proctitle=nft -j -f -
type=EXECVE msg=audit(03/17/25 12:12:47.095:1509) : argc=4 a0=nft a1=-j a2=-f a3=-
type=SYSCALL msg=audit(03/17/25 12:12:47.095:1509) : arch=x86_64 syscall=execve
success=yes exit=0 a0=0x7f97e2882d70 a1=0x560887444100 a2=0x7ffdee1af598 a3=0x8
items=0 ppid=13726 pid=13733 auid=root uid=root gid=root euid=root suid=root
fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=16 comm=nft exe=/usr/sbin/nft
subj=unconfined_u:unconfined_r:iptables_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(03/17/25 12:12:47.095:1509) : avc: denied { write } for
pid=13733 comm=nft path=/tmp/podman_bats.vMhYNp/podman-kill-fifo.CMSpDDvE0M
dev="xvda3 ino=377487601 scontext=unconfined_u:unconfined_r:iptables_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=fifo_file permissive=0
Related: RHEL-83775
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAllows the container runtime SELinux domain to transition fifo_file objects in runtime contexts, resolving an AVC denial seen during podman kill signal-handling tests by updating container.te policy rules and the corresponding container.if interface. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @zpytela, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an SELinux AVC denial that prevented container runtime processes from writing to FIFO files in temporary directories, specifically observed during Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The denial is specifically about iptables_t writing a fifo under user_tmp_t; if the rule currently broadens fifo_file transitions for container_runtime_domain in general, consider scoping it to the minimal relevant types/contexts (e.g., container tmp types or a dedicated fifo type) to avoid over-permissive policy.
- Please add a brief policy comment near the new allow/transition rule that references the AVC snippet or RHEL-83775 so that future maintainers understand why fifo_files need this special handling for podman kill signal tests.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The denial is specifically about iptables_t writing a fifo under user_tmp_t; if the rule currently broadens fifo_file transitions for container_runtime_domain in general, consider scoping it to the minimal relevant types/contexts (e.g., container tmp types or a dedicated fifo type) to avoid over-permissive policy.
- Please add a brief policy comment near the new allow/transition rule that references the AVC snippet or RHEL-83775 so that future maintainers understand why fifo_files need this special handling for podman kill signal tests.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to fix an AVC denial that occurs during podman kill tests. It correctly identifies that FIFO files created by container_runtime_domain need a specific SELinux type and adds rules for that. A new interface, container_write_pid_fifo_files, is also introduced to allow writing to these FIFO files.
The changes are on the right track, but I've identified a critical omission. The new interface is defined but not actually used for the iptables_t domain, which is what the AVC denial indicates needs write access. Without this, the fix is incomplete. My review includes a specific suggestion to resolve this.
|
Tests failed. @containers/packit-build please check. |
|
Hey @zpytela , could you please signoff on your commit? |
Seems to be triggered by
bats -t -f "podman kill - test signal handling in containers" test/system/130-kill.bats
The commit addresses the following AVC denial:
type=PROCTITLE msg=audit(03/17/25 12:12:47.095:1509) : proctitle=nft -j -f - type=EXECVE msg=audit(03/17/25 12:12:47.095:1509) : argc=4 a0=nft a1=-j a2=-f a3=- type=SYSCALL msg=audit(03/17/25 12:12:47.095:1509) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x7f97e2882d70 a1=0x560887444100 a2=0x7ffdee1af598 a3=0x8 items=0 ppid=13726 pid=13733 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=16 comm=nft exe=/usr/sbin/nft subj=unconfined_u:unconfined_r:iptables_t:s0-s0:c0.c1023 key=(null) type=AVC msg=audit(03/17/25 12:12:47.095:1509) : avc: denied { write } for pid=13733 comm=nft path=/tmp/podman_bats.vMhYNp/podman-kill-fifo.CMSpDDvE0M dev="xvda3 ino=377487601 scontext=unconfined_u:unconfined_r:iptables_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=fifo_file permissive=0
Related: RHEL-83775
Summary by Sourcery
Bug Fixes: