@@ -87,7 +87,7 @@ if you need to rotate keys, you can perform the following procedure:
87
87
1. Generate a new encryption key following the same procedure as above.
88
88
89
89
1. Add the above key to the list of
90
- [external token encryption keys](../cli/server.md#external-token-encryption-keys).
90
+ [external token encryption keys](../cli/server.md#-- external-token-encryption-keys).
91
91
**The new key must appear first in the list**. For example, in the Kubernetes
92
92
secret created above:
93
93
@@ -127,14 +127,19 @@ To disable encryption, perform the following actions:
127
127
1. Ensure you have a valid backup of your database. **Do not skip this step.**
128
128
129
129
1. Stop all active coderd instances. This will prevent new encrypted data from
130
- being written.
130
+ being written, which may cause the next step to fail .
131
131
132
132
1. Run [`coder server dbcrypt decrypt`](../cli/server_dbcrypt_decrypt.md). This
133
133
command will decrypt all encrypted user tokens and revoke all active
134
134
encryption keys.
135
135
136
+ > Note: for `decrypt` command, the equivalent environment variable for
137
+ > `--keys` is `CODER_EXTERNAL_TOKEN_ENCRYPTION_DECRYPT_KEYS` and not
138
+ > `CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS`. This is explicitly named
139
+ > differently to help prevent accidentally decrypting data.
140
+
136
141
1. Remove all
137
- [external token encryption keys](../cli/server.md#external-token-encryption-keys)
142
+ [external token encryption keys](../cli/server.md#-- external-token-encryption-keys)
138
143
from Coder's configuration.
139
144
140
145
1. Start coderd. You can now safely delete the encryption keys from your secret
@@ -156,7 +161,7 @@ To delete all encrypted data from your database, perform the following actions:
156
161
encryption keys.
157
162
158
163
1. Remove all
159
- [external token encryption keys](../cli/server.md#external-token-encryption-keys)
164
+ [external token encryption keys](../cli/server.md#-- external-token-encryption-keys)
160
165
from Coder's configuration.
161
166
162
167
1. Start coderd. You can now safely delete the encryption keys from your secret
@@ -171,3 +176,6 @@ To delete all encrypted data from your database, perform the following actions:
171
176
that is no longer active, it will refuse to start. If you are seeing this
172
177
behaviour, ensure that the encryption keys provided are correct and that you
173
178
have not revoked any keys that are still in use.
179
+ - Decryption may fail if newly encrypted data is written while decryption is in
180
+ progress. If this happens, ensure that all active coder instances are stopped,
181
+ and retry.
0 commit comments