Ensure key vault secrets have content_type set

Error: Key vault secrets do not have content_type set

Bridgecrew Policy ID: BC_AZR_GENERAL_42
Checkov Check ID: CKV_AZURE_114
Severity: LOW

Key vault secrets do not have content_type set

Description

Azure Key Vault is a service for Secrets management to securely store and control access to tokens, passwords, certificates, API keys, and other secrets. Users may specify the content type of a secret to assist in interpreting the secret data when it's retrieved.

Fix - Buildtime

Terraform

  • Resource: azurerm_key_vault
  • Argument: content_type - (Optional) Specifies the content type for the Key Vault Secret.
resource "azurerm_key_vault" "example" {
  name                       = "examplekeyvault"
  location                   = azurerm_resource_group.example.location
  resource_group_name        = azurerm_resource_group.example.name
  tenant_id                  = data.azurerm_client_config.current.tenant_id
  sku_name                   = "premium"
  soft_delete_retention_days = 7
  content_type = "text/plain"

Did this page help you?