feat(abs): add abstraction/webkit.

This commit is contained in:
Alexandre Pujol 2024-11-21 19:53:24 +00:00
parent 33a66ef6a2
commit 36d787fa44
Failed to generate hash of commit
3 changed files with 33 additions and 29 deletions

View file

@ -0,0 +1,31 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
# Minimal set of rules for webkit UI.
abi <abi/4.0>,
mount options=(rw rbind) /bindfile@{rand6} -> /newroot/.flatpak-info,
@{bin}/xdg-dbus-proxy rix,
@{lib}/{,@{multiarch}/}webkit{2,}gtk-*/WebKitNetworkProcess rix,
@{lib}/{,@{multiarch}/}webkit{2,}gtk-*/WebKitWebProcess rix,
owner /bindfile@{rand6} rw,
owner @{att}/.flatpak-info r,
owner @{run}/user/@{uid}/.dbus-proxy/{system,session,a11y}-bus-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/.flatpak/ w,
owner @{run}/user/@{uid}/.flatpak/webkit-*/{,bwrapinfo.json} rw,
owner @{run}/user/@{uid}/webkitgtk/ w,
owner @{run}/user/@{uid}/webkitgtk/a11y-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/bus-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/dbus-proxy-@{rand6} rw,
include if exists <abstractions/webkit.d>
# vim:syntax=apparmor

View file

@ -19,6 +19,7 @@ profile epiphany @{exec_path} flags=(attach_disconnected) {
include <abstractions/p11-kit>
include <abstractions/ssl_certs>
include <abstractions/user-download-strict>
include <abstractions/webkit>
capability dac_override,
@ -28,21 +29,14 @@ profile epiphany @{exec_path} flags=(attach_disconnected) {
network inet6 stream,
network netlink raw,
mount options=(rw rbind) /bindfile@{rand6} -> /newroot/.flatpak-info,
@{exec_path} mr,
@{open_path} rPx -> child-open,
@{bin}/bwrap rix,
@{bin}/xdg-dbus-proxy rix,
@{lib}/{,@{multiarch}/}webkit{,2}gtk-*/WebKit{Web,Network}Process rix,
/usr/share/enchant*/{,**} r,
owner /bindfile@{rand6} rw,
owner @{att}/.flatpak-info r,
owner @{user_config_dirs}/glib-2.0/ w,
owner @{user_config_dirs}/glib-2.0/settings/ w,
@ -51,14 +45,6 @@ profile epiphany @{exec_path} flags=(attach_disconnected) {
owner @{tmp}/Serialized@{rand9} rw,
owner @{tmp}/WebKit-Media-@{rand6} rw,
owner @{run}/user/@{uid}/.dbus-proxy/{system,session,a11y}-bus-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/.flatpak/ w,
owner @{run}/user/@{uid}/.flatpak/webkit-*/{,bwrapinfo.json} rw,
owner @{run}/user/@{uid}/webkitgtk/ w,
owner @{run}/user/@{uid}/webkitgtk/a11y-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/bus-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/dbus-proxy-@{rand6} rw,
@{sys}/devices/virtual/dmi/id/chassis_type r,
@{sys}/firmware/acpi/pm_profile r,
@{sys}/fs/cgroup/user.slice/user-@{uid}.slice/user@@{uid}.service/app.slice/app-gnome-org.gnome.Epiphany-@{int}.scope/memory.* r,

View file

@ -15,6 +15,7 @@ profile foliate @{exec_path} flags=(attach_disconnected) {
include <abstractions/p11-kit>
include <abstractions/ssl_certs>
include <abstractions/user-download-strict>
include <abstractions/webkit>
capability dac_override,
@ -30,31 +31,17 @@ profile foliate @{exec_path} flags=(attach_disconnected) {
@{bin}/bwrap rix,
@{bin}/gjs-console rix,
@{bin}/xdg-dbus-proxy rix,
@{bin}/speech-dispatcher rPx,
@{open_path} rPx -> child-open-help,
@{lib}/{,@{multiarch}/}webkit{2,}gtk-*/WebKitNetworkProcess rix,
@{lib}/{,@{multiarch}/}webkit{2,}gtk-*/WebKitWebProcess rix,
/usr/share/com.github.johnfactotum.Foliate/{,**} r,
owner /bindfile@{rand6} rw,
owner /.flatpak-info r,
owner @{user_books_dirs}/{,**} r,
owner @{user_torrents_dirs}/{,**} r,
owner @{user_cache_dirs}/com.github.johnfactotum.Foliate/{,**} rwlk,
owner @{user_share_dirs}/com.github.johnfactotum.Foliate/{,**} rwlk,
owner @{run}/user/@{uid}/.flatpak/ w,
owner @{run}/user/@{uid}/.flatpak/webkit-*/{,bwrapinfo.json} rw,
owner @{run}/user/@{uid}/webkitgtk/ w,
owner @{run}/user/@{uid}/webkitgtk/a11y-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/bus-proxy-@{rand6} rw,
owner @{run}/user/@{uid}/webkitgtk/dbus-proxy-@{rand6} rw,
@{sys}/devices/virtual/dmi/id/chassis_type r,
@{sys}/fs/cgroup/user.slice/user-@{uid}.slice/user@@{uid}.service/app.slice/app-dbus*org.gnome.Nautilus.slice/dbus*org.gnome.Nautilus@*.service/memory.* r,
@{sys}/fs/cgroup/user.slice/user-@{uid}.slice/user@@{uid}.service/app.slice/app-gnome-com.github.johnfactotum.Foliate-@{int}.scope/memory.* r,