Hallo kB,
danke für Deine Tipps!
Für LibreOffice gibt es "irgendwo" auch fertige Apparmor-Profile, die man, um IPv4 und IPv6 zu blockieren, um folgende Einträge ergänzen müsste:
deny network inet, # deny IPv4
deny network inet6, # deny IPv6
Und natürlich müssen sie in apparmor-enforce laufen, sonst hilft das nicht.
Alternativ habe ich ein absolut billiges apparmor-Profil geschrieben, das nur dazu da ist, inet und inet6 zu blocken. Läuft es in apparmor-enforce, ist auf meinem System die Datei dann in calc noch auslesbar, im gestarteten lokalen Server nicht. Kannst Du das auf Deinen System bestätigen? Und funktioniert LibreOffice dann noch vernünftig?
Dateipfad im Profil muss stimmen, sonst geht es nicht.
/usr/lib{,32,64}/libreoffice/program/soffice.bin
Das beinhaltet:
/usr/lib/libreoffice/program/soffice.bin
/usr/lib64/libreoffice/program/soffice.bin
/usr/lib32/libreoffice/program/soffice.bin
Wenn die soffice.bin woanders liegt, müsste der Pfad im Profil angepasst werden.
Hier das Profil, ich habe es aber so gut wie gar nicht getestet:
# for ubuntuusers.de
# profile is worth nothing, it only blocks IPv4 and IPv6 if set to enforce
# please take some look in your logfiles due to apparmor audit and denied messages
# if application is jailed, you probably have to add this profile flag: flags=(attach_disconnected)
/usr/lib{,32,64}/libreoffice/program/soffice.bin {
# /usr/lib{,32,64}/libreoffice/program/soffice.bin flags=(attach_disconnected) {
/{,**} rwmklix, # full access to file system, but keeps every startet executable within this profile (due to ix)
dbus, # full access to dbus
ptrace, # full access to ptrace
signal, # full access to signal
unix, # full access to unix
network netlink raw, # necessary, probably for unix sockets
deny network inet, # deny IPv4
deny network inet6, # deny IPv6
audit capability, # full access to capability, except denied capabilities below, access will be logged
# should not be in a profile which blocks internet, but if necessary for the application it's worth to allow it and check if there is still no access to the internet
audit deny capability net_admin,
audit deny capability net_bind_service,
audit deny capability net_broadcast,
audit deny capability net_raw,
audit deny capability sys_admin, # potential dangerous capability, but some applications need it
# NEVER allow these capabilities
deny capability mac_admin,
deny capability mac_override,
}