Allow a pod in an AKS cluster to securely access Azure Key Vault without using stored credentials like client secrets or certificates.
→Use Azure AD Workload Identity. Create a user-assigned managed identity, establish a federated identity credential between the K8s service account and the managed identity, and grant the managed identity access to Key Vault.
Why: Workload Identity uses OIDC federation to exchange a Kubernetes token for an Azure AD token, completely eliminating the need to store, manage, or rotate secrets in the cluster.
Reference↗
Secure an Azure Key Vault to only allow access from specific VNets, log all operations, and protect against accidental deletion of critical keys.
→Configure the Key Vault firewall to allow access from "Private endpoint and selected networks". Enable diagnostic logging to a Log Analytics workspace. Enable both Soft Delete and Purge Protection.
Why: Soft Delete allows recovery from accidental deletion, but Purge Protection prevents even a privileged user from permanently deleting the vault or its contents during the retention period. This combination is critical for protecting TDE keys.
An Azure App Service needs to authenticate to Azure SQL Database to retrieve data, without storing connection string passwords in configuration.
→Enable a system-assigned managed identity on the App Service. In Azure SQL, create a contained user mapped to the App Service's managed identity name and grant it the necessary database roles (e.g., db_datareader).
Why: Managed Identity provides an identity for the Azure resource itself in Azure AD. Azure handles credential creation and rotation automatically, eliminating stored secrets, which is a major security best practice.
Encrypt Azure VM managed disks at rest using a key that your organization controls in Azure Key Vault.
→Create a Disk Encryption Set resource. Configure it to use a customer-managed key (CMK) from your Azure Key Vault. Assign the Disk Encryption Set to the VM's managed disks.
Why: This is Server-Side Encryption (SSE) with CMK, which encrypts data in the storage infrastructure. It is simpler than Azure Disk Encryption (ADE), which uses BitLocker/dm-crypt to encrypt data inside the guest OS and is generally used for OS and data disks together.
Ensure container images stored in Azure Container Registry (ACR) are scanned for vulnerabilities before they are deployed.
→Enable Microsoft Defender for Containers. This will automatically scan images in ACR when they are pushed, when they are pulled, and on an ongoing basis for newly discovered vulnerabilities.
Why: This "shift-left" security practice identifies vulnerabilities early in the CI/CD pipeline. Defender for Containers provides this scanning capability natively within the Azure ecosystem.
Detect and receive alerts for potential SQL injection attacks and anomalous access patterns on an Azure SQL Database.
→Enable Microsoft Defender for SQL on the logical SQL server. This provides advanced threat protection and vulnerability assessment.
Why: Defender for SQL is the dedicated workload protection plan that uses behavioral analytics and machine learning to detect threats like SQL injection, brute force attacks, and unusual data access, which are not visible to network-level tools.
Restrict a storage account to a specific VNet, but still allow trusted Microsoft services like Azure Backup to access it.
→In the storage account networking settings, select "Enabled from selected virtual networks and IP addresses". Add the required VNet/subnet. Then, check the box for "Allow trusted Microsoft services to access this storage account".
Why: The trusted services exception creates a secure path for specific Microsoft services to bypass the VNet firewall rules. Without it, services that operate on behalf of the user (like Backup or Portal) would be blocked.
Protect specific sensitive data columns (e.g., credit card numbers) in an Azure SQL database, even from privileged database administrators (DBAs).
→Use Always Encrypted. The client application driver transparently encrypts the data before sending it to the database, and the encryption keys are never revealed to the database engine.
Why: Transparent Data Encryption (TDE) encrypts the entire database at rest (on disk), but a DBA with access can still see the data. Always Encrypted provides client-side encryption, separating those who manage the data (DBAs) from those who can see it.
Process highly sensitive data on an Azure VM, ensuring it remains encrypted and protected even in memory from the hypervisor and cloud operators.
→Deploy an Azure Confidential VM. These VMs use hardware-based Trusted Execution Environments (TEEs) like AMD SEV-SNP to create an isolated, encrypted memory space.
Why: Standard VM encryption (like ADE or SSE) protects data at rest. Confidential Computing is the only technology that protects data *while in use* in memory, providing the highest level of data privacy and isolation in the cloud.
An App Service needs to use a secret from Key Vault as an application setting, without changing application code to use the Key Vault SDK.
→Enable managed identity on the App Service and grant it "Get" permissions on secrets in Key Vault. In the App Service configuration, create an application setting with the value formatted as a Key Vault reference: `@Microsoft.KeyVault(SecretUri=...)`.
Why: This feature allows the App Service platform to resolve the secret value at runtime using the managed identity. The application code simply reads a standard environment variable, abstracting away the Key Vault interaction.
Store compliance-related data in Azure Blob Storage in a WORM (Write-Once, Read-Many) state for a 7-year retention period.
→On the storage container, configure an immutability policy. Use a time-based retention policy set to 7 years and lock the policy. Once locked, the data cannot be modified or deleted by anyone until the retention period expires.
Why: This feature is specifically designed to meet regulatory compliance requirements (e.g., SEC 17a-4). Locking the policy is the critical step that makes it truly immutable.
In a multi-tenant application using a single Azure SQL database, ensure that users from one tenant can only see data belonging to their own tenant.
→Implement Row-Level Security (RLS). Create a security policy with a predicate function that filters rows based on the user's tenant ID, which is stored in the session context or a user lookup table.
Why: RLS enforces access logic directly within the database engine. This is more secure and reliable than implementing filtering in the application layer, as it cannot be bypassed and is transparent to the application code.
Protect Generation 2 VMs against boot kits and rootkits by ensuring the integrity of the entire boot chain from UEFI to the OS kernel.
→Provision the VM with Trusted Launch enabled. This activates Secure Boot, which validates the signature of all boot components, and a virtual Trusted Platform Module (vTPM) for measured boot and attestation.
Why: Trusted Launch addresses sophisticated, low-level malware that can subvert traditional OS-level security controls. It establishes a hardware root of trust for the VM.