using Pod identity in Azure AKS to authenticate to Azure DB; a step towards Zero Trust network
A common and on-going challenge for teams is how to manage their sensitive credentials like DB connection strings, Storage Keys and etc... And the market is not in short of tools that can help to store and retrieve these secrets. tools like AWS Secret Manager, HashiCorp KeyVault, Azure Key Vault.
But even with this nice tools governing these systems and putting best practices around how developers and app retrieve these credentials and rotating them on a regular basis is a challenge that has no silver bullet for it. Managed Identity comes handy to eliminate the needs for developers to manage/rotate credentials any longer.
The current situation at my client: In the current team I am working the application relies heavily on SQL Server that is hosted in Azure SQ. Both Developers in their local environment as well as the App running in Azure AKS are accessing SQL DB via the conventional Connection String that consist of Username and Password. we have created a new SQL user for each developer to access the DEV DB, and all of the applications are using a Shared credentials to access the Database. Managing the SQL users and protecting and rotating those shared credentials has felt like a task that nobody enjoyed dealing with.
To give you a bit of perspective this is how the current connection string looks like for one of our DotNet Core Apps:
And below is the new Connection String format that utilises Managed Identity:
As you can see the new Connection String does not contain any Username and Password but then it is able to connect to Azure Active Directory and retrieve a token from there using my Azure AD account and use that token to authenticate to Azure SQL. how it know which AD account it should use comes from the fact that I am logged in to Visual Studio using my AD Account and it uses the account that im currently logged in to Visual Studio by default.
Comments
Post a Comment