<div dir="ltr"><div>It is exactly as you said: I didn't remember that following sshguard guide I customized syslog-ng config and this caused that chain of calls. So I need to customize syslog-ng profile too, if I want to enable it.</div><div>Thanks<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 29 ott 2020 alle ore 22:25 Christian Boltz <<a href="mailto:debian-bugs@cboltz.de">debian-bugs@cboltz.de</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Am Donnerstag, 29. Oktober 2020, 12:43:08 CET schrieb Lorenzo Iannuzzi:<br>
> apparmor="ALLOWED" operation="open" profile="syslog-<br>
> ng//null-/bin/dash//null-/usr/sbin/sshguard//null-/bin/journalctl"<br>
<br>
This is interesting[tm] - syslog-ng executed dash, which then executed <br>
sshguard, which executed journalctl.<br>
<br>
That looks like a funny way to read from the journal...<br>
<br>
> name="/run/log/journal/ccca544565cf1834599ef913deceef00/system.journal<br>
> " pid=6749 comm="journalctl" requested_mask="r" denied_mask="r"<br>
> fsuid=0 ouid=0<br>
> <br>
> I can see some rules from profile that should permit the access to<br>
> that file:<br>
>   /{var,var/run,run}/log/journal/ r,<br>
>   /{var,var/run,run}/log/journal/*/ r,<br>
>   /{var,var/run,run}/log/journal/*/*.journal r,<br>
<br>
Right, but there are no rules that allow to execute dash, sshguard and <br>
journalctl.<br>
<br>
> and if I disable and enable again the profile (with aa-disable and<br>
> aa-complain) log messages doesn't show anymore.<br>
<br>
aa-disable unloads the profile from the kernel, which also means that <br>
running processes become unconfined.<br>
<br>
aa-complain loads the profile again (in complain mode), but it can't <br>
apply it to running processes, so they stay unconfined (until you <br>
restart them).<br>
<br>
Note that this probably only affects the syslog-ng profile, not the <br>
processes running under the syslog-ng//null-* profiles.<br>
<br>
The better way is to use only aa-complain, which will switch the profile <br>
to complain mode and leave running processes confined.<br>
<br>
> Why those log are shown on boot, but disappear after I reload the<br>
> syslog-ng profile?<br>
<br>
See above, it's probably because you first unload the profile with aa-<br>
disable and then have syslog-ng running unconfined.<br>
<br>
Can you please check if there are processes running under a profile <br>
starting with "syslog-ng"? You can do this with<br>
    ps Zaux | grep ^syslog-ng<br>
Ideally check it before and after reloading the profiles.<br>
Also restart syslog-ng and check again.<br>
<br>
Also, do fresh log messages appear if you restart syslog-ng?<br>
<br>
Bonus question: Do you have a non-default syslog-ng config that could <br>
explain the exec chain I mentioned at the beginning?<br>
<br>
<br>
Regards,<br>
<br>
Christian Boltz<br>
-- <br>
> Would it be ok to just switch all build sections to use lua?<br>
> Probably much faster than the shells anyway :-P<br>
Yast team has experience in converting strange languages to<br>
each other - they can cook something! :)<br>
[> Stefan Seyfried and Stephan Kulow in opensuse-factory]<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Lorenzo Iannuzzi<br></div></div>