Skip to content

Commit edbb614

Browse files
Chris Chonlarew
authored andcommitted
FLE: intro sections (#526)
*added intro sections
1 parent 9d29529 commit edbb614

File tree

1 file changed

+69
-36
lines changed

1 file changed

+69
-36
lines changed

source/use-cases/sensitive-data-encryption.txt

Lines changed: 69 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,59 @@ Sensitive Data Encryption
1313
Introduction
1414
------------
1515

16-
Cras sed rutrum nisi, vitae tristique risus. Aliquam erat volutpat.
17-
Donec auctor nisl eget ornare accumsan. Pellentesque lectus tortor,
18-
consectetur molestie pellentesque ac, blandit non libero.
16+
Many applications make use of sensitive data such as confidential personal details, payment information, or proprietary data. In some jurisdictions, this type of data is subject to governance, privacy, and security compliance mandates. Unauthorized access of sensitive data or a failure to comply with a mandate often results in significant reputation damage and financial penalties. Therefore, it is important to keep sensitive data secure.
17+
18+
MongoDB offers several methods that protect your data from unauthorized access including:
19+
20+
* `Role-based access control <https://docs.mongodb.com/manual/core/authorization/>`_
21+
* `Monitoring and logging <https://docs.mongodb.com/manual/core/auditing/>`_
22+
* `TLS/SSL network transport encryption <https://docs.mongodb.com/manual/core/security-transport-encryption/>`_
23+
* `Encryption at rest <https://docs.mongodb.com/manual/core/security-encryption-at-rest/>`_
24+
25+
Another MongoDB feature that prevents unauthorized access of data is `Client-Side Field Level Encryption (CSFLE) <https://docs.mongodb.com/manual/core/security-client-side-encryption/>`_. This feature allows a developer to selectively encrypt individual fields of a document on the client-side before it is sent to the server. This keeps the encrypted data private from the providers hosting the database as well as any user that has direct access to the database.
26+
27+
This guide provides steps for setup and implementation of CSFLE with a practical example.
28+
29+
.. note::
30+
31+
Client-side Field Level Encryption is available starting in MongoDB 4.2 Enterprise only.
1932

2033
Problem
2134
~~~~~~~
2235

23-
Pellentesque non mi et est congue mattis pretium sit amet mi. Praesent
24-
nec tortor nec arcu molestie dapibus. Phasellus at nunc ut quam molestie
25-
finibus. Suspendisse finibus lectus eget nulla eleifend, vel consequat
26-
leo rhoncus. Phasellus lacinia tortor id aliquet condimentum. Morbi
27-
sodales est a leo rhoncus, non pretium neque dignissim.
36+
In this scenario, we secure sensitive data on a Medical Care Management System which stores patients' personal information, insurance information, and medical records for a fictional company, *MedcoMD*. None of the patient data is public, and certain data such as their social security number (SSN), insurance policy number, and vital sign measurements are particularly sensitive and subject to privacy compliance. It is important for the company and the patient that the data is kept private and secure.
37+
38+
MedcoMD needs this system to satisfy the following use cases:
39+
40+
- Doctors use the system to access Patients' medical records, insurance information, and add new vital sign measurements.
41+
- Receptionists use the system to verify the Patients' identity, using a combination of their contact information and the last four digits of their Social Security Number (SSN).
42+
- Receptionists can view a Patient's insurance policy provider, but not their policy number.
43+
- Receptionists cannot access a Patient's medical records.
44+
45+
MedcoMD is also concerned with disclosure of sensitive data through any of the following methods:
46+
47+
- Accidental disclosure of data on the Receptionist's publicly-viewable screen.
48+
- Direct access to the database by a superuser such as a database administrator.
49+
- Capture of data over an insecure network.
50+
- Access to the data by reading a server's memory.
51+
- Access to the on-disk data by reading database or backup files.
52+
53+
What can MedcoMD do to balance the functionality and access restrictions of their Medical Care Management System?
2854

2955
Solution
3056
~~~~~~~~
3157

32-
Praesent sit amet elit pretium mi molestie porta a sit amet ipsum. Sed
33-
sollicitudin purus et mi blandit sodales.
58+
The MedcoMD software engineers review the Medical Care Management System specification and research the proper solution for limiting access to sensitive data.
59+
60+
The first MongoDB security feature they evaluated was `Role-Based Access Control <https://docs.mongodb.com/manual/core/authorization/>`_ which allows administrators to grant and restrict collection-level permissions for users. With the appropriate role definition and assignment, this solution prevents accidental disclosure of data and access. However, it does not prevent capture of the data over an insecure network, direct access of data by a superuser, access to data by reading the server's memory, or access to on-disk data by reading the database or backup files.
61+
62+
The next MongoDB security features they evaluated were `Encryption at Rest <https://docs.mongodb.com/manual/core/security-encryption-at-rest/>`_ which encrypts the database files on disk and `Transport Encryption using TLS/SSL <https://docs.mongodb.com/manual/core/security-transport-encryption/>`_ which encrypts data over the network. When applied together, these two features prevent access to on-disk database files as well as capture of the data on the network, respectively. When combined with Role-Based Access Control, these three security features offer near-comprehensive security coverage of the sensitive data, but lack a mechanism to prevent the data from being read from the server's memory.
3463

35-
- Deterministic vs Non-Deterministic
64+
Finally, the MedcoMD developers discovered a feature that independently satisfies all the security criteria. Client-side Field Level Encryption allows the developers to specify the fields of a document that should be kept encrypted. Sensitive data is transparently encrypted/decrypted by the client and only communicated to and from the server in encrypted form. This mechanism keeps the specified data fields secure in encrypted form on both the server and the network. While all clients have access to the non-sensitive data fields, only appropriately-configured CSFLE clients are able to read and write the sensitive data fields.
65+
66+
MedcoMD will provide Receptionists with a client that is not configured to access data encrypted with CSFLE. This will prevent them from viewing the sensitive fields and accidentally leaving them displayed on-screen in a public area. MedcoMD will provide Doctors with a client with CSFLE enabled which will allow them to access the sensitive data fields in the privacy of their own office.
67+
68+
Equipped with CSFLE, MedcoMD can keep their sensitive data secure and compliant to data privacy regulations with MongoDB.
3669

3770
Procedure
3871
---------
@@ -95,11 +128,11 @@ B. Define a JSON Schema
95128
~~~~~~~~~~~~~~~~~~~~~~~
96129

97130
`JSON Schema
98-
<http://json-schema.org/>`_ is a vocabulary that allows you to annotate and
131+
<http://json-schema.org/>`_ is a vocabulary that allows you to annotate and
99132
validate JSON documents. MongoDB extends the JSON Schema standard to allow CSFLE
100-
to use automatically encrypt and decrypt the fields of documents in a collection.
133+
to use automatically encrypt and decrypt the fields of documents in a collection.
101134

102-
The following fields are required in the JSON Schema to enable automatic
135+
The following fields are required in the JSON Schema to enable automatic
103136
encryption and decryption for each field:
104137

105138
* The encryption algorithm (:manual:`Deterministic Encryption </core/security-client-side-encryption#deterministic-encryption>` or :manual:`Random Encryption </core/security-client-side-encryption#random-encryption>`)
@@ -124,7 +157,7 @@ the data model of the Medco Management System.
124157
- Encryption Algorithm
125158
- BSON Type
126159
* - Name
127-
- Non-Encrypted
160+
- Non-Encrypted
128161
- String
129162
* - SSN
130163
- Deterministic
@@ -137,7 +170,7 @@ the data model of the Medco Management System.
137170
- Array
138171
* - Insurance: Policy Number
139172
- Deterministic
140-
- Int (embedded inside `insurance` object)
173+
- Int (embedded inside `insurance` object)
141174
* - Insurance: Provider
142175
- Non-Encrypted
143176
- String (embedded inside `insurance` object)
@@ -151,7 +184,7 @@ encryption method to use. Initially, they define a data key for all
151184
fields in the data model by specifying the `encryptMetadata
152185
<https://docs.mongodb.com/manual/reference/security-client-side-automatic-json-schema/#encryptmetadata-schema-keyword>`_
153186
attribute. All child properties will inherit this encryption key unless
154-
specifically overwritten.
187+
specifically overwritten.
155188

156189
.. code-block:: javascript
157190

@@ -161,7 +194,7 @@ specifically overwritten.
161194
"keyId" : // copy and paste your keyID generated here
162195
},
163196
"properties": {
164-
// copy and paste your fields here
197+
// copy and paste your fields here
165198
}
166199
}
167200

