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

[Linux] nyanpasu-service install is not compatible with SELinux #107

Open
latin-1 opened this issue Dec 28, 2024 · 3 comments
Open

[Linux] nyanpasu-service install is not compatible with SELinux #107

latin-1 opened this issue Dec 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@latin-1
Copy link

latin-1 commented Dec 28, 2024

By default, files in /var/lib are labelled with the type var_lib_t, which cannot be launched by a systemd service. The service binary should be labelled as type bin_t.

If SELinux detected, those additional commands should be executed after file installation.

sudo semanage fcontext -a -t bin_t /var/lib/nyanpasu-service/nyanpasu-service
sudo restorecon /var/lib/nyanpasu-service/nyanpasu-service

Alternatively, shall we use /usr/bin/nyanpasu-service rather than installing it to /var/lib, if possible? (/usr/bin/nyanpasu-service binary is already included in the rpm package)

See: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files

@latin-1 latin-1 changed the title [Linux] nyanpasu-install is not compatible with SELinux [Linux] nyanpasu-service install is not compatible with SELinux Dec 28, 2024
@latin-1 latin-1 changed the title [Linux] nyanpasu-service install is not compatible with SELinux [Linux] nyanpasu-service install is not compatible with SELinux Dec 28, 2024
@greenhat616 greenhat616 added the bug Something isn't working label Jan 2, 2025
@greenhat616 greenhat616 self-assigned this Jan 2, 2025
@greenhat616
Copy link
Collaborator

As the description, is it enough that put the service binary below /usr/bin?

@latin-1
Copy link
Author

latin-1 commented Jan 4, 2025

@greenhat616 Yes, by default, the file labels are inherited from the parent folder. /usr/bin definitely has the bin_t label. However, if the file already exists (e.g. installed from the rpm package), it should not be overwritten.

@greenhat616
Copy link
Collaborator

greenhat616 commented Jan 8, 2025

I have released v1.1.1 with that got fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants