/srv/irclogs.ubuntu.com/2022/08/01/#ubuntu-security.txt

=== ChanServ changed the topic of #ubuntu-security to: Twitter: @ubuntu_sec || https://usn.ubuntu.com || https://wiki.ubuntu.com/SecurityTeam || https://wiki.ubuntu.com/Security/Features || Community: leosilva
ahasenackhi #security, I have an apparmor question. The path for a profile is incorrect: https://git.launchpad.net/ubuntu/+source/apparmor/tree/profiles/apparmor.d/samba-bgqd?h=ubuntu/jammy-devel13:59
ahasenackthe samba-bgqd binary is in /usr/lib/*/samba, not /usr/lib*/samba14:00
ahasenackwe are working on an sru for this (to fix the actual binary placement, not the profile)14:00
ahasenackbut I"m wondering about workarounds users could apply14:00
ahasenackand the question is, is there a way via the "include if exists" line to override this path?14:01
ahasenackI guess in this case no, because the path is in the profile definition as well?14:01
ahasenackvia the include, I could add another line to allow "m" on the correct path, like "/usr/lib/*/samba/samba-bgqd m,", (see line 16)14:01
ahasenackbut what about the (incorrect) path in line 5?14:02
ahasenacknote that this profile is also used in a transition, in which case I think the path in that lint 5 won't matter, because the transition uses the profile name. That transition is in line 40 here: https://git.launchpad.net/ubuntu/+source/apparmor/tree/profiles/apparmor.d/usr.sbin.smbd?h=ubuntu/jammy-devel#n4014:03
ahasenackso the path in the profile name in the former file would just be used if that binary was ran on its own, from elsewhere14:04
ahasenackwhich is a case I would still like to keep14:04
ahasenackalso, kind of related question (sorry!), is there a better globbing for the arch name other than jusr /usr/lib/*/ ?14:05
ahasenackwhich would match x86_64-linux-gnu, and all the other arch names14:05
rbasakahasenack: I think you can use ${DEB_HOST_MULTIARCH} eg. https://salsa.debian.org/pkg-netfilter-team/pkg-libmnl/-/blob/master/debian/libmnl-dev.install14:10
rbasakThat presumably needs a new enough debhelper14:10
rbasakOh, but I'm talking about packaging and you're talking about apparmor.14:11
rbasakSorry!14:11
ahasenackyeah14:11
ahasenackand apparmor can only do simple globbinb afaiak, there are some hilariously weird globbing rules14:12
ahasenackbut I do see this, for example:14:12
ahasenack./usr.lib.snapd.snap-confine.real:    deny /{,usr/}lib{,32,64,x32}/{,@{multiarch}/}libnss_files-[0-9]*.so* mr,                                                                14:12
ahasenackthat @{multiarch} name14:12
ahasenack@{multiarch}=*-linux-gnu*14:15
georgiagahasenack: yes, there's @{multiarch}, so right now you would need to do something like what snapd is doing. there's an old open MR for introducing @{lib}, though so I'll try to see what we can do to unblock that 14:18
ahasenackgeorgiag: why the x32 and x64 options, for other linux distros?14:18
georgiagahasenack: I'm not sure but it would make sense14:20
ahasenackthat @{multiarch} macro might not match on armhf14:25
ahasenackjust checked a jammy armhf host, and it only has /usr/lib/arm-linux-gnueabihf14:25
ahasenackoh, I missed the last *, multiarch would work on armhf too: @{multiarch}=*-linux-gnu*14:36
jjohansenahasenack: so, /usr/lib*/samba/samba-bgqd m, is only mmapping, a workaround for the user would be just to ignore it, it adds extra permissions to that location, but doesn't stop you from adding a rule through include if exits16:55
jjohansenif you want to remove it via the include if exists, you can drop a16:55
jjohansen  deny /usr/lib*/samba/samba-bgqd m,16:55
jjohansendeny rules have higher priority16:55
jjohansenit will effectively room the rule in the main profile when compiled16:56
jjohansenand of course you would drop the correct rule into the include if exists as well16:56
jjohansenthe line 5 profile definition can't be fixed by an include16:57
jjohansenso no simple drop in with editing the base profile file :(16:58
ahasenackok, thanks17:42
=== JanC_ is now known as JanC
=== mbuhl6 is now known as mbuhl
=== eb3095-Vultr_ is now known as eb3095-Vultr
=== codingkoopa6 is now known as codingkoopa

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