-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
known bugBug is known or not possible to fix in udica componentBug is known or not possible to fix in udica componentquestionFurther information is requestedFurther information is requested
Description
Describe the bug
When a container is run in a udica generated policy, su command does not work.
To Reproduce
Steps to reproduce the behavior:
- Install this rule generated by udica:
(block container-sabnzbd
(blockinherit container)
(blockinherit net_container)
(blockinherit restricted_net_container)
(allow process process ( capability ( audit_write chown dac_override fowner fsetid kill mknod net_bind_service net_raw setfcap setgid setpcap setuid sys_chroot )))
(allow process unreserved_port_t ( tcp_socket ( name_bind )))
(allow process container_file_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write )))
(allow process container_file_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write )))
(allow process container_file_t ( sock_file ( append getattr open read write )))
(allow process container_file_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write )))
(allow process container_file_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write )))
(allow process container_file_t ( sock_file ( append getattr open read write )))
(allow process public_content_rw_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write )))
(allow process public_content_rw_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write )))
(allow process public_content_rw_t ( sock_file ( append getattr open read write )))
)
podman run --security-opt label=type:container-sabnzbd.process -it debian:buster /bin/shsu=>su: System error
Expected behavior
Su should work as expected, like when not specifying -security-opt label=type:container-sabnzbd.process .
Solution
Udica seems to need the (allow process process ( netlink_audit_socket ( nlmsg_read nlmsg_relay nlmsg_tty_audit ))) rule of container-selinux. Adding this rule fixes the problem, I'm not sure though whether it's possible to auto-detect when it is required.
guystreeter
Metadata
Metadata
Assignees
Labels
known bugBug is known or not possible to fix in udica componentBug is known or not possible to fix in udica componentquestionFurther information is requestedFurther information is requested