@@ -171,11 +204,11 @@ the `properties` map.
171204
SSN
172205
+++
173206
``ssn`` is a field representing the patient's social security number. This
174-
field is sensitive and should be encrypted. MedcoMD engineers decide
207+
field is sensitive and should be encrypted. MedcoMD engineers decide
175208
upon deterministic encryption based on the following properties:
176209

177210
* Queryable
178-
* High cardinality
211+
* High cardinality
179212

180213
.. code-block:: json
181214

@@ -190,12 +223,12 @@ upon deterministic encryption based on the following properties:
190223

191224
Blood Type
192225
++++++++++
193-
``bloodType`` is a field representing the patient's blood type. This field is
194-
sensitive and should be encrypted. MedcoMD engineers decide
226+
``bloodType`` is a field representing the patient's blood type. This field is
227+
sensitive and should be encrypted. MedcoMD engineers decide
195228
upon random encryption based on the following properties:
196229

197230
* No plans to query
198-
* Low cardinality
231+
* Low cardinality
199232

200233
.. code-block:: json
201234

@@ -209,10 +242,10 @@ upon random encryption based on the following properties:
209242

210243
Medical Records
211244
+++++++++++++++
212-
``medicalRecords`` is an array field holding a set of medical records. Each
213-
medical record document specifies information, such as the patient's blood
214-
pressure, weight, and heart rate. This field is sensitive and should be
215-
encrypted. MedcoMD engineers decide upon random encryption based on
245+
``medicalRecords`` is an array field holding a set of medical records. Each
246+
medical record document specifies information, such as the patient's blood
247+
pressure, weight, and heart rate. This field is sensitive and should be
248+
encrypted. MedcoMD engineers decide upon random encryption based on
216249
the following properties:
217250

