annotate Sphinx/source/plugins/object-storage.rst @ 464:5ea70331c0be

AWS Endpoint doc
author Alain Mazy <alain@mazy.be>
date Thu, 09 Jul 2020 11:15:28 +0200
parents fae16ea8b13c
children d255e02eb89d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
1 .. _object-storage:
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
2
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
3
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
4 Cloud Object Storage plugins
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
5 ============================
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
6
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
7 .. contents::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
8
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
9
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
10 Introduction
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
11 ------------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
12
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
13 Osimis freely provides the `source code
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
14 <https://hg.orthanc-server.com/orthanc-object-storage/file/default/>`__ of 3 plugins
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
15 to store the Orthanc files in `Object Storage <https://en.wikipedia.org/wiki/Object_storage>`__
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
16 at the 3 main providers: `AWS <https://aws.amazon.com/s3/>`__,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
17 `Azure <https://azure.microsoft.com/en-us/services/storage/blobs/>`__ &
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
18 `Google Cloud <https://cloud.google.com/storage>`__
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
20 Storing Orthanc files in object storage and your index SQL in a
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
21 managed database allows you to have a stateless Orthanc that does
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
22 not store any data in its local file system which is highly recommended
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23 when deploying an application in the cloud.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
24
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
25
459
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
26 Pre-compiled binaries
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
27 ---------------------
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
28
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
29 These plugins are used to interface Orthanc with commercial and
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
30 proprietary cloud services that you accept to pay. As a consequence,
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
31 the Orthanc project doesn't freely provide pre-compiled binaries for
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
32 Docker, Windows, Linux or OS X. These pre-compiled binaries do exist,
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
33 but are reserved to the companies who have subscribed to a
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
34 `professional support contract
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
35 <https://www.osimis.io/en/services.html#cloud-plugins>`__ by
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
36 Osimis. Although you are obviously free to compile these plugins by
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
37 yourself (instructions are given below), purchasing such support
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
38 contracts makes the Orthanc project sustainable in the long term, to
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
39 the benefit of the worldwide community of medical imaging.
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
40
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
41
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
42 Compilation
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
43 -----------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
44
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
45 .. highlight:: text
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
46
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
47 The procedure to compile the plugins is quite similar of that for the
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
48 :ref:`core of Orthanc <compiling>` although they usually require
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
49 some prerequisites. The documented procedure has been tested only
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
50 on a Debian Buster machine.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
51
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
52 The compilation of each plugin produces a shared library that contains
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
53 the plugin.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
54
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
55
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
56 AWS S3 plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
57 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
58
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
59 Prerequisites: Compile the AWS C++ SDK::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
60
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
61 $ mkdir ~/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
62 $ cd ~/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
63 $ git clone https://github.com/aws/aws-sdk-cpp.git
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
64 $
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
65 $ mkdir -p ~/aws/builds/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
66 $ cd ~/aws/builds/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
67 $ cmake -DBUILD_ONLY="s3;transfer" ~/aws/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
68 $ make -j 4
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
69 $ make install
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
70
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
71 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
72
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
73 $ ./vcpkg install cryptopp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
74
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
75 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
76
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
77 $ mkdir -p build/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
78 $ cd build/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
79 $ cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake ../../orthanc-object-storage/Aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
80
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
81 Azure Blob Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
82 ^^^^^^^^^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
83
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
84 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
85
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
86 $ ./vcpkg install cpprestsdk
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
87
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
88
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
89 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
90
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
91 $ mkdir -p build/azure
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
92 $ cd build/azure
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
93 $ cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake ../../orthanc-object-storage/Azure
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
94
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
95 Google Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
96 ^^^^^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
97
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
98 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
99
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
100 $ ./vcpkg install google-cloud-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
101 $ ./vcpkg install cryptopp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
102
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
103 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
104
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
105 $ mkdir -p build/google
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
106 $ cd build/google
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
107 $ cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake ../../orthanc-object-storage/google
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
108
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
109
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
110 Configuration
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
111 -------------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
112
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
113 .. highlight:: json
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
114
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
115 AWS S3 plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
116 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
117
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
118 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
119
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
120 "AwsS3Storage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
121 "BucketName": "test-orthanc-s3-plugin",
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
122 "Region" : "eu-central-1",
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
123 "AccessKey" : "AKXXX",
463
fae16ea8b13c new AWS params
Alain Mazy <alain@mazy.be>
parents: 459
diff changeset
124 "SecretKey" : "RhYYYY",
fae16ea8b13c new AWS params
Alain Mazy <alain@mazy.be>
parents: 459
diff changeset
125 "Endpoint": "", // optional - currently in mainline version only: custom endpoint
fae16ea8b13c new AWS params
Alain Mazy <alain@mazy.be>
parents: 459
diff changeset
126 "ConnectionTimeout": 30, // optional - currently in mainline version only: connection timeout in seconds
fae16ea8b13c new AWS params
Alain Mazy <alain@mazy.be>
parents: 459
diff changeset
127 "RequestTimeout": 1200 // optional - currently in mainline version only: request timeout in seconds (max time to upload/download a file)
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
128 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
129
464
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
130 The **EndPoint** configuration is used when accessing an S3 compatible cloud provider. I.e. here is a configuration to store data on Scaleway::
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
131
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
132 "AwsS3Storage" : {
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
133 "BucketName": "test-orthanc",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
134 "Region": "fr-par",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
135 "AccessKey": "XXX",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
136 "SecretKey": "YYY",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
137 "Endpoint": "s3.fr-par.scw.cloud"
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
138 },
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
139
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
140 Azure Blob Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
141 ^^^^^^^^^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
142
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
143 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
144
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
145 "AzureBlobStorage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
146 "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxx;AccountKey=yyyyyyyy===;EndpointSuffix=core.windows.net",
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
147 "ContainerName" : "test-orthanc-storage-plugin"
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
148 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
149
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
150
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
151 Google Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
152 ^^^^^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
153
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
154 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
155
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
156 "GoogleCloudStorage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
157 "ServiceAccountFile": "/path/to/googleServiceAccountFile.json",
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
158 "BucketName": "test-orthanc-storage-plugin"
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
159 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
160
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
161
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
162 Sample setups
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
163 -------------
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
164
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
165 You'll find sample deployments and more info in the `Orthanc Setup Samples repository <https://bitbucket.org/osimis/orthanc-setup-samples/src/master/#markdown-header-for-osimisorthanc-pro-image-users>`__ .
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
166
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
167
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
168 Client-side encryption
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
169 ----------------------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
170
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
171 Although all cloud providers already provide encryption at rest, the plugins provide
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
172 an optional layer of client-side encryption . It is very important that you understand
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
173 the scope and benefits of this additional layer of encryption.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
174
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
175 Rationale
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
176 ^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
177
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
178 Encryption at rest provided by cloud providers basically compares with a file-system disk encryption.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
179 If someone has access to the disk, he won't have access to your data without the encryption key.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
180
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
181 With cloud encryption at rest only, if someone has access to the "api-key" of your storage or if one
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
182 of your admin inadvertently make your storage public, `PHI <https://en.wikipedia.org/wiki/Protected_health_information>`__ will leak.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
183
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
184 Once you use client-side encryption, you'll basically store packets of meaningless bytes on the cloud infrastructure.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
185 So, if an "api-key" leaks or if the storage is misconfigured, packets of bytes will leak but not PHI since
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
186 no one will be able to decrypt them.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
187
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
188 Another advantage is that these packets of bytes might eventually not be considered as PHI anymore and eventually
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
189 help you meet your local regulations (Please check your local regulations).
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
190
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
191 However, note that, if you're running entirely in a cloud environment, your decryption keys will still
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
192 be stored on the cloud infrastructure (VM disks - process RAM) and an attacker could still eventually gain access to this keys.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
193
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
194 If Orthanc is running in your infrastructure with the Index DB on your infrastructure, and files are store in the cloud,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
195 the master keys will remain on your infrastructure only and there's no way the data stored in the cloud could be decrypted outside your infrastructure.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
196
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
197 Also note that, although the cloud providers also provide client-side encryption, we, as an open-source project,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
198 wanted to provide our own implementation on which you'll have full control and extension capabilities.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
199 This also allows us to implement the same logic on all cloud providers.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
200
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
201 Our encryption is based on well-known standards (see below). Since it is documented and the source code is open-source,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
202 feel-free to have your security expert review it before using it in a production environment.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
203
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
204 Technical details
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
205 ^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
206
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
207 Orthanc saves 2 kind of files: DICOM files and JSON summaries of DICOM files. Both files contain PHI.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
208
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
209 When configuring the plugin, you'll have to provide a **Master Key** that we can also call the **Key Encryption Key (KEK)**.
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
210
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
211 For each file being saved, the plugin will generate a new **Data Encryption Key (DEK)**. This DEK, encrypted with the KEK will be pre-pended to the file.
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
212
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
213 If, at any point, your KEK leaks or you want to rotate your KEKs, you'll be able to use a new one to encrypt new files that are being added
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
214 and still use the old ones to decrypt data. You could then eventually start a side script to remove usages of the leaked/obsolete KEKs.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
215
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
216 To summarize:
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
217
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
218 - We use `Crypto++ <https://www.cryptopp.com/>`__ to perform all encryptions.
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
219 - All keys (KEK and DEK) are AES-256 keys.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
220 - DEKs and IVs are encrypted by KEK using CTR block cipher using a null IV.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
221 - data is encrypted by DEK using GCM block cipher that will also perform integrity check on the whole file.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
222
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
223 The format of data stored on disk is therefore the following:
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
224
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
225 - **VERSION HEADER**: 2 bytes: identify the structure of the following data currently `A1`
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
226 - **MASTER KEY ID**: 4 bytes: a numerical ID of the KEK that was used to encrypt the DEK
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
227 - **EIV**: 32 bytes: IV used by DEK for data encryption; encrypted by KEK
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
228 - **EDEK**: 32 bytes: the DEK encrypted by the KEK.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
229 - **CIPHER TEXT**: variable length: the DICOM/JSON file encrypted by the DEK
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
230 - **TAG**: 16 bytes: integrity check performed on the whole encrypted file (including header, master key id, EIV and EDEK)
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
231
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
232 Configuration
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
233 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
234
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
235 .. highlight:: text
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
236
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
237 AES Keys shall be 32 bytes long (256 bits) and encoded in base64. Here's a sample OpenSSL command to generate such a key::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
238
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
239 openssl rand -base64 -out /tmp/test.key 32
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
240
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
241 Each key must have a unique id that is a uint32 number.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
242
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
243 .. highlight:: json
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
244
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
245 Here's a sample configuration file of the `StorageEncryption` section of the plugins::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
246
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
247 {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
248 "StorageEncryption" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
249 "Enable": true,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
250 "MasterKey": [3, "/path/to/master.key"], // key id - path to the base64 encoded key
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
251 "PreviousMasterKeys" : [
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
252 [1, "/path/to/previous1.key"],
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
253 [2, "/path/to/previous2.key"]
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
254 ],
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
255 "MaxConcurrentInputSize" : 1024 // size in MB
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
256 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
257 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
258
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
259 **MaxConcurrentInputSize**: Since the memory used during encryption/decryption can grow up to a bit more
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
260 than 2 times the input, we want to limit the number of threads doing concurrent processing according
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
261 to the available memory instead of the number of concurrent threads. Therefore, if you're currently
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
262 ingesting small files, you can have a lot of thread working together while, if you're ingesting large
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
263 files, threads might have to wait before receiving a "slot" to access the encryption module.