/srv/irclogs.ubuntu.com/2022/05/18/#ubuntu-security.txt

ahasenackthere is this package, python-bonsai, which has some extensive ldap dep8 tests13:03
ahasenackthe setup it does has slapd logging to /var/log/slapd.log, and it did the famous chmod 777 /var/log for it to work13:03
ahasenackof course I'm changing that, but in debian slapd is not confined via apparmor, in ubuntu it is13:03
ahasenackso I'm doing this, and was wondering if you guys had another pattern for checking if a daemon is confined, and then taking some action: https://pastebin.ubuntu.com/p/Z4g8c36ZWM/13:04
ahasenackthis has to work in debian as well (I want to keep this package a sync)13:04
ahasenackthat /etc/apparmor.d/local/* profile is created by dh_apparmor13:05
ahasenackif it's not there, then this is unlikely ubuntu13:05
ahasenackI have to precreate the log file because slapd runs as openldap:openldap, and can't create files in /var/log13:07
georgiagahasenack: aa-unconfined checks /proc/pid/attr/apparmor/current as you did, and it also falls back to /proc/pid/attr/current when apparmor/current does not exist which I think it's for the case when lsm stacking is not available in the kernel but I'm not 100% sure13:22
ahasenackah, nice13:23
* ahasenack checks aa-unconfined13:23
ahasenackthat's from apparmor-utils, usually not installed by default though13:23
ahasenackI could add a dep on it, just wondering if it would be too much for the debian maintainer13:24
georgiagahasenack: aa-unconfined lists processes using tcp/udp ports that are not confined, I'm not sure if it's what you're looking for13:26
ahasenackI just want to check if slapd is confined, because if it is, then I need to amend the profile to let it write to /var/log/slapd.log13:29
ahasenackI could assume that, if I'm on ubuntu, I should amend the profile always13:29
ahasenackbut then if debian eventually adopts the apparmor profile, the test would fail13:29
ahasenackaa-unconfined looks cleaner though, I'll try that approach, see what the debian maintainer thinks13:30
=== jdstrand_ is now known as jdstrand
ahasenackhm, aa-unconfined isn't that great. I would have to grep its output, and it will only list apps that have open ports18:42
sarnoldahasenack: there's a --paranoid switch which goes through all the pids in /proc18:49
sarnoldahasenack: but yes, it's not that great; it started out to help us prepare for a CTF event and never quite got the attention it deserved :)18:49
sarnoldI suspect georgiag mentioned it more as something to steal from :D18:50
ahasenackI was expecting it to be given a process name, or pid perhaps, and return 0 or 118:50
ahasenackgiven its name18:50
sarnoldah!18:51
georgiagyeah, that was my intention sarnold :)19:02
sarnold\o/19:03

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!