You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v2.1/encryption.md
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Encryption at rest allows encryption of all files on disk using AES in counter m
17
17
sizes allowed.
18
18
19
19
Encryption is performed in the [storage layer](architecture/storage-layer.html) and configured per store.
20
-
All files used by the store, regarless of contents, are encrypted with the desired algorithm.
20
+
All files used by the store, regardless of contents, are encrypted with the desired algorithm.
21
21
22
22
To allow arbitrary rotation schedules and ensure security of the keys, we use two layers of keys:
23
23
@@ -39,6 +39,7 @@ CockroachDB does not currently force re-encryption of older files but instead re
39
39
## Key rotation
40
40
41
41
Key rotation is necessary for encryption at rest for multiple reasons:
42
+
42
43
* prevent key reuse with the same encryption parameters (after many files)
43
44
* reduce the risk of key exposure
44
45
@@ -47,6 +48,7 @@ This is done by setting the `key` parameter of the `--enterprise-encryption` fla
47
48
and `old-key` to the previously-used key.
48
49
49
50
Data keys will automatically be rotated at startup if any of the following conditions are met:
51
+
50
52
* the active store key changed
51
53
* the encryption type changed (different key size, or plaintext to/from encryption)
52
54
* the current data key is `rotation-period` old or more.
@@ -69,15 +71,17 @@ and encrypted.
69
71
70
72
## Recommendations
71
73
72
-
There are a number of considerations to keep in mind when running with encryption:
74
+
There are a number of considerations to keep in mind when running with encryption.
73
75
74
76
Key management is the most dangerous aspect of encryption. The following rules should be kept in mind:
77
+
75
78
* make sure only the unix user running the `cockroach` process has access to the keys
76
79
* do not store the keys on the same partition/drive as the cockroach data. It is best to load keys at run time from a separate system (eg: keywhiz, vault)
77
80
* rotate store keys frequently (every few weeks to months)
78
81
* keep the data key rotation period low (default is one week)
79
82
80
83
A few other recommendations apply for best security practices:
84
+
81
85
* do not switch from encrypted to plaintext, this leaks data keys. Once transitioned to plaintext, all data must be considered reachable.
82
86
* do not copy the encrypted files as the data keys are not easily available.
83
87
* if encryption is desired, start a node with it enabled from first run without ever running in plaintext.
@@ -130,7 +134,7 @@ The allowed components in the flag are:
130
134
The `key` and `old-key` components must **always** be specified. They allow for transitions between
131
135
encryption algorithms, and between plaintext and encrypted.
132
136
133
-
Starting node for the first time using AES-128 encryption can be done using:
137
+
Starting a node for the first time using AES-128 encryption can be done using:
0 commit comments