218251
* Array fields must use random encryption with CSFLE to enable auto-encryption
@@ -228,13 +261,13 @@ the following properties:
228261

229262
Insurance: Policy Number
230263
++++++++++++++++++++++++
231-
``insurance.policyNumber`` is a field embedded inside the ``Insurance`` object
232-
field and represents the patient's policy number. This policy number is a
233-
distinct and sensitive field. MedcoMD engineers decide upon
264+
``insurance.policyNumber`` is a field embedded inside the ``Insurance`` object
265+
field and represents the patient's policy number. This policy number is a
266+
distinct and sensitive field. MedcoMD engineers decide upon
234267
deterministic encryption based on the following properties:
235268

236269
* Queryable
237-
* High cardinality
270+
* High cardinality
238271

239272
.. code-block:: json
240273

@@ -248,14 +281,14 @@ deterministic encryption based on the following properties:
248281
}
249282
}
250283
}
251-
}
284+
}
252285

253286

254287
Recap
255288
+++++++
256-
MedcoMD engineers created a JSON Schema that satisfies their requirements of
257-
making sensitive data queryable and secure. View the full `JSON Schema
258-
for the Medco Medical Management System <https://raw.githubusercontent.com/mongodb/docs-assets/DOCSP-json-schema-helper-and-json/MedcoMDSchema.json>`_.
289+
MedcoMD engineers created a JSON Schema that satisfies their requirements of
290+
making sensitive data queryable and secure. View the full `JSON Schema
291+
for the Medco Medical Management System <https://raw.githubusercontent.com/mongodb/docs-assets/DOCSP-json-schema-helper-and-json/MedcoMDSchema.json>`_.
259292

260293

261294
.. tabs::
@@ -266,7 +299,7 @@ for the Medco Medical Management System <https://raw.githubusercontent.com/mongo
266299
name: "Java"
267300
content: |
268301

269-
View the `helper code in Java <https://gist.github.com/ccho-mongodb/088176b1bed3b9e54cdc0c2c3c537d1b>`_.
302+
View the `helper code in Java <https://gist.github.com/ccho-mongodb/088176b1bed3b9e54cdc0c2c3c537d1b>`_.
270303

271304
C. Configure the MongoDB Client
272305
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)