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

prepare.sh: label osbuild,setfiles "correctly" in the container #16

Closed
wants to merge 1 commit into from

Commits on Nov 27, 2023

  1. prepare.sh: label osbuild,setfiles "correctly" in the container

    When running osbuild inside a container the selinux setup is slightly
    different from a non container setup:
    
    Inside the container all files under "/" in the overlayfs have the label
    `system_u:object_r:container_files_t`. This includes `/usr/bin/osbuild`
    and `/usr/sbin/setfiles`. Because the container is using an overlayfs
    the files cannot directly relabled under "/" with the correct selinux
    labels. This is why `prepare.sh` creates a tmpfs and relabels there
    and bind mounts back.
    
    This commit tweaks this mechanism now to create labels that are
    closer to a real selinux system. I.e. it will:
    1. label /usr/bin/osbuild as `osbuild_exec_t`
    2. label /usr/sbin/setfiles as `setfiles_exec_t`
    
    With that the normal transition rules work, i.e. osbuild_exec_t can
    transition to mount_t and when setfiles is called it will automatically
    use `setfiles_exec_t`.
    mvo5 committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    8c5b97e View commit details
    Browse the repository at this point in the history