Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Encrypt only settings that are secret or integrity-critical (#81506)

Alexander Polyankin629fd1fee0ad
diff --git a/enterprise/backend/src/metabase_enterprise/metabot/settings.clj b/enterprise/backend/src/metabase_enterprise/metabot/settings.clj
index 72aac16f2f1..c41e0d06273 100644
--- a/enterprise/backend/src/metabase_enterprise/metabot/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/metabot/settings.clj
@@ -45,7 +45,7 @@
:type :string
:default "You have reached your AI usage limit for the current period. Please contact your administrator."
:visibility :settings-manager
- :encryption :when-encryption-key-set
+ :encryption :no
:export? true
:feature :ai-controls)
diff --git a/enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj b/enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
index c5a4e178b5a..7cd540ab6fe 100644
--- a/enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
@@ -198,7 +198,7 @@
:type :string
:visibility :internal
:export? false
- :encryption :when-encryption-key-set
+ :encryption :no
:doc false)
(defn check-and-update-remote-settings!
diff --git a/enterprise/backend/src/metabase_enterprise/scim/settings.clj b/enterprise/backend/src/metabase_enterprise/scim/settings.clj
index 7fba837304d..e53c408ad31 100644
--- a/enterprise/backend/src/metabase_enterprise/scim/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/scim/settings.clj
@@ -13,6 +13,7 @@
(defsetting scim-base-url
(deferred-tru "Base URL for SCIM endpoints")
+ :encryption :no
:visibility :admin
:type :string
:setter :none
diff --git a/enterprise/backend/src/metabase_enterprise/sso/settings.clj b/enterprise/backend/src/metabase_enterprise/sso/settings.clj
index e935f714474..9ad8c227fd0 100644
--- a/enterprise/backend/src/metabase_enterprise/sso/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/sso/settings.clj
@@ -401,6 +401,7 @@ on your IdP, this usually looks something like `http://www.example.com/141xkex60
(defsetting oidc-login-providers
(deferred-tru "Public-facing list of enabled OIDC providers for the login page.")
+ :encryption :no
:type :json
:default []
:feature :sso-oidc
@@ -430,6 +431,7 @@ on your IdP, this usually looks something like `http://www.example.com/141xkex60
(defsetting other-sso-enabled?
"Are we using an SSO integration other than LDAP or Google Auth or OIDC? These integrations use the `/auth/sso` endpoint
(SAML/JWT) for authorization rather than the normal login form or Google Auth button."
+ :encryption :no
:visibility :public
:setter :none
:getter (fn [] (or (saml-enabled) (jwt-enabled-and-configured))))
diff --git a/enterprise/backend/src/metabase_enterprise/support_access_grants/settings.clj b/enterprise/backend/src/metabase_enterprise/support_access_grants/settings.clj
index f29b171cf7d..cf3b7cb6302 100644
--- a/enterprise/backend/src/metabase_enterprise/support_access_grants/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/support_access_grants/settings.clj
@@ -5,6 +5,7 @@
(defsetting support-access-grant-email
(deferred-tru "Email to grant temporary access to for support")
+ :encryption :when-encryption-key-set
:type :string
:visibility :internal
:export? false
@@ -15,6 +16,7 @@
(defsetting support-access-grant-first-name
(deferred-tru "First name of the support user")
+ :encryption :no
:type :string
:visibility :internal
:export? false
@@ -25,6 +27,7 @@
(defsetting support-access-grant-last-name
(deferred-tru "Last name of the support user")
+ :encryption :no
:type :string
:visibility :internal
:export? false
diff --git a/src/metabase/analytics/settings.clj b/src/metabase/analytics/settings.clj
index c68a4a36df1..ff19900e46e 100644
--- a/src/metabase/analytics/settings.clj
+++ b/src/metabase/analytics/settings.clj
@@ -89,6 +89,7 @@
(defsetting instance-creation
(deferred-tru "The approximate timestamp at which this instance of Metabase was created, for inclusion in analytics.")
+ :encryption :no
:visibility :public
:setter :none
:getter #'-instance-creation
diff --git a/src/metabase/app_db/custom_migrations.clj b/src/metabase/app_db/custom_migrations.clj
index 83b7d148f10..d7b2302b9eb 100644
--- a/src/metabase/app_db/custom_migrations.clj
+++ b/src/metabase/app_db/custom_migrations.clj
@@ -2319,116 +2319,68 @@
`:encryption` went from `:no` to `:when-encryption-key-set` in v58, and the previously-encrypted ones, whose rows
can still be plaintext from the era when encryption was write-time only. Settings with `:setter :none` are listed
separately in [[encrypted-setter-none-settings-v58]]; rows for settings that no longer exist are left alone.
+ Settings that are neither secret nor integrity-critical are deliberately absent -- they are `:encryption :no`, and
+ the startup reconcile decrypts any row of theirs this migration encrypted before they were reclassified.
`encrypt-settings-test` checks this list against the registry."
["admin-email" "ai-service-base-url" "allowed-iframe-hosts"
- "api-key" "application-colors" "application-favicon-url"
- "application-font-files" "application-logo-url" "csp-img-allowed-hosts"
- "custom-formatting" "custom-geojson" "database-replication-connections"
- "ee-embedding-provider" "ee-embedding-service-api-key" "ee-embedding-service-base-url"
- "email-from-address" "email-from-address-override" "email-from-name"
- "email-reply-to" "email-smtp-host" "email-smtp-host-override"
- "email-smtp-password" "email-smtp-password-override" "email-smtp-port"
- "email-smtp-port-override" "email-smtp-security" "email-smtp-security-override"
- "email-smtp-username" "email-smtp-username-override" "embedding-app-origins-interactive"
- "embedding-app-origins-sdk" "embedding-secret-key" "google-auth-auto-create-accounts-domain"
- "google-auth-client-id" "gsheets" "help-link-custom-destination"
+ "api-key" "csp-img-allowed-hosts" "custom-geojson"
+ "database-replication-connections" "ee-embedding-provider" "ee-embedding-service-api-key"
+ "ee-embedding-service-base-url" "email-from-address" "email-from-address-override"
+ "email-from-name" "email-reply-to" "email-smtp-host"
+ "email-smtp-host-override" "email-smtp-password" "email-smtp-password-override"
+ "email-smtp-port" "email-smtp-port-override" "email-smtp-security"
+ "email-smtp-security-override" "email-smtp-username" "email-smtp-username-override"
+ "embedding-app-origins-interactive" "embedding-app-origins-sdk" "embedding-secret-key"
+ "google-auth-auto-create-accounts-domain" "google-auth-client-id" "gsheets"
"jwt-attribute-email" "jwt-attribute-firstname" "jwt-attribute-groups"
"jwt-attribute-lastname" "jwt-attribute-tenant" "jwt-attribute-tenant-attributes"
"jwt-group-mappings" "jwt-identity-provider-uri" "jwt-shared-secret"
- "landing-page" "landing-page-illustration-custom" "ldap-attribute-email"
- "ldap-attribute-firstname" "ldap-attribute-lastname" "ldap-bind-dn"
- "ldap-group-base" "ldap-group-mappings" "ldap-group-membership-filter"
- "ldap-host" "ldap-password" "ldap-port"
- "ldap-sync-user-attributes-blacklist" "ldap-user-base" "ldap-user-filter"
- "llm-anthropic-api-base-url" "llm-anthropic-api-key" "llm-azure-api-base-url"
- "llm-azure-api-key" "llm-bedrock-access-key-id" "llm-bedrock-secret-access-key"
- "llm-bedrock-session-token" "llm-deepseek-api-base-url" "llm-deepseek-api-key"
- "llm-google-api-base-url" "llm-google-oauth-access-token" "llm-google-service-account-key"
- "llm-mistral-api-base-url" "llm-mistral-api-key" "llm-moonshot-api-base-url"
- "llm-moonshot-api-key" "llm-openai-api-base-url" "llm-openai-api-key"
- "llm-openrouter-api-base-url" "llm-openrouter-api-key" "llm-providers"
- "llm-proxy-base-url" "llm-vllm-api-base-url" "llm-vllm-api-key"
- "llm-zai-api-base-url" "llm-zai-api-key" "locked-meters"
- "login-page-illustration-custom" "map-tile-server-url" "mcp-apps-cors-custom-origins"
- "mcp-apps-cors-enabled-clients" "metabot-chat-system-prompt" "metabot-nlq-system-prompt"
- "metabot-quota-reached-message" "metabot-slack-signing-secret" "metabot-sql-system-prompt"
- "metaplow-url" "mfa-challenge-signing-key" "migration-dump-file"
- "no-data-illustration-custom" "no-object-illustration-custom" "notification-link-base-url"
- "oidc-providers" "premium-embedding-token" "python-runner-api-token"
- "python-runner-url" "python-storage-s-3-access-key" "python-storage-s-3-container-endpoint"
- "python-storage-s-3-endpoint" "python-storage-s-3-secret-key" "remote-sync-allow"
- "remote-sync-branch" "remote-sync-token" "remote-sync-url"
- "saml-application-name" "saml-attribute-email" "saml-attribute-firstname"
- "saml-attribute-group" "saml-attribute-lastname" "saml-attribute-tenant"
- "saml-group-mappings" "saml-identity-provider-certificate" "saml-identity-provider-issuer"
- "saml-identity-provider-slo-uri" "saml-identity-provider-uri" "saml-keystore-alias"
- "saml-keystore-password" "saml-keystore-path" "sdk-encryption-validation-key"
- "search-language" "security-center-email-recipients" "security-center-slack-channel"
- "session-timeout" "site-url" "slack-app-token"
- "slack-bug-report-channel" "slack-cached-channels-and-usernames" "slack-connect-attribute-team-id"
- "slack-connect-authentication-mode" "slack-connect-client-id" "slack-connect-client-secret"
- "slack-files-channel" "snowplow-url" "source-address-header"
- "store-api-url" "store-url" "subscription-allowed-domains"
- "uploads-settings"])
+ "ldap-attribute-email" "ldap-attribute-firstname" "ldap-attribute-lastname"
+ "ldap-bind-dn" "ldap-group-base" "ldap-group-mappings"
+ "ldap-group-membership-filter" "ldap-host" "ldap-password"
+ "ldap-port" "ldap-sync-user-attributes-blacklist" "ldap-user-base"
+ "ldap-user-filter" "llm-anthropic-api-base-url" "llm-anthropic-api-key"
+ "llm-azure-api-base-url" "llm-azure-api-key" "llm-bedrock-access-key-id"
+ "llm-bedrock-secret-access-key" "llm-bedrock-session-token" "llm-deepseek-api-base-url"
+ "llm-deepseek-api-key" "llm-google-api-base-url" "llm-google-oauth-access-token"
+ "llm-google-service-account-key" "llm-mistral-api-base-url" "llm-mistral-api-key"
+ "llm-moonshot-api-base-url" "llm-moonshot-api-key" "llm-openai-api-base-url"
+ "llm-openai-api-key" "llm-openrouter-api-base-url" "llm-openrouter-api-key"
+ "llm-providers" "llm-proxy-base-url" "llm-vllm-api-base-url"
+ "llm-vllm-api-key" "llm-zai-api-base-url" "llm-zai-api-key"
+ "map-tile-server-url" "mcp-apps-cors-custom-origins" "mcp-apps-cors-enabled-clients"
+ "metabot-chat-system-prompt" "metabot-nlq-system-prompt" "metabot-slack-signing-secret"
+ "metabot-sql-system-prompt" "metaplow-url" "mfa-challenge-signing-key"
+ "migration-dump-file" "notification-link-base-url" "oidc-providers"
+ "premium-embedding-token" "python-runner-api-token" "python-runner-url"
+ "python-storage-s-3-access-key" "python-storage-s-3-container-endpoint" "python-storage-s-3-endpoint"
+ "python-storage-s-3-secret-key" "remote-sync-branch" "remote-sync-token"
+ "remote-sync-url" "report-timezone" "saml-application-name"
+ "saml-attribute-email" "saml-attribute-firstname" "saml-attribute-group"
+ "saml-attribute-lastname" "saml-attribute-tenant" "saml-group-mappings"
+ "saml-identity-provider-certificate" "saml-identity-provider-issuer" "saml-identity-provider-slo-uri"
+ "saml-identity-provider-uri" "saml-keystore-alias" "saml-keystore-password"
+ "saml-keystore-path" "sdk-encryption-validation-key" "search-language"
+ "security-center-email-recipients" "security-center-slack-channel" "session-timeout"
+ "site-url" "slack-app-token" "slack-bug-report-channel"
+ "slack-connect-attribute-team-id" "slack-connect-authentication-mode" "slack-connect-client-id"
+ "slack-connect-client-secret" "slack-files-channel" "snowplow-url"
+ "source-address-header" "store-api-url" "store-url"
+ "subscription-allowed-domains"])
(define-reversible-migration EncryptSettingsV58
(encrypt-settings encrypted-settings-v58)
(decrypt-settings encrypted-settings-v58))
(def ^:private encrypted-setter-none-settings-v58
- "Every registered `:setter :none` setting that is encrypted at rest as of v58. A `:setter :none` setting defaults
- to `:encryption :when-encryption-key-set` whatever its type (that rule precedes the plaintext default for booleans
- and the like), so it is read strictly -- but some of them were settable in older versions and stored plaintext back
- then (e.g. `enable-query-caching` and `enable-nested-queries`, once admin toggles saved as plaintext booleans). Such
- a row failed the strict read and, since the settings cache restores the whole table at once, took every setting
- down with it. Rows written programmatically (`setup-token`, `instance-creation`, ...) are already encrypted and are
- left untouched. `encrypt-setter-none-settings-test` checks a few known names are listed."
- ["active-users-count" "ai-eval-capture" "airgap-enabled"
- "audit-max-retention-days" "audit-table-truncation-batch-size" "available-fonts"
- "available-locales" "available-timezones" "bug-reporting-enabled"
- "can-disable-password-login?" "cloud-custom-smtp?" "cloud-gateway-ips"
- "custom-viz-plugin-dev-mode-enabled" "database-replication-enabled" "dependency-backfill-batch-size"
- "dependency-backfill-delay-minutes" "dependency-backfill-variance-minutes" "dependency-entity-check-batch-size"
- "dependency-entity-check-delay-minutes" "dependency-entity-check-variance-minutes" "development-mode?"
- "email-configured?" "enable-advanced-permissions?" "enable-ai-controls?"
- "enable-audit-app?" "enable-basic-transforms?" "enable-cache-granular-controls?"
- "enable-collection-cleanup?" "enable-config-text-file?" "enable-content-translation?"
- "enable-content-verification?" "enable-dashboard-subscription-filters?" "enable-data-apps?"
- "enable-data-complexity-score?" "enable-database-auth-providers?" "enable-database-routing?"
- "enable-dependencies?" "enable-email-allow-list?" "enable-email-restrict-recipients?"
- "enable-embedding-hub?" "enable-embedding-sdk-origins?" "enable-embedding-simple-feature?"
- "enable-etl-connections-pg?" "enable-etl-connections?" "enable-library-retrieval?"
- "enable-library?" "enable-metabase-ai-managed?" "enable-metabot-v3?"
- "enable-multi-factor-auth?" "enable-nested-queries" "enable-offer-metabase-ai-managed?"
- "enable-official-collections?" "enable-preemptive-caching?" "enable-python-transforms?"
- "enable-query-caching" "enable-query-reference-validation?" "enable-remote-sync?"
- "enable-sandboxes?" "enable-schema-viewer?" "enable-scim?"
- "enable-semantic-search?" "enable-serialization?" "enable-session-timeout-config?"
- "enable-snippet-collections?" "enable-sso-google?" "enable-sso-jwt?"
- "enable-sso-ldap?" "enable-sso-oidc?" "enable-sso-saml?"
- "enable-support-users?" "enable-tenants?" "enable-upload-management?"
- "enable-whitelabeling?" "enable-writable-connection?" "encryption-enabled"
- "engines" "example-dashboard-id" "google-auth-configured"
- "has-attached-dwh?" "has-sample-database?" "hide-embed-branding?"
- "install-analytics-database" "instance-creation" "is-hosted?"
- "jdbc-data-warehouse-debug-unreturned-connection-stack-traces" "jdbc-data-warehouse-unreturned-connection-timeout-seconds" "jwt-configured"
- "ldap-configured?" "llm-anthropic-api-key-configured?" "llm-metabot-configured?"
- "llm-metabot-supports-reasoning?" "load-analytics-content" "mcp-embedding-signing-secret"
- "new-device-email-rate-limit-cap" "notification-temp-file-size-max-bytes" "oidc-configured"
- "oidc-enabled" "oidc-login-providers" "other-sso-enabled?"
- "password-complexity" "remote-sync-enabled" "report-timezone-long"
- "report-timezone-short" "saml-configured" "scim-base-url"
- "search-engine" "security-center-disabled" "security-center-enabled?"
- "send-email-on-first-login-from-new-device" "serialization-skip-schema-validation" "setup-token"
- "show-google-sheets-integration" "site-uuid-for-premium-features-token-checks" "site-uuid-for-unsubscribing-url"
- "site-uuid-for-version-info-fetching" "slack-configured?" "slack-connect-configured"
- "slackbot-event-handler-pool-size" "snowplow-enabled" "support-access-grant-email"
- "support-access-grant-first-name" "support-access-grant-last-name" "system-timezone"
- "table-data-editing?" "token-features" "token-status"
- "tracing-enabled" "tracing-endpoint" "tracing-export-timeout-ms"
- "tracing-groups" "tracing-log-level" "tracing-max-queue-size"
- "tracing-schedule-delay-ms" "tracing-service-name" "transforms-meter-locked"
- "upgrade-threshold" "version"])
+ "The `:setter :none` settings that are encrypted at rest: each is either a secret or a value whose integrity
+ decides who gets access (`setup-token` creates the first admin, `support-access-grant-email` drives creation of a
+ support superuser, `site-uuid-for-unsubscribing-url` salts unsubscribe URLs, `mcp-embedding-signing-secret` signs
+ embedding tokens, `tracing-endpoint` decides where telemetry is sent). Their rows can be plaintext from before they
+ were encrypted, which the strict read rejects -- and since the settings cache restores the whole table at once, one
+ such row took every setting down with it. `encrypt-setter-none-settings-test` checks these names are listed."
+ ["mcp-embedding-signing-secret" "setup-token" "site-uuid-for-unsubscribing-url"
+ "support-access-grant-email" "tracing-endpoint"])
(define-migration EncryptSetterNoneSettingsV58
(encrypt-settings encrypted-setter-none-settings-v58))
diff --git a/src/metabase/appearance/settings.clj b/src/metabase/appearance/settings.clj
index 89cc963b734..f1c807f5cc6 100644
--- a/src/metabase/appearance/settings.clj
+++ b/src/metabase/appearance/settings.clj
@@ -58,7 +58,7 @@
(defsetting landing-page
(deferred-tru "Enter a relative URL like /dashboard/1 or /collection/2.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -98,7 +98,7 @@
(defsetting application-colors
(deferred-tru "Choose the colors used in the user interface throughout Metabase and others specifically for the charts. You need to refresh your browser to see your changes take effect.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :json
@@ -147,7 +147,7 @@ To change the chart colors:
(defsetting application-font-files
(deferred-tru "Tell us where to find the file for each font weight. You don’t need to include all of them, but it’ll look better if you do.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :json
@@ -184,7 +184,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting application-logo-url
(deferred-tru "Upload a file to replace the Metabase logo on the top bar.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -195,7 +195,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting application-favicon-url
(deferred-tru "Upload a file to use as the favicon.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -225,7 +225,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting login-page-illustration-custom
(deferred-tru "The custom illustration for the login page.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -244,7 +244,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting landing-page-illustration-custom
(deferred-tru "The custom illustration for the landing page.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -263,7 +263,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting no-data-illustration-custom
(deferred-tru "The custom illustration for when there are no results after running a question.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -282,7 +282,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting no-object-illustration-custom
(deferred-tru "The custom illustration for when there are no results after searching.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:export? true
:type :string
@@ -324,7 +324,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting help-link-custom-destination
(deferred-tru "Custom URL for the help link.")
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :public
:type :string
:audit :getter
@@ -362,7 +362,7 @@ See [fonts](../configuring-metabase/fonts.md).")
(defsetting custom-formatting
(deferred-tru "Object keyed by type, containing formatting settings")
- :encryption :when-encryption-key-set
+ :encryption :no
:type :json
:export? true
:default {}
diff --git a/src/metabase/audit_app/settings.clj b/src/metabase/audit_app/settings.clj
index 68ce3c5c7bd..14a6eb2b062 100644
--- a/src/metabase/audit_app/settings.clj
+++ b/src/metabase/audit_app/settings.clj
@@ -48,6 +48,7 @@
(defsetting audit-max-retention-days
(deferred-tru "Number of days to retain data in audit-related tables. Minimum value is 30; set to 0 to retain data indefinitely.")
+ :encryption :no
:visibility :internal
:setter :none
:audit :never
diff --git a/src/metabase/channel/settings.clj b/src/metabase/channel/settings.clj
index b598dddc404..ec0581aa14b 100644
--- a/src/metabase/channel/settings.clj
+++ b/src/metabase/channel/settings.clj
@@ -35,7 +35,7 @@
(defsetting slack-cached-channels-and-usernames
"A cache shared between instances for storing an instance's slack channels and users."
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :internal
:type :json
:doc false
diff --git a/src/metabase/driver/settings.clj b/src/metabase/driver/settings.clj
index 60a7952bbaa..5017259be6e 100644
--- a/src/metabase/driver/settings.clj
+++ b/src/metabase/driver/settings.clj
@@ -50,7 +50,7 @@
(defsetting report-timezone
(deferred-tru "Connection timezone to use when executing queries. Defaults to system timezone.")
- :encryption :no
+ :encryption :when-encryption-key-set
:visibility :settings-manager
:export? true
:audit :getter
@@ -70,6 +70,7 @@
(defsetting report-timezone-short
"Current report timezone abbreviation"
+ :encryption :no
:visibility :public
:export? true
:setter :none
@@ -86,6 +87,7 @@
(defsetting report-timezone-long
"Current report timezone string"
+ :encryption :no
:visibility :public
:export? true
:setter :none
@@ -261,6 +263,7 @@
(defsetting engines
"Available database engines"
+ :encryption :no
:visibility :public
:setter :none
:getter (fn []
diff --git a/src/metabase/premium_features/settings.clj b/src/metabase/premium_features/settings.clj
index 4e66208e3f9..a0ce1743ee9 100644
--- a/src/metabase/premium_features/settings.clj
+++ b/src/metabase/premium_features/settings.clj
@@ -14,7 +14,7 @@
in [[metabase.premium-features.core/fetch-token-status]]. (`site-uuid` is used for anonymous
analytics aka stats and if we sent it along with the premium features token check API request it would no longer be
anonymous.)"
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :internal
:base setting/uuid-nonce-base
:doc false)
@@ -32,6 +32,7 @@
(defsetting token-status
(deferred-tru "Cached token status for premium features. This is to avoid an API request on the the first page load.")
+ :encryption :no
:visibility :admin
:type :json
:audit :never
@@ -41,7 +42,7 @@
(defsetting locked-meters
(deferred-tru "Locally-mirrored is-locked state per meter, refreshed on each successful token-check.")
- :encryption :when-encryption-key-set
+ :encryption :no
:type :json
:visibility :internal
:audit :never
@@ -443,6 +444,7 @@
(defsetting token-features
"Features registered for this instance's token"
+ :encryption :no
:visibility :public
:setter :none
:getter -token-features
diff --git a/src/metabase/session/settings.clj b/src/metabase/session/settings.clj
index b48af2d623f..9b2f662e249 100644
--- a/src/metabase/session/settings.clj
+++ b/src/metabase/session/settings.clj
@@ -25,6 +25,7 @@
(defsetting password-complexity
"Current password complexity requirements"
+ :encryption :no
:visibility :public
:setter :none
:getter u.password/active-password-complexity)
diff --git a/src/metabase/settings/models/setting.clj b/src/metabase/settings/models/setting.clj
index 57cda655e8f..27910f24d4e 100644
--- a/src/metabase/settings/models/setting.clj
+++ b/src/metabase/settings/models/setting.clj
@@ -1067,9 +1067,6 @@
- ON for settings marked as `sensitive?`
- - ON for settings with a setter of `:none` (the specific value here doesn't really matter, we just don't want the
- caller to need to provide a value)
-
- OFF for types unlikely to contain secrets. As of this writing, that's booleans, numbers, keywords, and timestamps
If none of these conditions are met (a non-`:sensitive?` string/json/csv value you're storing in the database, and
@@ -1085,10 +1082,6 @@
;; if a setting is `:sensitive?`, default to encrypting it
(when (:sensitive? setting)
:when-encryption-key-set)
- ;; if a setting isn't stored in the DB, the value doesn't really matter, but provide
- ;; a default so the caller doesn't have to
- (when (= (:setter setting) :none)
- :when-encryption-key-set)
;; if the setting isn't a type likely to contain secrets, default to plaintext
(when (contains? #{:boolean :integer :positive-integer :double :keyword :timestamp} (:type setting))
:no)
diff --git a/src/metabase/setup/settings.clj b/src/metabase/setup/settings.clj
index b08aa93ca9f..9f9cf53b14a 100644
--- a/src/metabase/setup/settings.clj
+++ b/src/metabase/setup/settings.clj
@@ -10,6 +10,7 @@
"A token used to signify that an instance has permissions to create the initial User. This is created upon the first
launch of Metabase, by the first instance; once used, it is cleared out, never to be used again.
Setter is none so users cannot overwrite or re-set the setup-token from the generated value"
+ :encryption :when-encryption-key-set
:visibility :public
:setter :none
:audit :never
diff --git a/src/metabase/system/settings.clj b/src/metabase/system/settings.clj
index a8d370b3311..0edc86e27e9 100644
--- a/src/metabase/system/settings.clj
+++ b/src/metabase/system/settings.clj
@@ -97,6 +97,7 @@
(defsetting available-fonts
"Available fonts"
+ :encryption :no
:visibility :public
:export? true
:setter :none
@@ -105,6 +106,7 @@
(defsetting available-locales
"Available i18n locales"
+ :encryption :no
:visibility :public
:export? true
:setter :none
@@ -113,6 +115,7 @@
(defsetting available-timezones
"Available report timezone options"
+ :encryption :no
:visibility :public
:export? true
:setter :none
@@ -121,6 +124,7 @@
(defsetting system-timezone
"The timezone used by the system by default. AKA the JVM timezone."
+ :encryption :no
:visibility :authenticated
:export? true
:setter :none
diff --git a/src/metabase/tracing/settings.clj b/src/metabase/tracing/settings.clj
index 6810798db47..778f4f07d2e 100644
--- a/src/metabase/tracing/settings.clj
+++ b/src/metabase/tracing/settings.clj
@@ -18,6 +18,7 @@
(defsetting tracing-endpoint
(deferred-tru "OTLP HTTP collector endpoint for trace export (e.g., http://localhost:4318/v1/traces).")
+ :encryption :when-encryption-key-set
:type :string
:default "http://localhost:4318/v1/traces"
:visibility :internal
@@ -26,6 +27,7 @@
(defsetting tracing-groups
(deferred-tru "Comma-separated list of trace groups to enable, or \"all\" for everything.")
+ :encryption :no
:type :string
:default "all"
:visibility :internal
@@ -34,6 +36,7 @@
(defsetting tracing-log-level
(deferred-tru "Log level threshold during traced spans. When a span is active, log events at this level and above bypass per-logger level gates via Log4j2 DynamicThresholdFilter. Requires the filter in log4j2.xml. Valid values: \"INFO\", \"DEBUG\", \"TRACE\".")
+ :encryption :no
:type :string
:default "INFO"
:visibility :internal
@@ -74,6 +77,7 @@
(defsetting tracing-service-name
(deferred-tru "Service name reported in traces. Defaults to the hostname.")
+ :encryption :no
:type :string
:visibility :internal
:export? false
diff --git a/src/metabase/upload/settings.clj b/src/metabase/upload/settings.clj
index c0625fe142b..f3e7804c77e 100644
--- a/src/metabase/upload/settings.clj
+++ b/src/metabase/upload/settings.clj
@@ -21,7 +21,7 @@
(defsetting uploads-settings
(deferred-tru "Upload settings")
- :encryption :when-encryption-key-set ; this doesn't really have an effect as this setting is not stored as a setting model
+ :encryption :no ; this doesn't really have an effect as this setting is not stored as a setting model
:visibility :authenticated
:export? false ; the data is exported with a database export, so we don't need to export a setting
:type :json
diff --git a/src/metabase/version/settings.clj b/src/metabase/version/settings.clj
index 686c631af9e..2892047d0fe 100644
--- a/src/metabase/version/settings.clj
+++ b/src/metabase/version/settings.clj
@@ -8,6 +8,7 @@
(defsetting version
"Metabase's version info"
+ :encryption :no
:visibility :public
:setter :none
:getter (constantly config/mb-version-info)
@@ -51,7 +52,7 @@
"A *different* site-wide UUID that we use for the version info fetching API calls. Do not use this for any other
applications. (See [[metabase.premium-features.settings/site-uuid-for-premium-features-token-checks]] for more
reasoning.)"
- :encryption :when-encryption-key-set
+ :encryption :no
:visibility :internal
:base setting/uuid-nonce-base)
diff --git a/src/metabase/warehouses/settings.clj b/src/metabase/warehouses/settings.clj
index dca974722c5..3b9e1dd1a39 100644
--- a/src/metabase/warehouses/settings.clj
+++ b/src/metabase/warehouses/settings.clj
@@ -21,6 +21,7 @@
(defsetting cloud-gateway-ips
(deferred-tru "Metabase Cloud gateway IP addresses, to configure connections to DBs behind firewalls")
+ :encryption :no
:visibility :public
:type :string
:setter :none
diff --git a/test/metabase/app_db/custom_migrations_test.clj b/test/metabase/app_db/custom_migrations_test.clj
index 86a996141c6..75c58e690b6 100644
--- a/test/metabase/app_db/custom_migrations_test.clj
+++ b/test/metabase/app_db/custom_migrations_test.clj
@@ -2863,32 +2863,36 @@
(deftest encrypt-setter-none-settings-test
;; some of the settings are enterprise-only, so they are registered only when the EE namespaces are loaded
- (testing "known problematic :setter :none settings are in the migration list"
- (doseq [k ["enable-query-caching" "enable-nested-queries" "setup-token" "instance-creation" "token-features"]]
+ (testing "the :setter :none settings that are encrypted at rest are in the migration list"
+ (doseq [k ["setup-token" "support-access-grant-email" "site-uuid-for-unsubscribing-url"]]
(testing k
(is (some #{k} @#'custom-migrations/encrypted-setter-none-settings-v58)))))
- (testing "v58.2026-08-30T00:00:00 : plaintext rows of :setter :none settings are encrypted at rest, others untouched"
+ (testing "settings that are neither secret nor integrity-critical are not"
+ (doseq [k ["enable-query-caching" "instance-creation" "token-features" "version"]]
+ (testing k
+ (is (not (some #{k} @#'custom-migrations/encrypted-setter-none-settings-v58))))))
+ (testing "v58.2026-08-30T00:00:00 : plaintext rows of listed settings are encrypted at rest, others untouched"
(encryption-test/with-secret-key "encrypt-setter-none-settings-key-1234"
(impl/test-migrations "v58.2026-08-30T00:00:00" [migrate!]
(let [insert-setting! (fn [k v] (t2/query {:insert-into :setting :values [{:key k :value v}]}))
raw-setting (fn [k] (t2/select-one-fn :value :setting :key k))
- encrypted-value (encryption/maybe-encrypt "2026-08-30T00:00:00Z")]
- ;; legacy plaintext rows from when these settings were still admin toggles
- (insert-setting! "enable-query-caching" "true")
- (insert-setting! "enable-nested-queries" "false")
- ;; a programmatically written row is already encrypted
- (insert-setting! "instance-creation" encrypted-value)
- ;; a settable setting is not this migration's business
- (insert-setting! "site-name" "Metabase")
+ encrypted-value (encryption/maybe-encrypt "https://otel.example")]
+ ;; a plaintext row from before the setting was encrypted
+ (insert-setting! "setup-token" "b7f4a1e2-0000-4000-8000-000000000000")
+ (insert-setting! "support-access-grant-email" "[email protected]")
+ ;; an already-encrypted row
+ (insert-setting! "tracing-endpoint" encrypted-value)
+ ;; a setting that is deliberately plaintext at rest is not this migration's business
+ (insert-setting! "instance-creation" "2026-08-30T00:00:00Z")
(migrate!)
- (testing "a legacy plaintext row is encrypted and decrypts back"
- (is (encryption/decryptable-string? (raw-setting "enable-query-caching")))
- (is (= "true" (encryption/maybe-decrypt (raw-setting "enable-query-caching"))))
- (is (= "false" (encryption/maybe-decrypt (raw-setting "enable-nested-queries")))))
+ (testing "a plaintext row of a listed setting is encrypted and decrypts back"
+ (is (encryption/decryptable-string? (raw-setting "setup-token")))
+ (is (= "b7f4a1e2-0000-4000-8000-000000000000" (encryption/maybe-decrypt (raw-setting "setup-token"))))
+ (is (= "[email protected]" (encryption/maybe-decrypt (raw-setting "support-access-grant-email")))))
(testing "an already-encrypted row is left unchanged"
- (is (= encrypted-value (raw-setting "instance-creation"))))
+ (is (= encrypted-value (raw-setting "tracing-endpoint"))))
(testing "a setting not in the list is left plaintext"
- (is (= "Metabase" (raw-setting "site-name")))))))))
+ (is (= "2026-08-30T00:00:00Z" (raw-setting "instance-creation")))))))))
(deftest backfill-transform-target-db-id-test
(testing "v59.2026-01-31T12:01:23 : backfill target_db_id from target and source JSON"
diff --git a/test/metabase/settings/models/setting/multi_setting_test.clj b/test/metabase/settings/models/setting/multi_setting_test.clj
index 7631a557267..8ddd925f581 100644
--- a/test/metabase/settings/models/setting/multi_setting_test.clj
+++ b/test/metabase/settings/models/setting/multi_setting_test.clj
@@ -47,6 +47,7 @@
(multi-setting/define-multi-setting ^:private multi-setting-read-only
"A test setting that is always read-only."
(fn [] *parakeet*)
+ :encryption :no
:visibility :internal
:getter (constantly "Parroty")
:setter :none)
diff --git a/test/metabase/settings/models/setting_test.clj b/test/metabase/settings/models/setting_test.clj
index a53d7092807..9e75ed7ae78 100644
--- a/test/metabase/settings/models/setting_test.clj
+++ b/test/metabase/settings/models/setting_test.clj
@@ -1832,6 +1832,17 @@
(setting/migrate-encrypted-settings!)
(is (= "Lenny" (actual-value-in-db :toucan-name)))))))
+(deftest setter-none-does-not-imply-encryption-test
+ (testing "`:setter :none` does not imply encryption -- it is decided by type or stated explicitly, like any setting"
+ (testing "a :setter :none setting of a plaintext type is not encrypted"
+ (is (= :no (:encryption (setting/resolve-setting :version)))))
+ (testing "a :setter :none setting that is secret or integrity-critical states it explicitly"
+ (is (= :when-encryption-key-set (:encryption (setting/resolve-setting :setup-token)))))
+ (testing "a :setter :none string setting must state `:encryption`, rather than defaulting to encrypted"
+ (is (thrown-with-msg? clojure.lang.ExceptionInfo #"`:encryption` is a required option"
+ (#'setting/extract-encryption-or-default
+ {:name :test-unstated-setter-none-setting :type :string :setter :none}))))))
+
(deftest boolean-settings-default-to-never-encrypted
(testing "Boolean settings default to never encrypted"
(is (= :no (:encryption (setting/resolve-setting :test-boolean-setting)))))
diff --git a/test/metabase/test/util.clj b/test/metabase/test/util.clj
index 65c97a48dab..c7386294922 100644
--- a/test/metabase/test/util.clj
+++ b/test/metabase/test/util.clj
@@ -531,6 +531,7 @@
(setting/defsetting with-temp-env-var-value-test-setting
"Setting for the `with-temp-env-var-value-test` test."
:visibility :internal
+ :encryption :no
:setter :none
:default "abc")