<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Enterprise database encryption on Grafana Labs</title><link>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/</link><description>Recent content in Enterprise database encryption on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v8.4/enterprise/enterprise-encryption/index.xml" rel="self" type="application/rss+xml"/><item><title>Azure Key Vault</title><link>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-azure-key-vault-to-encrypt-database-secrets/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-azure-key-vault-to-encrypt-database-secrets/</guid><content><![CDATA[&lt;h1 id=&#34;using-azure-key-vault-to-encrypt-database-secrets&#34;&gt;Using Azure Key Vault to encrypt database secrets&lt;/h1&gt;
&lt;p&gt;You can use an encryption key from Azure Key Vault to encrypt secrets in the Grafana database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An Azure account with permission to view and create Key Vault keys and programmatic credentials to access those keys&lt;/li&gt;
&lt;li&gt;Access to the Grafana &lt;a href=&#34;../../../administration/configuration/#config-file-locations&#34;&gt;configuration&lt;/a&gt; file&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/key-vault/general/quick-create-portal#create-a-vault&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a vault&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a key in the &lt;strong&gt;Key Vault&lt;/strong&gt; with the name that you want by using &lt;strong&gt;RSA&lt;/strong&gt; as the type and &lt;code&gt;2048&lt;/code&gt; as the size with encrypt and decrypt permissions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Register an application&lt;/a&gt; and generate a client secret for it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/key-vault/general/assign-access-policy?tabs=azure-portal&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Assign a Key Vault access policy&lt;/a&gt; for the key vault that you created:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Key Permissions section, set encrypt and decrypt permissions, and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From within Grafana, turn on &lt;a href=&#34;../../../administration/database-encryption/&#34;&gt;envelope encryption&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add your Azure Key Vault details to the Grafana configuration file; depending on your operating system, is usually named &lt;code&gt;grafana.ini&lt;/code&gt;:
&lt;br&gt;&lt;br&gt;a. Add a new section to the configuration file, with a name in the format of &lt;code&gt;[security.encryption.azurekv.&amp;lt;KEY-NAME&amp;gt;]&lt;/code&gt;, where &lt;code&gt;&amp;lt;KEY-NAME&amp;gt;&lt;/code&gt; is any name that uniquely identifies this key among other provider keys.
&lt;br&gt;&lt;br&gt;b. Fill in the section with the following values:
&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tenant_id&lt;/code&gt;: the &lt;strong&gt;Directory ID&lt;/strong&gt; (tenant) from the application that you registered.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client_id&lt;/code&gt;: the &lt;strong&gt;Application ID&lt;/strong&gt; (client) from the application that you registered.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client_secret&lt;/code&gt;: the VALUE of the secret that you generated in your app. (Don&amp;rsquo;t use the Secret ID).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;key_id&lt;/code&gt;: the key name that you created in the key vault.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vault_uri&lt;/code&gt;: the URL of your key vault.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An example of an Azure Key Vault provider section in the &lt;code&gt;grafana.ini&lt;/code&gt; file is as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;# Azure Key Vault provider setup
;[security.encryption.azurekv.example-encryption-key]
# Azure Application directory ID (tenant)
tenant_id = 1234abcd-12ab-34cd-56ef-1234567890ab
# Azure Application application ID (client).
client_id = 1356dfgh-12ab-34cd-56ef-3322114455cc
# Azure Application client secret.
client_secret = FbE4X~4Jq45ERKxx823Aheb9plBjQqHHe81Sc
# Azure Key Vault key name.
key_id = mysecretkey
# Azure Key Vault uri.
vault_uri = https://my-vault-name.vault.azure.net&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[security]&lt;/code&gt; section of the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file with the new Encryption Provider key that you created:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;[security]
# previous encryption key, used for legacy alerts, decrypting existing secrets or used as default provider when external providers are not configured
secret_key = AaaaAaaa
# encryption provider key in the format &amp;lt;PROVIDER&amp;gt;.&amp;lt;KEY-NAME&amp;gt;
encryption_provider = azurekv.example-encryption-key
# list of configured key providers, space separated
available_encryption_providers =  azurekv.example-encryption-key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; The encryption key stored in the &lt;code&gt;secret_key&lt;/code&gt; field is still used by Grafana’s legacy alerting system to encrypt secrets. Do not change or remove that value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/latest/installation/restart-grafana/&#34;&gt;Restart Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) From the command line and the root directory of Grafana Enterprise, re-encrypt all of the secrets within the Grafana database with the new key using the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin secrets-migration re-encrypt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you do not re-encrypt existing secrets, then they will remain encrypted by the previous encryption key. Users will still be able to access them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; This process could take a few minutes to complete, depending on the number of secrets (such as data sources or alert notification channels) in your database. Users might experience errors while this process is running, and alert notifications might not be sent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; If you are updating this encryption key during the initial setup of Grafana before any data sources, alert notification channels, or dashboards have been created, then this step is not necessary because there are no secrets in Grafana to migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="using-azure-key-vault-to-encrypt-database-secrets">Using Azure Key Vault to encrypt database secrets&lt;/h1>
&lt;p>You can use an encryption key from Azure Key Vault to encrypt secrets in the Grafana database.&lt;/p></description></item><item><title>AMS KMS</title><link>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-aws-kms-to-encrypt-database-secrets/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-aws-kms-to-encrypt-database-secrets/</guid><content><![CDATA[&lt;h1 id=&#34;using-aws-kms-to-encrypt-database-secrets&#34;&gt;Using AWS KMS to encrypt database secrets&lt;/h1&gt;
&lt;p&gt;You can use an encryption key from AWS Key Management Service to encrypt secrets in the Grafana database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An AWS account with permission to view and create KMS keys and programmatic credentials to access those keys&lt;/li&gt;
&lt;li&gt;Access to the Grafana &lt;a href=&#34;../../../administration/configuration/#config-file-locations&#34;&gt;configuration&lt;/a&gt; file&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a symmetric API key either from the AWS Management Console or by using the AWS KMS API.
&lt;br&gt;&lt;br&gt;For detailed instructions, refer to &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Creating keys&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Retrieve the Key ID.
&lt;br&gt;&lt;br&gt;In AWS terms, this can be a key ID, a key ARN (Amazon Resource Name), an alias name, or an alias ARN. For more information about how to retrieve a key ID from AWS, refer to &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Finding the key ID and key ARN&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;a href=&#34;https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;programmatic credential&lt;/a&gt; (access key ID and secret access key), which has permission to view the key that you created.
&lt;br&gt;&lt;br&gt;In AWS, you can control access to your KMS keys by using &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;key policies&lt;/a&gt;, &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;IAM policies&lt;/a&gt;, and &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/grants.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;grants&lt;/a&gt;. You can also create &lt;a href=&#34;https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;temporary credentials&lt;/a&gt;, which must provide a session token along with an access key ID and a secret access key.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From within Grafana, turn on &lt;a href=&#34;../../../administration/database-encryption/&#34;&gt;envelope encryption&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add your AWS KMS details to the Grafana configuration file; depending on your operating system, it is usually named &lt;code&gt;grafana.ini&lt;/code&gt;:
&lt;br&gt;&lt;br&gt;a. Add a new section to the configuration file, with a name in the format of &lt;code&gt;[security.encryption.awskms.&amp;lt;KEY-NAME&amp;gt;]&lt;/code&gt;, where &lt;code&gt;&amp;lt;KEY-NAME&amp;gt;&lt;/code&gt; is any name that uniquely identifies this key among other provider keys.
&lt;br&gt;&lt;br&gt;b. Fill in the section with the following values:
&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;key_id&lt;/code&gt;: a reference to a key stored in the KMS. This can be a key ID, a key Amazon Resource Name (ARN), an alias name, or an alias ARN. If you are using an alias, use the prefix &lt;code&gt;alias/&lt;/code&gt;. To specify a KMS key in a different AWS account, use its ARN or alias. For more information about how to retrieve a key ID from AWS, refer to &lt;a href=&#34;https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Finding the key ID and key ARN&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;code&gt;key_id&lt;/code&gt; option&lt;/th&gt;
              &lt;th&gt;Example value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Key ID&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1234abcd-12ab-34cd-56ef-1234567890ab&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Key ARN&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Alias name&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;alias/ExampleAlias&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Alias ARN&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;access_key_id&lt;/code&gt;: The AWS Access Key ID that you previously generated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;secret_access_key&lt;/code&gt;: The AWS Secret Access Key you previously generated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;region&lt;/code&gt;: The AWS region where you created the KMS key. The region is contained in the key’s ARN. For example: &lt;code&gt;arn:aws:kms:*us-east-2*:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An example of an AWS KMS provider section in the &lt;code&gt;grafana.ini&lt;/code&gt; file is as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;# AWS key management service provider setup
;[security.encryption.awskms.example-encryption-key]
# Reference to a KMS key - either key ID, key ARN, alias name, or ARN
;key_id = 1234abcd-12ab-34cd-56ef-1234567890ab
# AWS access key ID
;access_key_id = AKIAIOSFODNN7EXAMPLE
# AWS secret access key
;secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# AWS region, for example eu-north-1
;region = eu-north-1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[security]&lt;/code&gt; section of the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file with the new Encryption Provider key that you created:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;[security]
# previous encryption key, used for legacy alerts, decrypting existing secrets or used as default provider when external providers are not configured
secret_key = AaaaAaaa
# encryption provider key in the format &amp;lt;PROVIDER&amp;gt;.&amp;lt;KEY_NAME&amp;gt;
encryption_provider = awskms.example-encryption-key
# list of configured key providers, space separated
available_encryption_providers = awskms.example-encryption-key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; The encryption key that is stored in the &lt;code&gt;secret_key&lt;/code&gt; field is still used by Grafana’s legacy alerting system to encrypt secrets, for decrypting existing secrets, or it is used as the default provider when external providers are not configured. Do not change or remove that value when adding a new KMS provider.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/latest/installation/restart-grafana/&#34;&gt;Restart Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) From the command line and the root directory of Grafana, re-encrypt all of the secrets within the Grafana database with the new key using the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin secrets-migration re-encrypt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you do not re-encrypt existing secrets, then they will remain encrypted by the previous encryption key. Users will still be able to access them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; This process could take a few minutes to complete, depending on the number of secrets (such as data sources or alert notification channels) in your database. Users might experience errors while this process is running, and alert notifications might not be sent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; If you are updating this encryption key during the initial setup of Grafana before any data sources, alert notification channels, or dashboards have been created, then this step is not necessary because there are no secrets in Grafana to migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="using-aws-kms-to-encrypt-database-secrets">Using AWS KMS to encrypt database secrets&lt;/h1>
&lt;p>You can use an encryption key from AWS Key Management Service to encrypt secrets in the Grafana database.&lt;/p></description></item><item><title>Google Cloud KMS</title><link>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-google-cloud-kms-to-encrypt-database-secrets/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-google-cloud-kms-to-encrypt-database-secrets/</guid><content><![CDATA[&lt;h1 id=&#34;using-google-cloud-kms-to-encrypt-database-secrets&#34;&gt;Using Google Cloud KMS to encrypt database secrets&lt;/h1&gt;
&lt;p&gt;You can use an encryption key from Google Cloud Key Management Service to encrypt secrets in the Grafana database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Google Cloud account with permission to list and create KMS keys and service accounts to access those keys&lt;/li&gt;
&lt;li&gt;Access to the Grafana &lt;a href=&#34;../../../administration/configuration/#config-file-locations&#34;&gt;configuration&lt;/a&gt; file&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://cloud.google.com/kms/docs/creating-keys#kms-create-key-ring-console&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a key ring&lt;/a&gt; in Google Cloud KMS.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://cloud.google.com/kms/docs/creating-keys#create_a_key&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a symmetric encryption key&lt;/a&gt; in the key ring.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a service account&lt;/a&gt; and assign it a role: it can be a predefined role or custom role with permissions to encrypt and decrypt secrets with Key Management Service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a service account key and save its JSON file&lt;/a&gt; to you computer, for example, as &lt;code&gt;~/.config/gcloud/sample-project-credentials.json&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From within Grafana, turn on &lt;a href=&#34;../../../administration/database-encryption/&#34;&gt;envelope encryption&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add your Google Cloud KMS details to the Grafana configuration file; depending on your operating system, is usually named &lt;code&gt;grafana.ini&lt;/code&gt;:
&lt;br&gt;&lt;br&gt;a. Add a new section to the configuration file, with a name in the format of &lt;code&gt;[security.encryption.azurekv.&amp;lt;KEY-NAME&amp;gt;]&lt;/code&gt;, where &lt;code&gt;&amp;lt;KEY-NAME&amp;gt;&lt;/code&gt; is any name that uniquely identifies this key among other provider keys.
&lt;br&gt;&lt;br&gt;b. Fill in the section with the following values:
&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;key_id&lt;/code&gt;: encryption key ID, refer to &lt;a href=&#34;https://cloud.google.com/kms/docs/getting-resource-ids#getting_the_id_for_a_key_and_version&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Getting the ID for a Key&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;credentials_file&lt;/code&gt;: full path to service account key JSON file on your computer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An example of a Google Cloud KMS provider section in the &lt;code&gt;grafana.ini&lt;/code&gt; file is as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;# Example of Google Cloud KMS provider setup
;[security.encryption.googlekms.example-encryption-key]
# Google Cloud KMS key ID
key_id = 1234abcd-12ab-34cd-56ef-1234567890ab
# Full path to a JSON file with a service account key
credentials_file = ~/.config/gcloud/sample-project-credentials.json&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[security]&lt;/code&gt; section of the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file with the new Encryption Provider key that you created:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;[security]
# previous encryption key, used for legacy alerts, decrypting existing secrets or used as default provider when external providers are not configured
secret_key = AaaaAaaa
# encryption provider key in the format &amp;lt;PROVIDER&amp;gt;.&amp;lt;KEY-NAME&amp;gt;
encryption_provider = googlekms.example-encryption-key
# list of configured key providers, space separated
available_encryption_providers = googlekms.example-encryption-key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; The encryption key stored in the &lt;code&gt;secret_key&lt;/code&gt; field is still used by Grafana’s legacy alerting system to encrypt secrets. Do not change or remove that value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/latest/installation/restart-grafana/&#34;&gt;Restart Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) From the command line and the root directory of Grafana Enterprise, re-encrypt all of the secrets within the Grafana database with the new key using the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin secrets-migration re-encrypt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you do not re-encrypt existing secrets, then they will remain encrypted by the previous encryption key. Users will still be able to access them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; This process could take a few minutes to complete, depending on the number of secrets (such as data sources or alert notification channels) in your database. Users might experience errors while this process is running, and alert notifications might not be sent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; If you are updating this encryption key during the initial setup of Grafana before any data sources, alert notification channels, or dashboards have been created, then this step is not necessary because there are no secrets in Grafana to migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="using-google-cloud-kms-to-encrypt-database-secrets">Using Google Cloud KMS to encrypt database secrets&lt;/h1>
&lt;p>You can use an encryption key from Google Cloud Key Management Service to encrypt secrets in the Grafana database.&lt;/p></description></item><item><title>Hashicorp Vault</title><link>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-hashicorp-key-vault-to-encrypt-database-secrets/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/enterprise/enterprise-encryption/using-hashicorp-key-vault-to-encrypt-database-secrets/</guid><content><![CDATA[&lt;h1 id=&#34;using-hashicorp-vault-to-encrypt-database-secrets&#34;&gt;Using Hashicorp Vault to encrypt database secrets&lt;/h1&gt;
&lt;p&gt;You can use an encryption key from Hashicorp Vault to encrypt secrets in the Grafana database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Permissions to manage Hashicorp Vault to enable secrets engines and issue tokens.&lt;/li&gt;
&lt;li&gt;Access to the Grafana &lt;a href=&#34;../../../administration/configuration/#config-file-locations&#34;&gt;configuration&lt;/a&gt; file&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://www.vaultproject.io/docs/secrets/transit#setup&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Enable the transit secrets engine&lt;/a&gt; in Hashicorp Vault.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://www.vaultproject.io/docs/secrets/transit#setup&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a named encryption key&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://learn.hashicorp.com/tutorials/vault/tokens#periodic-service-tokens&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create a periodic service token&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From within Grafana, turn on &lt;a href=&#34;../../../administration/database-encryption/&#34;&gt;envelope encryption&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add your Hashicorp Vault details to the Grafana configuration file; depending on your operating system, is usually named &lt;code&gt;grafana.ini&lt;/code&gt;:
&lt;br&gt;&lt;br&gt;a. Add a new section to the configuration file, with a name in the format of &lt;code&gt;[security.encryption.hashicorpvault.&amp;lt;KEY-NAME&amp;gt;]&lt;/code&gt;, where &lt;code&gt;&amp;lt;KEY-NAME&amp;gt;&lt;/code&gt; is any name that uniquely identifies this key among other provider keys.
&lt;br&gt;&lt;br&gt;b. Fill in the section with the following values:
&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;token&lt;/code&gt;: a periodic service token used to authenticate within Hashicorp Vault.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;url&lt;/code&gt;: URL of the Hashicorp Vault server.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;transit_engine_path&lt;/code&gt;: mount point of the transit engine.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;key_ring&lt;/code&gt;: name of the encryption key.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;token_renewal_interval&lt;/code&gt;: specifies how often to renew token; should be less than the &lt;code&gt;period&lt;/code&gt; value of a periodic service token.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An example of a Hashicorp Vault provider section in the &lt;code&gt;grafana.ini&lt;/code&gt; file is as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;# Example of Hashicorp Vault provider setup
;[security.encryption.hashicorpvault.example-encryption-key]
# Token used to authenticate within Vault. We suggest to use periodic tokens: more on token types https://www.vaultproject.io/docs/concepts/tokens#service-tokens
;token =
# Location of the Hashicorp Vault server
;url = http://localhost:8200
# Mount point of the transit secret engine
;transit_engine_path = transit
# Key ring name
;key_ring = grafana-encryption-key
# Specifies how often to check if a token needs to be renewed, should be less than a token&amp;#39;s period value
token_renewal_interval = 5m&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[security]&lt;/code&gt; section of the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file with the new Encryption Provider key that you created:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;[security]
# previous encryption key, used for legacy alerts, decrypting existing secrets or used as default provider when external providers are not configured
secret_key = AaaaAaaa
# encryption provider key in the format &amp;lt;PROVIDER&amp;gt;.&amp;lt;KEY-NAME&amp;gt;
encryption_provider = hashicorpvault.example-encryption-key
# list of configured key providers, space separated
available_encryption_providers = hashicorpvault.example-encryption-key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; The encryption key stored in the &lt;code&gt;secret_key&lt;/code&gt; field is still used by Grafana’s legacy alerting system to encrypt secrets. Do not change or remove that value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/latest/installation/restart-grafana/&#34;&gt;Restart Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) From the command line and the root directory of Grafana Enterprise, re-encrypt all of the secrets within the Grafana database with the new key using the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin secrets-migration re-encrypt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you do not re-encrypt existing secrets, then they will remain encrypted by the previous encryption key. Users will still be able to access them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; This process could take a few minutes to complete, depending on the number of secrets (such as data sources or alert notification channels) in your database. Users might experience errors while this process is running, and alert notifications might not be sent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; Note:&lt;/strong&gt; If you are updating this encryption key during the initial setup of Grafana before any data sources, alert notification channels, or dashboards have been created, then this step is not necessary because there are no secrets in Grafana to migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="using-hashicorp-vault-to-encrypt-database-secrets">Using Hashicorp Vault to encrypt database secrets&lt;/h1>
&lt;p>You can use an encryption key from Hashicorp Vault to encrypt secrets in the Grafana database.&lt;/p>
&lt;p>&lt;strong>Prerequisites:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Permissions to manage Hashicorp Vault to enable secrets engines and issue tokens.&lt;/li>
&lt;li>Access to the Grafana &lt;a href="../../../administration/configuration/#config-file-locations">configuration&lt;/a> file&lt;/li>
&lt;/ul>
&lt;ol>
&lt;li>
&lt;p>&lt;a href="https://www.vaultproject.io/docs/secrets/transit#setup" target="_blank" rel="noopener noreferrer">Enable the transit secrets engine&lt;/a> in Hashicorp Vault.&lt;/p></description></item></channel></rss>