17778: Merge branch 'master' into 17778-doc-update
[arvados.git] / doc / admin / restricting-upload-download.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: Restricting upload or download
5 ...
6
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 For some use cases, you may want to limit the ability of users to upload or download data from outside the cluster.  (By "outside" we mean from networks other than the cluster's own private network).  For example, this makes it possible to share restricted data sets with users so that they may run their own data analysis on the cluster, while preventing them from easily downloading the data set to their local workstation.
14
15 This feature exists in addition to the existing Arvados permission system.  Users can only download from collections they have @read@ access to, and can only upload to projects and collections they have @write@ access to.
16
17 There are two services involved in accessing data from outside the cluster.
18
19 h2. Keepproxy Permissions
20
21 Permitting @keeproxy@ makes it possible to use @arv-put@ and @arv-get@, and upload from Workbench 1.  It works in terms of individual 64 MiB keep blocks.  It prints a log each time a user uploads or downloads an individual block.
22
23 The default policy allows anyone to upload or download.
24
25 <pre>
26     Collections:
27       KeepproxyPermission:
28         User:
29           Download: true
30           Upload: true
31         Admin:
32           Download: true
33           Upload: true
34 </pre>
35
36 If you create a sharing link as an admin user, and then give someone the token from the sharing link to download a file using @arv-get@, because the downloader is anonymous, the download permission will be restricted based on the "User" role and not the "Admin" role.
37
38 h2. WebDAV and S3 API Permissions
39
40 Permitting @WebDAV@ makes it possible to use WebDAV, S3 API, download from Workbench 1, and upload/download with Workbench 2.  It works in terms of individual files.  It prints a log each time a user uploads or downloads a file.  When @WebDAVLogEvents@ (default true) is enabled, it also adds an entry into the API server @logs@ table.
41
42 When a user attempts to upload or download from a service without permission, they will receive a @403 Forbidden@ response.  This only applies to file content.
43
44 Denying download permission does not deny access to access to XML file listings with PROPFIND, or auto-generated HTML documents containing file listings.
45
46 Denying upload permission does not deny other operations that modify collections without directly accessing file content, such as MOVE and COPY.
47
48 The default policy allows anyone to upload or download.
49
50 <pre>
51     Collections:
52       WebDAVPermisison:
53         User:
54           Download: true
55           Upload: true
56         Admin:
57           Download: true
58           Upload: true
59       WebDAVLogEvents: true
60 </pre>
61
62 If you create a sharing link as an admin user, and then give someone the token from the sharing link to download a file over HTTP (WebDAV or S3 API), because the downloader is anonymous, the download permission will be restricted based on the "User" role and not the "Admin" role.
63
64 h2. Shell node and container permissions
65
66 Be aware that even when upload and download from outside the network is not allowed, a user who has access to a shell node or runs a container still has internal access to Keep.  (This is necessary to be able to run workflows).  From the shell node or container, a user could send data outside the network by some other method, although this requires more intent than accidentally clicking on a link and downloading a file.  It is possible to set up a firewall to prevent shell and compute nodes from making connections to hosts outside the private network.  Exactly how to configure firewalls is out of scope for this page, as it depends on the specific network infrastructure of your cluster.
67
68 h2. Choosing a policy
69
70 This distinction between WebDAV and Keepproxy is important for auditing.  WebDAV records 'upload' and 'download' events on the API server that are included in the "User Activity Report":user-activity.html ,  whereas @keepproxy@ only logs upload and download of individual blocks, which require a reverse lookup to determine the collection(s) and file(s) a block is associated with.
71
72 You set separate permissions for @WebDAV@ and @Keepproxy@, with separate policies for regular users and admin users.
73
74 These policies apply to only access from outside the cluster, using Workbench or Arvados CLI tools.
75
76 The @WebDAVLogEvents@ option should be enabled if you intend to the run the "User Activity Report":user-activity.html .  If you don't need audits, or you are running a site that is mostly serving public data to anonymous downloaders, you can disable in to avoid the extra API server request.
77
78 h3. Audited downloads
79
80 For ease of access auditing, this policy prevents downloads using @arv-get@.  Downloads through WebDAV and S3 API are permitted, but logged.  Uploads are allowed.
81
82 <pre>
83     Collections:
84       WebDAVPermisison:
85         User:
86           Download: true
87           Upload: true
88         Admin:
89           Download: true
90           Upload: true
91
92       KeepproxyPermission:
93         User:
94           Download: false
95           Upload: true
96         Admin:
97           Download: false
98           Upload: true
99       WebDAVLogEvents: true
100 </pre>
101
102 h3. Disallow downloads by regular users
103
104 This policy prevents regular users (non-admin) from downloading data.  Uploading is allowed.  This supports the case where restricted data sets are shared with users so that they may run their own data analysis on the cluster, while preventing them from downloading the data set to their local workstation.  Be aware that users won't be able to download the results of their analysis, either, requiring an admin in the loop or some other process to release results.
105
106 <pre>
107     Collections:
108       WebDAVPermisison:
109         User:
110           Download: false
111           Upload: true
112         Admin:
113           Download: true
114           Upload: true
115
116       KeepproxyPermission:
117         User:
118           Download: false
119           Upload: true
120         Admin:
121           Download: true
122           Upload: true
123       WebDAVLogEvents: true
124 </pre>
125
126 h3. Disallow uploads by regular users
127
128 This policy is suitable for an installation where data is being shared with a group of users who are allowed to download the data, but not permitted to store their own data on the cluster.
129
130 <pre>
131     Collections:
132       WebDAVPermisison:
133         User:
134           Download: true
135           Upload: false
136         Admin:
137           Download: true
138           Upload: true
139
140       KeepproxyPermission:
141         User:
142           Download: true
143           Upload: false
144         Admin:
145           Download: true
146           Upload: true
147       WebDAVLogEvents: true
148 </pre>