containers / containers/udica

Support for wayland GUI apps

Open
#166 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
583
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source files or tests. Start by reviewing how the existing --X-access option generates policy rules, then compare that behavior with the reported connectto denial for /run/user/1000/wayland-0. Done means udica can generate a policy for the shown Wayland container that runs successfully with SELinux enforcing.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
desktop-dev, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.