Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

dbus: keep track of enforce state #31

Open
dperpeet opened this issue May 13, 2016 · 3 comments
Open

dbus: keep track of enforce state #31

dperpeet opened this issue May 13, 2016 · 3 comments

Comments

@dperpeet
Copy link
Contributor

It would be nice to receive notification of the enforce state of a system changes.

@bachradsusi pointed out that we can track messages like

type=MAC_STATUS msg=audit(1463128316.149:2098): enforcing=0 old_enforcing=1 auid=4294967295 ses=4294967295

but that feels cumbersome.

@bachradsusi
Copy link
Member

Some time ago I made
http://plautrba.fedorapeople.org/selinux_server_dispatch.tar

There are 2 files:

  • /usr/local/sbin/selinux_server_dispatch.py - it sends org.selinux.mac_status DBUS signal when an MAC_STATUS event comes from audit
  • /etc/audisp/plugins.d/selinux-server-dispatch.conf - audit dispather config files which ensures that audit event will be sent to stdin of selinux_server_dispatch.py. Note: you need to reload auditd after you deploy this files: systemctl reload auditd

This is a preview how we can send signals about SELinux changes. And it's more appropriate to be in SELinux userspace than in setroubleshoot.

@dperpeet
Copy link
Contributor Author

You're right about the SELinux userspace. Thanks for that work!

Do you know off-hand how we could also detect Disabled state (and notify, of course)?

@dperpeet
Copy link
Contributor Author

Also, if we introduce something new, it would be nice to follow the convention of using CamelCase, i.e. in this case I think it would be appropriate to call the object MacStatus.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants