<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure database encryption on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/</link><description>Recent content in Configure database encryption on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/index.xml" rel="self" type="application/rss+xml"/><item><title>Encrypt database secrets using Google Cloud KMS</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-google-cloud-kms/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-google-cloud-kms/</guid><content><![CDATA[&lt;h1 id=&#34;encrypt-database-secrets-using-google-cloud-kms&#34;&gt;Encrypt database secrets using Google Cloud KMS&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;../../../configure-grafana/#configuration-file-location&#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 envelope encryption.&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;/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) 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 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="encrypt-database-secrets-using-google-cloud-kms">Encrypt database secrets using Google Cloud KMS&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>Encrypt database secrets using Hashicorp Vault</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault/</guid><content><![CDATA[&lt;h1 id=&#34;encrypt-database-secrets-using-hashicorp-vault&#34;&gt;Encrypt database secrets using Hashicorp Vault&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;../../../configure-grafana/#configuration-file-location&#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 envelope encryption.&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;/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) 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 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="encrypt-database-secrets-using-hashicorp-vault">Encrypt database secrets using Hashicorp Vault&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="../../../configure-grafana/#configuration-file-location">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><item><title>Encrypt database secrets using AWS KMS</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-aws-kms/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-aws-kms/</guid><content><![CDATA[&lt;h1 id=&#34;encrypt-database-secrets-using-aws-kms&#34;&gt;Encrypt database secrets using AWS KMS&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;../../../configure-grafana/#configuration-file-location&#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 envelope encryption.&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;/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) 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 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="encrypt-database-secrets-using-aws-kms">Encrypt database secrets using AWS KMS&lt;/h1>
&lt;p>You can use an encryption key from AWS Key Management Service to encrypt secrets in the Grafana database.&lt;/p>
&lt;p>&lt;strong>Prerequisites:&lt;/strong>&lt;/p></description></item><item><title>Encrypt database secrets using Azure Key Vault</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-azure-key-vault/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-azure-key-vault/</guid><content><![CDATA[&lt;h1 id=&#34;encrypt-database-secrets-using-azure-key-vault&#34;&gt;Encrypt database secrets using Azure Key Vault&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;../../../configure-grafana/#configuration-file-location&#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 envelope encryption.&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;/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) 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 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="encrypt-database-secrets-using-azure-key-vault">Encrypt database secrets using Azure Key Vault&lt;/h1>
&lt;p>You can use an encryption key from Azure Key Vault to encrypt secrets in the Grafana database.&lt;/p>
&lt;p>&lt;strong>Prerequisites:&lt;/strong>&lt;/p></description></item><item><title>Integrate Grafana with Hashicorp Vault</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/integrate-with-hashicorp-vault/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-security/configure-database-encryption/integrate-with-hashicorp-vault/</guid><content><![CDATA[&lt;h1 id=&#34;integrate-grafana-with-hashicorp-vault&#34;&gt;Integrate Grafana with Hashicorp Vault&lt;/h1&gt;
&lt;p&gt;If you manage your secrets with &lt;a href=&#34;https://www.hashicorp.com/products/vault&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Hashicorp Vault&lt;/a&gt;, you can use them for &lt;a href=&#34;../../../configure-grafana/&#34;&gt;Configuration&lt;/a&gt; and &lt;a href=&#34;../../../../administration/provisioning/&#34;&gt;Provisioning&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Available in &lt;a href=&#34;../../../../introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If you have Grafana &lt;a href=&#34;../../../set-up-for-high-availability/&#34;&gt;set up for high availability&lt;/a&gt;, then we advise not to use dynamic secrets for provisioning files.
Each Grafana instance is responsible for renewing its own leases. Your data source leases might expire when one of your Grafana servers shuts down.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;Before using Vault, you need to activate it by providing a URL, authentication method (currently only token),
and a token for your Vault service. Grafana automatically renews the service token if it is renewable and
set up with a limited lifetime.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using short-lived leases, then you can also configure how often Grafana should renew the lease and for how long. We recommend keeping the defaults unless you run into problems.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[keystore.vault]
# Location of the Vault server
;url =
# Vault namespace if using Vault with multi-tenancy
;namespace =
# Method for authenticating towards Vault. Vault is inactive if this option is not set
# Possible values: token
;auth_method =
# Secret token to connect to Vault when auth_method is token
;token =
# Time between checking if there are any secrets which needs to be renewed.
;lease_renewal_interval = 5m
# Time until expiration for tokens which are renewed. Should have a value higher than lease_renewal_interval
;lease_renewal_expires_within = 15m
# New duration for renewed tokens. Vault may be configured to ignore this value and impose a stricter limit.
;lease_renewal_increment = 1h&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Example for &lt;code&gt;vault server -dev&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[keystore.vault]
url = http://127.0.0.1:8200 # HTTP should only be used for local testing
auth_method = token
token = s.sAZLyI0r7sFLMPq6MWtoOhAN # replace with your key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;using-the-vault-expander&#34;&gt;Using the Vault expander&lt;/h2&gt;
&lt;p&gt;After you configure Vault, you must set the configuration or provisioning files you wish to
use Vault. Vault configuration is an extension of configuration&amp;rsquo;s &lt;a href=&#34;../../../configure-grafana/#variable-expansion&#34;&gt;variable expansion&lt;/a&gt; and follows the
&lt;code&gt;$__vault{&amp;lt;argument&amp;gt;}&lt;/code&gt; syntax.&lt;/p&gt;
&lt;p&gt;The argument to Vault consists of three parts separated by a colon:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The first part specifies which secrets engine should be used.&lt;/li&gt;
&lt;li&gt;The second part specifies which secret should be accessed.&lt;/li&gt;
&lt;li&gt;The third part specifies which field of that secret should be used.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, if you place a Key/Value secret for the Grafana admin user in &lt;em&gt;secret/grafana/admin_defaults&lt;/em&gt;
the syntax for accessing its &lt;em&gt;password&lt;/em&gt; field would be &lt;code&gt;$__vault{kv:secret/grafana/admin_defaults:password}&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;secrets-engines&#34;&gt;Secrets engines&lt;/h3&gt;
&lt;p&gt;Vault supports many secrets engines which represents different methods for storing or generating secrets when requested by an
authorized user. Grafana supports a subset of these which are most likely to be relevant for a Grafana installation.&lt;/p&gt;
&lt;h4 id=&#34;keyvalue&#34;&gt;Key/Value&lt;/h4&gt;
&lt;p&gt;Grafana supports Vault&amp;rsquo;s &lt;a href=&#34;https://www.vaultproject.io/docs/secrets/kv/kv-v2&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;K/V version 2&lt;/a&gt; storage engine which
is used to store and retrieve arbitrary secrets as &lt;code&gt;kv&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;$__vault{kv:secret/grafana/smtp:username}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;databases&#34;&gt;Databases&lt;/h4&gt;
&lt;p&gt;The Vault &lt;a href=&#34;https://www.vaultproject.io/docs/secrets/databases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;databases secrets engines&lt;/a&gt; is a family of
secret engines which shares a similar syntax and grants the user dynamic access to a database.
You can use this both for setting up Grafana&amp;rsquo;s own database access and for provisioning data sources.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;$__vault{database:database/creds/grafana:username}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;The following examples show you how to set your &lt;a href=&#34;../../../configure-grafana/&#34;&gt;configuration&lt;/a&gt; or &lt;a href=&#34;../../../../administration/provisioning/&#34;&gt;provisioning&lt;/a&gt; files to use Vault to retrieve configuration values.&lt;/p&gt;
&lt;h4 id=&#34;configuration-1&#34;&gt;Configuration&lt;/h4&gt;
&lt;p&gt;The following is a partial example for using Vault to set up a Grafana configuration file&amp;rsquo;s email and database credentials.
Refer to &lt;a href=&#34;../../../configure-grafana/&#34;&gt;Configuration&lt;/a&gt; for more information.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[smtp]
enabled = true
host = $__vault{kv:secret/grafana/smtp:hostname}:587
user = $__vault{kv:secret/grafana/smtp:username}
password = $__vault{kv:secret/grafana/smtp:password}

[database]
type = mysql
host = mysqlhost:3306
name = grafana
user = $__vault{database:database/creds/grafana:username}
password = $__vault{database:database/creds/grafana:password}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;provisioning&#34;&gt;Provisioning&lt;/h4&gt;
&lt;p&gt;The following is a full examples of a provisioning YAML file setting up a MySQL data source using Vault&amp;rsquo;s
database secrets engine.
Refer to &lt;a href=&#34;../../../../administration/provisioning/&#34;&gt;Provisioning&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;provisioning/custom.yaml&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;apiVersion: 1

datasources:
  - name: statistics
    type: mysql
    url: localhost:3306
    database: stats
    user: $__vault{database:database/creds/ro/stats:username}
    secureJsonData:
      password: $__vault{database:database/creds/ro/stats:password}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="integrate-grafana-with-hashicorp-vault">Integrate Grafana with Hashicorp Vault&lt;/h1>
&lt;p>If you manage your secrets with &lt;a href="https://www.hashicorp.com/products/vault" target="_blank" rel="noopener noreferrer">Hashicorp Vault&lt;/a>, you can use them for &lt;a href="../../../configure-grafana/">Configuration&lt;/a> and &lt;a href="../../../../administration/provisioning/">Provisioning&lt;/a>.&lt;/p>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Available in &lt;a href="../../../../introduction/grafana-enterprise/">Grafana Enterprise&lt;/a>.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p></description></item></channel></rss>