Azure Cosmosdb Key Identifiable detected in code
Rule Details
Cortex AppSec Rule ID
APPSEC_SECRET_298
Category
Secrets
Severity
MEDIUM
Framework
Git
Impact
The Azure Cosmosdb Key (master key) grants root-level access to the entire account.
Exposure is a Catastrophic Risk, allowing for unauthorized data plane and control plane access, modification, or deletion of all databases/containers.
How to Fix
To remediate exposed Database credentials:
Log in to your database administration tool or console.
Identify the database user associated with the exposed connection string.
Rotate the password for that specific database user immediately.
Update the connection strings in your application configuration or secrets manager.
Restart your application instances if necessary to apply the new connection string.
Next, remove the secret from your codebase:
Locate the exposed connection string in your codebase.
Replace the hardcoded value with a secure variable or reference.
Finally, clean your version control history:
Permanently remove the sensitive data from your version control history to ensure it cannot be retrieved.
Last updated
Was this helpful?
