Loading
nixos/grafana: update instructions on secret rotation
Closes #495278 Turns out that the documentation about secrets[1] is actually a little misleading and I let myself fool by it: the rotation is about moving to envelope-based encryption, i.e. a way where a key is generated and stored in the DB that is encrypted with `secret_key` and used to decrypt actual secrets. In fact, there's no official way to rotate this on a running instance. The reason this wasn't noticed so far is because I'd expect most people to * use provisioning to set up their datasources (or) * talk to a local Prometheus (or else) API that is exposed on the machine only and thus no authentication is needed if you trust that machine enough. On top, the encryption is unauthenticated so only changing secret_key appears to work, but uses gibberish as password for authentication against data-sources. So effectively there are two ways to migrate (short of a fresh setup): * keep the old secret and call it a day. IMHO this is fine if the setup is e.g. a single-node machine where both the secret and the DB are on the same file-system, in the same data-dir and protected by the same permissions. * use a 3rd-party rotation tool[2]. I ensured by hand on a test-instance that following the instructions works and you end up with a freshly generated secret_key that you need to deploy. With that key deployed, the credentials still decrypt to the same plaintext. [1] https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-database-encryption/#envelope-encryption [2] https://github.com/erooke/grafana-secretkey-rotation-tool/tree/d9dc788902fa5185e15cb15ce6129f7237ab6138