Managing application secrets in AEM as a Cloud Service with Azure Key Vault
This article describes how to securely manage application secrets in Adobe Experience Manager as a Cloud Service by integrating with Azure Key Vault, rather than storing secrets directly in Cloud Manager environment variables.
Description description
Environment
Adobe Experience Manager as a Cloud Service (AEMaaCS) (all versions)
Symptoms
- There’s a requirement to store application secrets in Azure Key Vault instead of Cloud Manager environment variables.
- The goal is to use Azure Key Vault as the primary source for secrets, with Cloud Manager environment variables used only for bootstrapping the connection.
- There’s no built-in connector for Azure Key Vault in AEM as a Cloud Service, and guidance is needed for secure integration and best practices.
Cause
AEM as a Cloud Service doesn’t natively integrate with Azure Key Vault. Custom integration is required, using Cloud Manager environment variables for secure bootstrapping only.
Resolution resolution
Follow the steps below to resolve the issue:
-
In Cloud Manager, define environment variables for your AEM environment (such as Dev, Stage, or Prod):
-
AZURE_KV_TENANT_ID(string) -
AZURE_KV_CLIENT_ID(string) -
AZURE_KV_CLIENT_SECRET(secretString) -
AZURE_KV_URL(string)
Use the
secretStringtype for sensitive values to ensure they’re encrypted and securely injected at runtime. -
-
In your AEM application code, implement logic to:
-
Read the bootstrap credentials from the environment variables at runtime.
-
Authenticate with Azure Key Vault using these credentials via the Azure SDK for Java or REST API.
-
Retrieve secrets from Azure Key Vault, as needed, by your application.
-
Ensure that secrets aren’t persisted in logs or files within the application.
-
-
Limit the scope and permissions of the Azure AD application used for Key Vault access.
-
Rotate bootstrap credentials periodically and update them in Cloud Manager.
-
Monitor access to Azure Key Vault and audit secret usage.
-
Don’t store application secrets directly in Cloud Manager environment variables except for bootstrapping.
After implementing the above steps, verify that your application can securely retrieve secrets from Azure Key Vault at runtime.