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

centos-bootc - cockpit-ws does not work - selinux problems #571

Closed
spmfox opened this issue May 30, 2024 · 6 comments
Closed

centos-bootc - cockpit-ws does not work - selinux problems #571

spmfox opened this issue May 30, 2024 · 6 comments
Labels
area/osintegration Relates to an external OS/distro base image

Comments

@spmfox
Copy link

spmfox commented May 30, 2024

Hello, when trying to use cockpit on centos-bootc, I get this error:

setroubleshoot[1163]: SELinux is preventing /usr/libexec/cockpit-session from using the transition access on a process.
                                                           
                                                           *****  Plugin restorecon_source (99.5 confidence) suggests   *****************
                                                           
                                                           If you want to fix the label. 
                                                           /usr/libexec/cockpit-session default label should be cockpit_session_exec_t.
                                                           Then you can run restorecon.
                                                           Do
                                                           # /sbin/restorecon -v /usr/libexec/cockpit-session

Using bootc usr-overlay, I can do a restorecon (as suggested by setroubleshoot) but this does not fix the problem. It does appear that all of the cockpit related files in /usr have the wrong context. I suspect something is breaking during the installation of cockpit-ws.

I can fix this by doing a dnf reinstall cockpit-ws (with usr-overlay). After the reinstall it seems that all the cockpit files in /usr have the correct context. I have tried doing the restorecon during the container build, however it seems the context is correct because they do not change. Once deployed onto a system, then they are broken. This has me puzzled. The container build machine has selinux set to enforcing.

Containerfile to reproduce this:

FROM quay.io/centos-bootc/centos-bootc:stream9
RUN dnf -y install cockpit cockpit-ws
@spmfox
Copy link
Author

spmfox commented May 30, 2024

Digging in a bit more, it looks like doing the restorecon during the build process will do nothing as the labels are completely different when the container is running.

I found ostreedev/ostree-rs-ext#510

So now I'm wondering if cockpit ships its policy as a binary just like greetd.

@spmfox spmfox changed the title centos-bootc - cockpit does not work - selinux problems centos-bootc - cockpit-ws does not work - selinux problems May 30, 2024
@cgwalters cgwalters added the area/osintegration Relates to an external OS/distro base image label May 30, 2024
@cgwalters
Copy link
Collaborator

Yes, this is a dup of ostreedev/ostree-rs-ext#510

That said, it's probably important enough to have a tracker here too.

@martinpitt
Copy link

Complete tangent: We don't see this in our Cockpit CI image for centos-9-bootc because we don't install cockpit-ws as an RPM there, but as a container. This mostly has historic reasons (it's preferable to do that on CoreOS), but for bootc it'd actually make more sense to include cockpit-ws.rpm right into the OCI image.

@spmfox So perhaps using https://quay.io/repository/cockpit/ws is at least a temporary workaround for you until this gets sorted out.

@spmfox
Copy link
Author

spmfox commented Jun 20, 2024

@martinpitt I was able to get this working, thank you for the information - I was unaware there was a container version of cockpit-ws.

@cgwalters
Copy link
Collaborator

This one should be fixed as of the latest bootc 1.1 - see ostreedev/ostree-rs-ext#669 which bootc 1.1 rolled in.

@spmfox
Copy link
Author

spmfox commented Oct 31, 2024

I can confirm, selinux errors no longer happen.

For anyone else looking at this later - this did not solve the problem for cockpit-ws. Same problem, no selinux errors though. I opened an issue with cockpit now (see above).

cgwalters added a commit to cgwalters/bootc that referenced this issue Nov 5, 2024
…oblem

efi: Gracefully no-op if there's no `BootCurrent`
cgwalters pushed a commit to cgwalters/bootc that referenced this issue Nov 6, 2024
Add convenient API/CLI to prune all content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/osintegration Relates to an external OS/distro base image
Projects
None yet
Development

No branches or pull requests

3 participants