summaryrefslogtreecommitdiff
path: root/system-helper/org.freedesktop.Flatpak.policy.in
blob: ecbaccb5513bd44a17b1683fea283729d3812560 (plain)
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>

  <!--
    Policy definitions for Flatpak system actions.
    Copyright (c) 2016 Alexander Larsson <alexl@redhat.com>
  -->

  <vendor>The Flatpak Project</vendor>
  <vendor_url>https://github.com/flatpak/flatpak</vendor_url>
  <icon_name>package-x-generic</icon_name>

  <action id="org.freedesktop.Flatpak.app-install">
    <!-- SECURITY:
          - Normal users need admin authentication to install software
            system-wide.
          - Note that we install polkit rules that allow local users
            in the wheel group to install without authenticating.
     -->
    <description>Install signed application</description>
    <message>Authentication is required to install software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.Flatpak.app-update org.freedesktop.Flatpak.runtime-install org.freedesktop.Flatpak.runtime-update</annotate>
  </action>

  <action id="org.freedesktop.Flatpak.runtime-install">
    <!-- SECURITY:
          - Normal users need admin authentication to install software
            system-wide.
          - Note that we install polkit rules that allow local users
            in the wheel group to install without authenticating.
    -->
    <description>Install signed runtime</description>
    <message>Authentication is required to install software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.Flatpak.runtime-update</annotate>
  </action>

  <action id="org.freedesktop.Flatpak.app-update">
    <!-- SECURITY:
          - Normal users do not require admin authentication to update an
            app as the commit will be signed, and the action is required
            to update the system when unattended.
          - Changing this to anything other than 'yes' will break unattended
            updates.
     -->
    <description>Update signed application</description>
    <message>Authentication is required to update software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.Flatpak.runtime-install org.freedesktop.Flatpak.runtime-update</annotate>
  </action>

  <action id="org.freedesktop.Flatpak.runtime-update">
    <!-- SECURITY:
          - Normal users do not require admin authentication to update a
            runtime as the commit will be signed, and the action is required
            to update the system when unattended.
          - Changing this to anything other than 'yes' will break unattended
            updates.
     -->
    <description>Update signed runtime</description>
    <message>Authentication is required to update software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.update-remote">
    <!-- SECURITY:
          - Normal users do not need authentication to update metadata
            from signed repositories.
     -->
    <description>Update remote metadata</description>
    <message>Authentication is required to update remote info</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.modify-repo">
    <!-- SECURITY:
          - Normal users do not need authentication to modify the
            OSTree repository
          - Note that we install polkit rules that allow local users
            in the wheel group to modify repos without authenticating.
     -->
    <description>Update system repository</description>
    <message>Authentication is required to modify a system repository</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.install-bundle">
    <!-- SECURITY:
          - Normal users need admin authentication to install software
            system-wide.
     -->
    <description>Install bundle</description>
    <message>Authentication is required to install software from $(path)</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.Flatpak.runtime-install org.freedesktop.Flatpak.runtime-update</annotate>
  </action>

  <action id="org.freedesktop.Flatpak.runtime-uninstall">
    <!-- SECURITY:
          - Normal users need admin authentication to uninstall software
            system-wide.
          - Note that we install polkit rules that allow local users
            in the wheel group to uninstall without authenticating.
     -->
    <description>Uninstall runtime</description>
    <message>Authentication is required to uninstall software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.app-uninstall">
    <!-- SECURITY:
          - Normal users need admin authentication to uninstall software
            system-wide.
          - Note that we install polkit rules that allow local users
            in the wheel group to uninstall without authenticating.
     -->
    <description>Uninstall app</description>
    <message>Authentication is required to uninstall $(ref)</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.Flatpak.runtime-uninstall</annotate>
  </action>

  <action id="org.freedesktop.Flatpak.configure-remote">
    <!-- SECURITY:
          - Normal users need admin authentication to configure system-wide
            software repositories.
     -->
    <description>Configure Remote</description>
    <message>Authentication is required to configure software repositories</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.configure">
    <!-- SECURITY:
          - Normal users need admin authentication to configure the system-wide
            Flatpak installation.
     -->
    <description>Configure</description>
    <message>Authentication is required to configure software installation</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.appstream-update">
    <!-- SECURITY:
          - Normal users do not require admin authentication to update
            appstream data as it will be signed, and the action is required
            to update the system when unattended.
          - Changing this to anything other than 'yes' will break unattended
            updates.
     -->
    <description>Update appstream</description>
    <message>Authentication is required to update information about software</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.metadata-update">
    <!-- SECURITY:
          - Normal users do not require admin authentication to update
            metadata as it will be signed, and the action is required
            to update the system when unattended.
          - Changing this to anything other than 'yes' will break unattended
            updates.
     -->
    <description>Update metadata</description>
    <message>Authentication is required to update metadata</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.Flatpak.override-parental-controls">
    <!-- SECURITY:
          - Authorisation to actually install software is controlled by
            org.freedesktop.Flatpak.app-install.
          - This action is checked after app-install, as it can only be done
            once the app’s data (including its content rating) has been
            downloaded.
          - This action is checked to see if the installation should be allowed
            based on whether the app being installed has content which doesn’t
            comply with the user’s parental controls policy (the content is
            ‘too extreme’).
          - It is checked only if an app has too extreme content for the user
            who is trying to install it (in which case, the app is ‘unsafe’).
          - Typically, normal users will need admin permission to install apps
            with extreme content; admins will be able to install it without
            additional checks.
          - In order to configure the policy so that admins can install safe and
            unsafe software anywhere without authorisation, and non-admins can
            install safe software in their user or system dirs without
            authorisation, but need authorisation to install unsafe software
            anywhere:
             * Unconditionally return `yes` from `app-install`.
             * Return `auth_admin` from `override-parental-controls` for users
               not in `@privileged_group@`, and `yes` for users in it.
             * Set the malcontent `is-{user,system}-installation-allowed`
               properties of all non-admins’ parental controls policies to true.
          - In order to configure the policy so that admins can install safe and
            unsafe software anywhere without authorisation, and non-admins can
            install safe software in their user dir without authorisation, but
            need authorisation to install safe software in the system dir or to
            install unsafe software anywhere:
             * Unconditionally return `yes` from `app-install`.
             * Return `auth_admin` from `override-parental-controls` for users
               not in `@privileged_group@`, and `yes` for users in it.
             * Set the malcontent `is-user-installation-allowed` property of all
               non-admins’ parental controls policies to true.
             * Set the malcontent `is-system-installation-allowed` property of
               all non-admins’ parental controls policies to false.
          - In order to configure the policy so that all users (including
            admins) can install safe software anywhere without authorisation,
            but need authorisation to install unsafe software anywhere (i.e.
            applying parental controls to admins too):
             * Unconditionally return `yes` from `app-install`.
             * Unconditionally return `auth_admin` from `override-parental-controls`.
             * Set the malcontent `is-user-installation-allowed` property of all
               users’ parental controls policies to true.
             * Set the malcontent `is-system-installation-allowed` property of
               all users’ parental controls policies to true.
     -->
    <description>Override parental controls</description>
    <message>Authentication is required to install software which is restricted by your parental controls policy</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
  </action>

</policyconfig>