<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On Sun, 03 Sep 2017 13:26:57 +0200 intrigeri
<a class="moz-txt-link-rfc2396E" href="mailto:intrigeri@debian.org"><intrigeri@debian.org></a> wrote:<br>
<br>
> > As I am un-knowledgeable on this matter, can you list all
the LSMs and<br>
> > the way to identify any of them is running?<br>
> <br>
> A trivial way to discover AppArmor was proposed, and a bunch of<br>
> options for SELinux were mentioned as well; no input from the
Tomoyo<br>
> maintainers AFAICT so let's skip that one ⇒ dropping the
moreinfo tag.<br>
> <br>
> Next step is to actually implement this proposal in reportbug
:)<br>
> <br>
> Sandro: at first glance this support could be added to<br>
> /usr/lib/python3/dist-packages/reportbug/bugreport.py, with
actual<br>
> detection functions in utils.py, just like it's done for the
init<br>
> system. Would this approach suit you?<br>
<br>
Regarding the way of detecting SELinux, like I said in my previous
mails, I see 4 ways:<br>
<ol>
<li>Use existing SELinux tools like sestatus, sestatus is
installed in policycoreutils package which has 95% of chances to
be installed if SELinux is enabled on the machine. If reportbug
doesn't need to parse the output, this is probably the easiest
and the lower maintenance level, but it's quite verbose if we
include that in all bug reports.<br>
</li>
<li>Use existing lower-level SELinux tools like selinuxenabled and
getenforce, these tools will more than probably be installed in
the case SELinux is enabled. Not sure if we can get the policy
name in that way though.<br>
</li>
<li>If you don't want to shell out, you could use the python
selinux module to retrieve and display the informations (see my
little example attached) there is however no guarantee that the
python-selinux module is installed if selinux is enabled though.
That means that reportbug will have to Depends/Recommends it.
IMHO this is the most flexible way.</li>
<li>Directly query the selinuxfs and selinux configuration
(/sys/fs/selinux/...), this is maybe too low level.</li>
</ol>
<p>I would probably for 3 if depending on the module is OK and we
just a one line telling: "LMS: SELinux: enabled -
enforcing/permissive - Policy name: foo"<br>
</p>
</body>
</html>