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

Question Regarding "semanage boolean": #418

Closed
mzamenski-devel opened this issue Feb 4, 2024 · 5 comments
Closed

Question Regarding "semanage boolean": #418

mzamenski-devel opened this issue Feb 4, 2024 · 5 comments

Comments

@mzamenski-devel
Copy link

mzamenski-devel commented Feb 4, 2024

Hello, I am a person who wants to dig deeper in selinux policies. I notice semanage booleans are policies that can be enabled/disabled if I'm right. My question is where are these policies even stored on a typical linux system?
I was going to run a virtual machine and tinker with these policies, but I cannot find the policies in a easy way.
@Firstyear and I were discussing this on some discord server. Thank you!

@bachradsusi
Copy link
Member

SELinux notebook - https://github.com/SELinuxProject/selinux-notebook/ - chapter SELinux Configuration Files

@mzamenski-devel
Copy link
Author

Thank you. I will close this.

@Firstyear
Copy link

I'm not sure that this issue should be closed - the typical administrator or user won't know to find this notebook from their system.

While it's nice to solve one persons question with this answer, the question itself points to a broader user interaction issue. That semanage boolean does not adequately or properly communicate what each boolean does to a user, and a user can't find what those booleans do on their own system in isolation.

I don't think it's reasonable to expect every user to somehow search down this thread or something obscure on a mailing list.

What this issue is showing is that there is a need to improve semanage boolean to communicate better about what a boolean will affect on a system, and that those communications must be localised into the semanage boolean tool itself.

@mzamenski-devel
Copy link
Author

I'm not sure that this issue should be closed - the typical administrator or user won't know to find this notebook from their system.

While it's nice to solve one persons question with this answer, the question itself points to a broader user interaction issue. That semanage boolean does not adequately or properly communicate what each boolean does to a user, and a user can't find what those booleans do on their own system in isolation.

I don't think it's reasonable to expect every user to somehow search down this thread or something obscure on a mailing list.

What this issue is showing is that there is a need to improve semanage boolean to communicate better about what a boolean will affect on a system, and that those communications must be localised into the semanage boolean tool itself.

Alright, I shall re-open it. My bad.

@bachradsusi
Copy link
Member

What this issue is showing is that there is a need to improve semanage boolean to communicate better about what a boolean will affect on a system, and that those communications must be localised into the semanage boolean tool itself.

There's semanage boolean -l which lists available SELinux booleans, their current state and their description. The description is taken from /usr/share/selinux/devel/policy.xml and if the file does not exist. the description is generated from a boolean name, see https://github.com/SELinuxProject/selinux/blob/main/python/sepolicy/sepolicy/__init__.py#L1233

/usr/share/selinux/devel/policy.xml is generated from SELinux policy source files by https://github.com/SELinuxProject/refpolicy/blob/main/support/sedoctool.py

If Fedora, /usr/share/selinux/devel/policy.xml is provided by selinux-policy-devel package.

Example:

[root@default-0 tree]# semanage boolean -l | grep selinuxuser_rw_noexattrfile
selinuxuser_rw_noexattrfile    (on   ,   on)  Allow selinuxuser to rw noexattrfile

[root@default-0 tree]# dnf install selinux-policy-devel
...

[root@default-0 tree]# semanage boolean -l | grep selinuxuser_rw_noexattrfile
selinuxuser_rw_noexattrfile    (on   ,   on)  Allow user to r/w files on filesystems that do not have extended attributes (FAT, CDROM, FLOPPY)

If you find policy booleans descriptions insufficient, please report your issue to your SELinux policy provider.

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

No branches or pull requests

3 participants