annotate Sphinx/source/plugins/object-storage.rst @ 761:525d59a7c198

typo
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 29 Aug 2021 13:39:31 +0200
parents b2b1ba11faaa
children 73ee8a489b24
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
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
9 Release notes
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
10 -------------
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
11
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
12 Release notes are available `here
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
13 <https://hg.orthanc-server.com/orthanc-object-storage/file/default/NEWS>`__
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
14
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
15 Introduction
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
16 ------------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
17
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
18 Osimis freely provides the `source code
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19 <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
20 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
21 at the 3 main providers: `AWS <https://aws.amazon.com/s3/>`__,
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
22 `Azure <https://azure.microsoft.com/en-us/services/storage/blobs/>`__ &
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23 `Google Cloud <https://cloud.google.com/storage>`__
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 Storing Orthanc files in object storage and your index SQL in a
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
26 managed database allows you to have a stateless Orthanc that does
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
27 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
28 when deploying an application in the cloud.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
29
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
30
459
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
31 Pre-compiled binaries
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
32 ---------------------
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
33
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
34 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
35 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
36 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
37 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
38 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
39 `professional support contract
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
40 <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
41 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
42 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
43 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
44 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
45
a4ed4e883337 highlighting the pre-compiled binaries for google, aws and azure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 453
diff changeset
46
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
47 Compilation
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
48 -----------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
49
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
50 .. highlight:: text
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 procedure to compile the plugins is quite similar of that for the
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
53 :ref:`core of Orthanc <compiling>` although they usually require
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
54 some prerequisites. The documented procedure has been tested only
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
55 on a Debian Buster machine.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
56
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
57 The compilation of each plugin produces a shared library that contains
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
58 the plugin.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
59
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 AWS S3 plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
62 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
63
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
64 Prerequisites: Compile the AWS C++ SDK::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
65
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
66 $ mkdir ~/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
67 $ cd ~/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
68 $ git clone https://github.com/aws/aws-sdk-cpp.git
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
69 $
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
70 $ mkdir -p ~/aws/builds/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
71 $ cd ~/aws/builds/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
72 $ cmake -DBUILD_ONLY="s3;transfer" ~/aws/aws-sdk-cpp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
73 $ make -j 4
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
74 $ make install
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
75
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
76 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
77
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
78 $ ./vcpkg install cryptopp
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
79
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
80 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
81
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
82 $ mkdir -p build/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
83 $ cd build/aws
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
84 $ 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
85
504
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
86
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
87 **NB:** If you don't want to use vcpkg, you can use the following
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
88 command (this syntax is not compatible with Ninja yet)::
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
89
543
fd340103904c note to build aws plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 520
diff changeset
90 $ cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_VCPKG_PACKAGES=OFF -DUSE_SYSTEM_GOOGLE_TEST=OFF ../../orthanc-object-storage/Aws
504
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
91 $ make
2845ac3adad2 USE_VCPKG_PACKAGES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 502
diff changeset
92
543
fd340103904c note to build aws plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 520
diff changeset
93 Crypto++ must be installed (on Ubuntu, run ``sudo apt install libcrypto++-dev``).
fd340103904c note to build aws plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 520
diff changeset
94
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
95
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
96 Azure Blob Storage plugin
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
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
99 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
100
628
e6a2bcf729b4 fix azure build prerequisites
Alain Mazy <alain@mazy.be>
parents: 586
diff changeset
101 $ ./vcpkg install cryptopp
e6a2bcf729b4 fix azure build prerequisites
Alain Mazy <alain@mazy.be>
parents: 586
diff changeset
102 $ ./vcpkg install azure-storage-cpp
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
103
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 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
106
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
107 $ mkdir -p build/azure
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
108 $ cd build/azure
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
109 $ 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
110
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
111 Google Storage plugin
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
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
114 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
115
628
e6a2bcf729b4 fix azure build prerequisites
Alain Mazy <alain@mazy.be>
parents: 586
diff changeset
116 $ ./vcpkg install cryptopp
e6a2bcf729b4 fix azure build prerequisites
Alain Mazy <alain@mazy.be>
parents: 586
diff changeset
117 $ ./vcpkg install google-cloud-cpp
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
118
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
119 Compile::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
120
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
121 $ mkdir -p build/google
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
122 $ cd build/google
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
123 $ 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
124
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
125
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
126 Configuration
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
127 -------------
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 .. highlight:: json
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
130
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
131 AWS S3 plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
132 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
133
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
134 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
135
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
136 "AwsS3Storage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
137 "BucketName": "test-orthanc-s3-plugin",
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
138 "Region" : "eu-central-1",
685
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
139 "AccessKey" : "AKXXX", // optional: if not specified, the plugin will use the default credentials manager (available from version 1.3.0)
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
140 "SecretKey" : "RhYYYY", // optional: if not specified, the plugin will use the default credentials manager (available from version 1.3.0)
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
141 "Endpoint": "", // optional: custom endpoint
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
142 "ConnectionTimeout": 30, // optional: connection timeout in seconds
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
143 "RequestTimeout": 1200, // optional: request timeout in seconds (max time to upload/download a file)
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
144 "RootPath": "", // optional: see below
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
145 "MigrationFromFileSystemEnabled": false, // optional: see below
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
146 "StorageStructure": "flat", // optional: see below
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
147 "VirtualAddressing": true, // optional: see the section related to MinIO
6bc19941ffcd AWS doc
Alain Mazy <am@osimis.io>
parents: 647
diff changeset
148 "StorageEncryption" : {} // optional: see the section related to encryption
451
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
464
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
151 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
152
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
153 "AwsS3Storage" : {
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
154 "BucketName": "test-orthanc",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
155 "Region": "fr-par",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
156 "AccessKey": "XXX",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
157 "SecretKey": "YYY",
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
158 "Endpoint": "s3.fr-par.scw.cloud"
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
159 }
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
160
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
161
746
b2b1ba11faaa grow storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
162 .. _minio:
b2b1ba11faaa grow storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
163
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
164 Emulation of AWS S3 using MinIO
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
165 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
166
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
167 .. highlight:: bash
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
168
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
169 The `MinIO project <https://min.io/>`__ can be used to emulate AWS S3
507
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
170 for local testing/prototyping. Here is a sample command to start a
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
171 MinIO server on your local computer using Docker (evidently, make sure
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
172 to set different credentials)::
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
173
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
174 $ docker run -p 9000:9000 \
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
175 -e "MINIO_REGION=eu-west-1" \
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
176 -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
177 -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MNG/bPxRfiCYEXAMPLEKEY" \
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
178 minio/minio server /data
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
179
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
180 .. highlight:: json
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
181
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
182 Note that the ``MINIO_REGION`` must be set to an arbitrary region that
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
183 is supported by AWS S3.
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
184
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
185 You can then open the URL `http://localhost:9000/
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
186 <http://localhost:9000/>`__ with your Web browser to create a bucket,
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
187 say ``my-sample-bucket``.
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
188
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
189 Here is a corresponding full configuration for Orthanc::
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
190
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
191 {
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
192 "Plugins" : [ <...> ],
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
193 "AwsS3Storage" : {
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
194 "BucketName": "my-sample-bucket",
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
195 "Region" : "eu-west-1",
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
196 "Endpoint": "http://localhost:9000/",
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
197 "AccessKey": "AKIAIOSFODNN7EXAMPLE",
506
30d415f2b8ee fix minio sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 505
diff changeset
198 "SecretKey": "wJalrXUtnFEMI/K7MNG/bPxRfiCYEXAMPLEKEY",
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
199 "VirtualAddressing" : false
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
200 }
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
201 }
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
202
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
203 Note that the ``VirtualAddressing`` option must be set to ``false``
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
204 for such a `local setup with MinIO to work
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
205 <https://github.com/aws/aws-sdk-cpp/issues/1425>`__. This option is
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
206 **not** available in releases <= 1.1.0 of the AWS S3 plugin.
507
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
207
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
208 **Important:** If you get the cryptic error message
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
209 ``SignatureDoesNotMatch The request signature we calculated does not
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
210 match the signature you provided. Check your key and signing
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
211 method.``, this most probably indicates that your access key or your
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
212 secret key doesn't match the credentials that were used while starting
a51542cfdfeb warning about minio credentials
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
213 the MinIO server.
505
e4bea5b97890 Emulation of AWS S3 using MinIO
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 504
diff changeset
214
464
5ea70331c0be AWS Endpoint doc
Alain Mazy <alain@mazy.be>
parents: 463
diff changeset
215
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
216 Azure Blob Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
217 ^^^^^^^^^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
218
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
219 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
220
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
221 "AzureBlobStorage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
222 "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxx;AccountKey=yyyyyyyy===;EndpointSuffix=core.windows.net",
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
223 "ContainerName" : "test-orthanc-storage-plugin",
647
Alain Mazy <am@osimis.io>
parents: 629
diff changeset
224 "CreateContainerIfNotExists": true, // available from version 1.2.0
502
4e426dec4fee Object-storage: RootPath
Alain Mazy <alain@mazy.be>
parents: 500
diff changeset
225 "RootPath": "", // see below
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
226 "MigrationFromFileSystemEnabled": false, // see below
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
227 "StorageStructure": "flat" // see below
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
228 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
229
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
230
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
231 Google Storage plugin
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
232 ^^^^^^^^^^^^^^^^^^^^^
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 Sample configuration::
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
235
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
236 "GoogleCloudStorage" : {
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
237 "ServiceAccountFile": "/path/to/googleServiceAccountFile.json",
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
238 "BucketName": "test-orthanc-storage-plugin",
502
4e426dec4fee Object-storage: RootPath
Alain Mazy <alain@mazy.be>
parents: 500
diff changeset
239 "RootPath": "", // see below
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
240 "MigrationFromFileSystemEnabled": false, // see below
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
241 "StorageStructure": "flat" // see below
451
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
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
244
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
245 Migration & Storage structure
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
246 -----------------------------
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
247
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
248 The **StorageStructure** configuration allows you to select the way objects are organized
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
249 within the storage (``flat`` or ``legacy``).
500
Alain Mazy <alain@mazy.be>
parents: 499
diff changeset
250 Unlike the traditional file system in which Orthanc uses 2 levels
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
251 of folders, object storages usually have no limit on the number of files per folder and
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
252 therefore all objects are stored at the root level of the object storage. This is the
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
253 default ``flat`` behaviour. Note that, in the ``flat`` mode, an extension `.dcm` or `.json`
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
254 is added to the filename which is not the case in the legacy mode.
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
255
500
Alain Mazy <alain@mazy.be>
parents: 499
diff changeset
256 The ``legacy`` behaviour mimics the Orthanc File System convention. This is actually helpful
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
257 when migrating your data from a file system to an object storage since you can copy all the file
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
258 hierarchy as is.
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
259
502
4e426dec4fee Object-storage: RootPath
Alain Mazy <alain@mazy.be>
parents: 500
diff changeset
260 The **RootPath** allows you to store the files in another folder as the root level of the
520
Alain Mazy <alain@mazy.be>
parents: 511
diff changeset
261 object storage. Note: it shall not start with a ``/``.
502
4e426dec4fee Object-storage: RootPath
Alain Mazy <alain@mazy.be>
parents: 500
diff changeset
262
4e426dec4fee Object-storage: RootPath
Alain Mazy <alain@mazy.be>
parents: 500
diff changeset
263 Note that you can not change these configurations once you've uploaded the first files in Orthanc.
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
264
714
Alain Mazy <am@osimis.io>
parents: 685
diff changeset
265 The **MigrationFromFileSystemEnabled** configuration has been introduced for Orthanc to continue working
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
266 while you're migrating your data from the file system to the object storage. While this option is enabled,
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
267 Orthanc will store all new files into the object storage but will try to read/delete files
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
268 from both the file system and the object storage.
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
269
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
270 This option can be disabled as soon as all files have been copied from the file system to the
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
271 object storage. Note that Orthanc is not copying the files from one storage to the other; you'll
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
272 have to use a standard ``sync`` command from the object-storage provider.
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
273
508
cf489ab9ca48 migration script for azure
Alain Mazy <alain@mazy.be>
parents: 502
diff changeset
274 A migration script from File System to Azure Blob Storage is available courtesy of `Steve Hawes <https://github.com/jodogne/OrthancContributed/blob/master/Scripts/Migration/2020-09-08-TransferToAzure.sh>`__ .
cf489ab9ca48 migration script for azure
Alain Mazy <alain@mazy.be>
parents: 502
diff changeset
275
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
276
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
277 Sample setups
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
278 -------------
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
279
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
280 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
281
511
5b574520a34c performance tests for object-storage
Alain Mazy <alain@mazy.be>
parents: 509
diff changeset
282 Performances
5b574520a34c performance tests for object-storage
Alain Mazy <alain@mazy.be>
parents: 509
diff changeset
283 ------------
5b574520a34c performance tests for object-storage
Alain Mazy <alain@mazy.be>
parents: 509
diff changeset
284
5b574520a34c performance tests for object-storage
Alain Mazy <alain@mazy.be>
parents: 509
diff changeset
285 You'll find some performance comparison between VM SSDs and object-storage `here <https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/performance-tests/>`__ .
5b574520a34c performance tests for object-storage
Alain Mazy <alain@mazy.be>
parents: 509
diff changeset
286
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
287
586
5f5519f1491a securing the storage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 543
diff changeset
288 .. _client-side-encryption:
5f5519f1491a securing the storage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 543
diff changeset
289
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
290 Client-side encryption
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
291 ----------------------
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
292
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
293 Although all cloud providers already provide encryption at rest, the plugins provide
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
294 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
295 the scope and benefits of this additional layer of encryption.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
296
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
297 Rationale
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
298 ^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
299
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
300 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
301 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
302
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
303 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
304 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
305
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
306 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
307 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
308 no one will be able to decrypt them.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
309
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
310 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
311 help you meet your local regulations (Please check your local regulations).
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
312
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
313 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
314 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
315
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
316 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
317 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
318
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
319 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
320 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
321 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
322
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
323 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
324 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
325
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
326 Technical details
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
327 ^^^^^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
328
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
329 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
330
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
331 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
332
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
333 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
334
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
335 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
336 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
337
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
338 To summarize:
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
339
452
aef5c8b74381 fix + link to sample
Alain Mazy <alain@mazy.be>
parents: 451
diff changeset
340 - We use `Crypto++ <https://www.cryptopp.com/>`__ to perform all encryptions.
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
341 - All keys (KEK and DEK) are AES-256 keys.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
342 - 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
343 - 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
344
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
345 The format of data stored on disk is therefore the following:
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
346
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
347 - **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
348 - **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
349 - **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
350 - **EDEK**: 32 bytes: the DEK encrypted by the KEK.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
351 - **CIPHER TEXT**: variable length: the DICOM/JSON file encrypted by the DEK
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
352 - **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
353
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
354 Configuration
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
355 ^^^^^^^^^^^^^
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
356
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
357 .. highlight:: text
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
358
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
359 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
360
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
361 openssl rand -base64 -out /tmp/test.key 32
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
362
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
363 Each key must have a unique id that is a uint32 number.
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
364
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
365 .. highlight:: json
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
366
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
367 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
368
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
369 {
499
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
370 "GoogleCloudStorage" : {
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
371 "StorageEncryption" : {
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
372 "Enable": true,
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
373 "MasterKey": [3, "/path/to/master.key"], // key id - path to the base64 encoded key
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
374 "PreviousMasterKeys" : [
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
375 [1, "/path/to/previous1.key"],
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
376 [2, "/path/to/previous2.key"]
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
377 ],
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
378 "MaxConcurrentInputSize" : 1024 // size in MB
d255e02eb89d updated object-storage doc for 1.0.0
Alain Mazy <alain@mazy.be>
parents: 464
diff changeset
379 }
451
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
380 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
381 }
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
382
938206110483 added object storage
Alain Mazy <alain@mazy.be>
parents:
diff changeset
383 **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
384 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
385 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
386 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
387 files, threads might have to wait before receiving a "slot" to access the encryption module.