-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusr.bin.ristretto
182 lines (150 loc) · 5.97 KB
/
usr.bin.ristretto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# vim:syntax=apparmor
#include <tunables/global>
#include <tunables/3rd/exts-image>
#@{more_exts} = [xX][xX][xX]
# adjust in local; /home already included except dotfiles
@{RISTRETTO_DIRS_RO} = /usr/share
@{RISTRETTO_DIRS_RW} = /var/local /media /mnt /tmp
@{RISTRETTO_EXTS} = @{IMAGE_EXTS}
@{RISTRETTO_EXTS_SILENCED} = [hH][tT][mM]
@{RISTRETTO_EXTS_SILENCED} += [hH][tT][mM][lL]
#include if exists <local/tunables/3rd/usr.bin.ristretto>
profile ristretto /usr/bin/ristretto {
/usr/bin/ristretto r,
#include <abstractions/base>
#include <abstractions/dbus-session-strict>
#include <abstractions/dbus-accessibility-strict>
#include <abstractions/X>
#include <abstractions/fonts>
#include <abstractions/freedesktop.org>
#include <abstractions/private-files>
#include <abstractions/private-files-strict>
# #include <abstractions/gnome> # relaxed with large footprint
#include if exists <abstractions/3rd/file-chooser_ristretto>
#include if exists <abstractions/3rd/network-allow_ristretto> # pictures on smb shares, etc
@{RISTRETTO_DIRS_RO}/{,**/} r, # read dirs
@{RISTRETTO_DIRS_RO}/**.@{RISTRETTO_EXTS} r, # read files
@{RISTRETTO_DIRS_RW}/{,**/} r,
@{RISTRETTO_DIRS_RW}/**.@{RISTRETTO_EXTS} rwk, # write files (=delete)
owner @{HOME}/{,[^.]*,**/} r, # dirs, but not dotdirs
owner @{HOME}/[^.]{,**/}*.@{RISTRETTO_EXTS} rwk, # files, but not dotfiles
owner /{,var/}run/user/[0-9]*/gvfs/{,**/} r, # USB storage
owner /{,var/}run/user/[0-9]*/gvfs/**.@{RISTRETTO_EXTS} rwk,
owner @{HOME}/.cache/.fr-*/{,**/} r, # file roller
owner @{HOME}/.cache/.fr-*/**.@{RISTRETTO_EXTS} r,
owner @{HOME}/.cache/thumbnails/{,**} r,
deny /**.@{RISTRETTO_EXTS_SILENCED} r,
# Trashing; dirs must exist
owner @{HOME}/.local/share/Trash/**.@{RISTRETTO_EXTS}{,.trashinfo}{,.??????} rwk,
owner @{HOME}/.local/share/gvfs-metadata/** r,
owner @{HOME}/.config/ristretto/{,**} rwk,
owner @{HOME}/.local/share/ristretto/{,**} rwk,
deny @{HOME}/.local/share/ r,
deny @{HOME}/.xsession-errors r,
deny @{HOME}/.xfce4-session.verbose-log{,.last} r,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/{mountinfo,mounts} r,
/{,var/}run/mount/utab r,
/etc/magic r,
/usr/share/xfce[3-5]/applications/mimeinfo.cache r,
/etc/xfce[0-9]/defaults.list r,
/usr/share/*ubuntu/applications/defaults.list r,
/usr/share/themes/** r,
/var/lib/snapd/desktop/icons/ r,
owner /tmp/dbus-* rw,
# gnome-tiny
/etc/gnome/defaults.list r,
/etc/gtk-[0-9].[0-9]*/settings.ini r,
# edit button; comment out for significantly less footprint
/{,usr/}bin/dash rPx -> ristretto_opener, # Ubuntu
/usr/lib/@{multiarch}/glib-[0-9].[0-9]*/gio-launch-desktop rPx -> ristretto_opener, # Debian
dbus (send, receive)
bus="session"
path="/org/freedesktop/thumbnails/Thumbnailer1"
interface="org.freedesktop.thumbnails.Thumbnailer1"
member="{Started,Ready,Finished,Queue,Dequeue,Error}"
peer=(name=:*),
dbus send
bus="session"
path="/org/freedesktop/thumbnails/Thumbnailer1"
interface="org.freedesktop.DBus.Properties"
member="GetAll"
peer=(name=:*),
dbus send
bus="session"
path="/org/xfce/Xfconf"
interface="org.xfce.Xfconf"
member="{GetAll,GetAllProperties,GetProperty,SetProperty}"
peer=(name=:*),
dbus receive
bus="session"
path="/org/xfce/Xfconf"
interface="org.xfce.Xfconf"
member="PropertyChanged"
peer=(name=:*),
dbus send
bus="session"
path="/org/xfce/Xfconf"
interface="org.freedesktop.DBus.Properties"
member="GetAll"
peer=(name=:*),
dbus send
bus="session"
path="/org/xfce/FileManager"
interface="org.freedesktop.DBus.Properties"
member="GetAll"
peer=(name=:*),
dbus send
bus="session"
path="/org/xfce/FileManager"
interface="org.xfce.FileManager"
member="DisplayFileProperties"
peer=(name=:*),
dbus send
bus="accessibility"
path="/org/a11y/atspi/registry/deviceeventcontroller"
interface="org.a11y.atspi.DeviceEventController"
member="{GetDeviceEventListeners,GetKeystrokeListeners}"
peer=(name=org.a11y.atspi.Registry),
dbus send
bus="accessibility"
path="/org/a11y/atspi/registry"
interface="org.a11y.atspi.Registry"
member="GetRegisteredEvents"
peer=(name=org.a11y.atspi.Registry),
dbus receive
bus="accessibility"
path="/org/a11y/atspi/registry"
interface="org.a11y.atspi.Registry"
member="EventListenerDeregistered"
peer=(name=:*),
dbus send
bus="accessibility"
path="/org/a11y/atspi/accessible/root"
interface="org.a11y.atspi.Socket"
member="Embed"
peer=(name=org.a11y.atspi.Registry),
dbus receive
bus="accessibility"
path="/org/a11y/atspi/accessible/root"
interface="org.freedesktop.DBus.Properties"
member="Set"
peer=(name=:*),
deny dbus send
bus="session"
path="/org/gtk/vfs/mounttracker"
interface="org.gtk.vfs.MountTracker"
member="ListMountableInfo"
peer=(name=:*),
#include if exists <local/usr.bin.ristretto>
}
profile ristretto_opener {
/{,usr/}bin/dash r,
#include <abstractions/base>
#include <abstractions/ubuntu-helpers>
#include <abstractions/private-files>
#include <abstractions/private-files-strict>
# sanitized, slightly less bad than Ux; "Use at your own risk."
/usr/bin/gimp-[2-3].[0-9]{,[0-9]} Cx -> sanitized_helper,
#include if exists <local/usr.bin.ristretto_dash>
}