|
| 1 | +# SORMAS to SORMAS Interface |
| 2 | + |
| 3 | +SORMAS to SORMAS is an interface for securely sharing data between different SORMAS instances. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | +* Instances should have the same version |
| 7 | +* Instances should be behind an https server |
| 8 | +* At least two instances with SORMAS to SORMAS set up, and both of them configured to know about each other |
| 9 | + |
| 10 | +## Security |
| 11 | +* Forced `https` connection: sending the data form one instance to another happens using the REST api dedicated for SORMAS to SORMAS communication using https request |
| 12 | +* Encrypted data: the data sent is encrypted using a self signed certificate generated during feature setup |
| 13 | +* Only users with district level role are allowed to share data between sormas instances, by default |
| 14 | + |
| 15 | +**NOTE** The feature on the UI of an instance will be available only after the certificate has been set up and at least one certificate of another instance has been imported |
| 16 | + |
| 17 | +## Features |
| 18 | + |
| 19 | +After the setup, on *case* and *contact* pages will appear UI parts that allows sharing with other SORMAS instances. |
| 20 | + |
| 21 | +On the detail page of a shared item there is an information box that displays the name of the target or source, the name of the user that shared the item, and the date when it has been shared. |
| 22 | + |
| 23 | +### Share a single item |
| 24 | +Sharing a single item can be done on the details page of a *case* or *contact*. |
| 25 | + |
| 26 | +First the target instance should be selected form a list of available instances imported during setup. |
| 27 | +There are also several options to chose from: |
| 28 | +* Share associated contacts (only for cases): option for sharing the contacts of cases |
| 29 | +* Share samples: option for sharing *samples*; will share also the samples of the associated contacts when sharing with associated contacts |
| 30 | +* Hand over the ownership: by default shared data is readonly on the receiving instance, switching this option on will allow the editing in the receiving instance, but not on the sending one |
| 31 | +* Pseudonymize personal data: clears all personal data like person name, birth day and address fields and geo coordinates |
| 32 | +* Pseudonymize sensitive data: clears all personal and free text fields |
| 33 | +* Comment: free text |
| 34 | + |
| 35 | +### Share multiple items |
| 36 | +Sharing multiple items is possible on the directory pages using the *Bulk edit mode* that allows the selection of multiple rows and clicking the *Share* action from *Bulk actions*. |
| 37 | + |
| 38 | +## Technical details |
| 39 | + |
| 40 | +Feature setup can be done with the provided scripts: |
| 41 | +* `s2s-generate-cert.sh` is for creating a self signed certificate that will be used for encrypting data before sending to the other instance, and a csv file which contains the necessary data for recognizing and communicating to this server; |
| 42 | +this file together with the certificate should be shared with others to set up their system to allow accepting share requests from this server. |
| 43 | +* `s2s-import-to-truststore.sh` is for storing server information and certificate of other instances. This certificate is used when decrypting the date coming from other instances. The certificate is added into a trust store, and the server information is appended to the list of the known servers stored in a csv file. |
| 44 | + |
| 45 | +The certificates are of type X.509 and generated using openssl. |
| 46 | + |
| 47 | +The communication is going through the REST api using a dedicated user with `SORMAS_TO_SORMAS_CLIENT` role. This user is automatically created during system startup. |
| 48 | +The encrypted data is transferred using POST requests and only the requests from known servers are accepted by the endpoints. |
| 49 | + |
| 50 | +The data is encrypted/decrypted using the *Bouncy Castle Crypto APIs* java library. |
| 51 | + |
| 52 | +## Setup |
| 53 | +To set up the instances see [SORMAS to SORMAS certificate guide](../../GUIDE_SORMAS2SORMAS_CERTIFICATE.md) |
| 54 | + |
0 commit comments