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: doc/maintenance/index.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,3 +155,68 @@ To remove the page, you simply run `sudo gitlab-ctl deploy-page down`. You can a
155
155
As a side note, if you would like to restrict logging into GitLab and restrict
156
156
changes to projects, you can [set projects as read-only](https://docs.gitlab.com/ee/administration/troubleshooting/gitlab_rails_cheat_sheet.html#make-a-project-read-only-can-only-be-done-in-the-console)
157
157
, then put up the `Deploy in progress` page.
158
+
159
+
## Rotate the secrets file
160
+
161
+
If required for security purposes, you can rotate the `/etc/gitlab/gitlab-secrets.json` secrets file. In this file:
162
+
163
+
- Do not rotate the `gitlab_rails` secrets because it contains the database encryption keys. If this secret is rotated, you see the same
164
+
behavior as [when the secrets file is lost](https://docs.gitlab.com/ee/administration/backup_restore/backup_gitlab.html#when-the-secrets-file-is-lost).
165
+
- You can rotate all other secrets.
166
+
167
+
If you have multiple nodes in your GitLab environment, choose one of your Rails node to perform the initial steps.
168
+
169
+
To rotate the secrets:
170
+
171
+
1.[Verify that the database values can be decrypted](https://docs.gitlab.com/ee/administration/raketasks/check.html#verify-database-values-can-be-decrypted-using-the-current-secrets) and either make note of any decryption errors shown, or resolve
172
+
them before proceeding.
173
+
174
+
1. Recommended. Extract your current secrets for `gitlab_rails`. Save the output because you need this later:
1. Copy the new `/etc/gitlab/gitlab-secrets.json` file from your Rails node onto all of your other GitLab nodes.
207
+
208
+
1. On all other nodes, [reconfigure GitLab](https://docs.gitlab.com/ee/administration/restart_gitlab.html#reconfigure-a-linux-package-installation)
209
+
on each node.
210
+
211
+
1. On all other nodes, [restart GitLab](https://docs.gitlab.com/ee/administration/restart_gitlab.html#restart-a-linux-package-installation) on each
212
+
node to ensure all services are using the new secrets.
213
+
214
+
1. On all nodes, run a checksum match on the `/etc/gitlab/gitlab-secrets.json` file to confirm that the secrets match:
215
+
216
+
```shell
217
+
sudo md5sum /etc/gitlab/gitlab-secrets.json
218
+
```
219
+
220
+
1. [Verify that the database values can be decrypted](https://docs.gitlab.com/ee/administration/raketasks/check.html#verify-database-values-can-be-decrypted-using-the-current-secrets). The output should match with the previous execution.
221
+
222
+
1. Confirm that GitLab is working as expected. If it is, it should be safe to delete the old secrets.
0 commit comments