Skip to content
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

Add new incus module, add required rules to other modules #6

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mschiff
Copy link

@mschiff mschiff commented Dec 6, 2024

This PR adds a new incus module I have developed. It is a first version, which is working for me so far with my current test set which creates, uses and manages (start,stop, restart, destroy) VMs and LXC containers.

The system I use to develop and test the changes is running with profile default/linux/amd64/23.0/hardened/selinux/systemd

As this test set does not cover every feature it is likely that more tweaks and changes need to be added in the future as issues may show up.

If you have comments and recommondations on further edits I am happy to update that PR.

systemd-network-generator.service unit fails without:
  fs_list_tmpfs(systemd_networkd_t)

allow rw to
/sys/fs/cgroup/system.slice/systemd-networkd.service/memory.pressure
  fs_rw_cgroup_files(systemd_networkd_t)

Signed-off-by: Marc Schiffbauer <[email protected]>
for reading compatibility file /usr/share/zfs/compatibility.d/openzfs-2.2
-rw-r--r--. 1 root root system_u:object_r:usr_t:s0 584 30. Aug 01:15 /usr/share/zfs/compatibility.d/openzfs-2.2

files_read_usr_files(zfs_t)
files_mmap_read_usr_files(zfs_t)

 auto-snapshots through systemd-timer not working without this:
  scontext="system_u:system_r:zfs_t:s0" tcontext="system_u:object_r:zfs_exec_t:s0"
  class="file" perms="execute_no_trans"
  comm="env" exe="" path=""
  message="type=AVC msg=audit(1726998333.913:106): avc:  denied  {
   execute_no_trans } for  pid=1708 comm="env" path="/usr/bin/zpool" dev="zfs"
   ino=405615 scontext=system_u:system_r:zfs_t:s0
   tcontext=system_u:object_r:zfs_exec_t:s0 tclass=file permissive=0 "

allow zfs_t zfs_exec_t:file execute_no_trans;

Signed-off-by: Marc Schiffbauer <[email protected]>
Signed-off-by: Marc Schiffbauer <[email protected]>
Signed-off-by: Marc Schiffbauer <[email protected]>
and add rule to other modules taht need to talk
to incusd

Signed-off-by: Marc Schiffbauer <[email protected]>
@mschiff
Copy link
Author

mschiff commented Dec 9, 2024

One note regarding MCS: LXC containers currently need to use spc_t (super privileged container) domain in this first version and MCS does not apply to spc_t.

container_t OTOH would work with MCS but was designed for docker/podman process style containers. But e.g. systemd won't boot in a container running as container_t without many more allow rules added. Therefore I think it would be best to create a new incus_lxc_t type which will be quite similar to the virt_lxc_t type from the virt module adapted to work with incusd.

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.

1 participant