Skip to content

Support for wayland GUI apps #166

Description

@panManfredini

Hi!

Running Fedora 44 with GNOME 50, podman 5.8.4, udica 0.2.8.

I would like to create a SeLinux hardened container for development and I'd like to run some wayland-GUI apps in it. Seems like wayland is not supported in udica, I see a command-line option --X-access, but nothing related to wayland.

I tried to create policies for the following container

podman create --name dev  --volume $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY   --device /dev/dri   --volume /dev/dri:/dev/dri    --env WAYLAND_DISPLAY=$WAYLAND_DISPLAY   --env XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR   --env XDG_SESSION_TYPE=wayland   registry.fedoraproject.org/fedora-toolbox:44 

and I get the following policies:

(block dev1
    (blockinherit container)
    (blockinherit net_container)
    (allow process process ( capability ( chown dac_override fowner fsetid kill net_bind_service setfcap setgid setpcap setuid sys_chroot ))) 

    (allow process device_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write ))) 
    (allow process device_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write ))) 
    (allow process device_t ( fifo_file ( getattr read write append ioctl lock open ))) 
    (allow process device_t ( sock_file ( append getattr open read write ))) 
    (allow process dri_device_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write ))) 
    (allow process dri_device_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write ))) 
    (allow process dri_device_t ( fifo_file ( getattr read write append ioctl lock open ))) 
    (allow process dri_device_t ( sock_file ( append getattr open read write ))) 
    (allow process user_tmp_t ( dir ( add_name create getattr ioctl lock open read remove_name rmdir search setattr write ))) 
    (allow process user_tmp_t ( file ( append create getattr ioctl lock map open read rename setattr unlink write ))) 
    (allow process user_tmp_t ( fifo_file ( getattr read write append ioctl lock open ))) 
    (allow process user_tmp_t ( sock_file ( append getattr open read write ))) 
)

Once policies are applied and the container is created again as per instructions, I get the following SELinux denial, (turning off selinux the container works as expected):

type=AVC msg=audit(1787091879.983:2076): avc:  denied  { connectto } for  pid=35905 comm="wayland-info" path="/run/user/1000/wayland-0" scontext=system_u:system_r:dev1.process:s0:c214,c943 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket permissive=0

I guess this is more complicated and would require some special additional policies as with the --X-acces, or Am I doing something wrong?

Thanks for this very nice package!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions