summaryrefslogtreecommitdiff
path: root/doc/spec/hal-spec-access-control.xml
blob: 1846d377f8a3b96efe1586e4731ffe9328867fd7 (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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<chapter id="access-control">
  <title>Access Control</title>

  <para>
    Access to hardware by unprivileged users is traditionally granted
    in two ways either by granting access to the <emphasis>special
    device file</emphasis> or allowing access through another process,
    using IPC acting on behalf of the user. HAL follows the latter
    model and uses the system-wide message bus (D-Bus) as the IPC
    mechanism. In addition, HAL has support for modifying the ACL's
    (access control lists) on a device file to grant/revoke access to
    users based on several criteria.
  </para>

  <sect1 id="access-control-device-file">
    <title>Device Files</title>
    <para>
      If HAL is built with <literal>--enable-acl-management</literal>
      (requires both <literal>--enable-console-kit</literal>
      and <literal>--enable-policy-kit</literal>) then ACL's on device
      objects with the capability <literal>access_control</literal>
      are automatically managed according to the properties defined in
      <xref linkend="device-properties-access-control"/>. In addition,
      for this configuration, HAL ships with a device information file
      (normally installed in
      <literal>/usr/share/hal/fdi/policy/10osvendor/20-acl-management.fdi</literal>)
      that merges this capability on device objects that are normally
      accessed by unprivileged users through the device file. This
      includes e.g. sound cards, webcams and other devices but
      excludes drives and volumes as the latter two are normally
      accessed by a user through mounting them into the file system.
    </para>
    <para>
      HAL uses PolicyKit to decide what users should have access
      according to PolicyKit configuration; see the PolicyKit
      privilege definition
      file <literal>/usr/share/PolicyKit/policy/org.freedesktop.hal.device-access.policy</literal>
      on a system with HAL installed for the default access suggested
      by the HAL package and/or OS vendor.
    </para>
    <para>
      In addition, 3rd party packages can supply device information
      files to specify (via
      the <literal>access_control.grant_user</literal>
      and <literal>access_control.grant_group</literal> properties)
      that a given user or group should always have access to a device
      file. This is useful for system-wide software (such as AV
      streaming management) that runs as an unprivileged system
      user. This interface is supposed to be stable so 3rd party
      packages can depend on it.
    </para>

      <sect2 id="access-control-device-file-policies">
        <title>Device Files policies</title>
	<para>
          This is a list of the device file policies/rules delivered with
	  the HAL package to manage ACL's as defined via <literal>
	  access_control.type</literal> and the current default Policykit
	  policies for inactive and active users.
        </para>
	<informaltable>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>Type</entry>
              <entry>Description</entry>
              <entry>allow_inactive</entry>
              <entry>allow_active</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <literal>audio-player</literal>
              </entry>
              <entry>Directly access audio players.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>camera</literal>
              </entry>
              <entry>Directly access digital cameras.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>cdrom</literal>
              </entry>
              <entry>Directly access optical drives.</entry>
	      <entry>yes</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>dvb</literal>
              </entry>
              <entry>Directly access DVB devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>fingerprint-reader</literal>
              </entry>
              <entry>Directly access to fingerprint reader devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>floppy</literal>
              </entry>
              <entry>Directly access Floppy devices.</entry>
	      <entry>yes</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>ieee1394-avc</literal>
              </entry>
              <entry>Directly access Firewire AVC devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>ieee1394-iidc</literal>
              </entry>
              <entry>Directly access Firewire IIDC devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>smart-card-reader</literal>
              </entry>
              <entry>Directly access Smart Card Reader security devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>joystick</literal>
              </entry>
              <entry>Directly access Joystick devices.</entry>
	      <entry>yes</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>modem</literal>
              </entry>
              <entry>Directly access serial modem devices.</entry>
	      <entry>auth_admin_keep_always</entry>
	      <entry>auth_admin_keep_always</entry>
            </row>
            <row>
              <entry>
                <literal>mouse</literal>
              </entry>
              <entry>Directly access Mouse (input) devices</entry>
	      <entry>yes</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>obex</literal>
              </entry>
              <entry>Directly access OBEX devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>pda</literal>
              </entry>
              <entry>Directly access PDA devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>ppdev</literal>
              </entry>
              <entry>Directly access parallel port devices.</entry>
	      <entry>auth_admin_keep_always</entry>
	      <entry>auth_admin_keep_always</entry>
            </row>
            <row>
              <entry>
                <literal>printer</literal>
              </entry>
              <entry>Directly access printer devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>removable-block</literal>
              </entry>
              <entry>Directly access removable block devices.</entry>
	      <entry>no</entry>
	      <entry>no</entry>
            </row>
            <row>
              <entry>
                <literal>scanner</literal>
              </entry>
              <entry>Directly access scanners.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>sound</literal>
              </entry>
              <entry>Directly access sound devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>video</literal>
              </entry>
              <entry>Directly access Video devices.</entry>
	      <entry>yes</entry>
	      <entry>yes</entry>
            </row>
            <row>
              <entry>
                <literal>video4linux</literal>
              </entry>
              <entry>Directly access video capture devices.</entry>
	      <entry>no</entry>
	      <entry>yes</entry>
            </row>
          </tbody>
        </tgroup>
        </informaltable>
      </sect2>

  </sect1>

  <sect1 id="access-control-ipc">
    <title>D-Bus Interfaces</title>
    <para>
      If HAL is built without ConsoleKit support
      (e.g. without <literal>--enable-console-kit</literal>) access to
      the various D-Bus interfaces that provides mechanisms is only
      protected by the D-Bus security configuration files
      (e.g. using <literal>at_console</literal> to restrict to console
      user on Red Hat systems) and, in certain cases, restricted to
      the super user.
    </para>
    <para>
      If ConsoleKit support is enabled, access to D-Bus interfaces is
      currently hardcoded to only allow active users at the system
      console. If PolicyKit support is enabled, the PolicyKit library
      will be in charge of determining access; see the PolicyKit
      privilege definition files
      in <literal>/etc/PolicyKit/privileges</literal> on a system with
      HAL installed for the default access suggested by the HAL
      package and/or OS vendor.
    </para>
  </sect1>

</chapter>