|
| 1 | +--- |
| 2 | +severity: Critical |
| 3 | +pillar: Security |
| 4 | +category: SE:05 Identity and access management |
| 5 | +resource: Azure Cache for Redis |
| 6 | +online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Redis.EntraID/ |
| 7 | +--- |
| 8 | + |
| 9 | +# Use Entra ID authentication with cache instances |
| 10 | + |
| 11 | +## SYNOPSIS |
| 12 | + |
| 13 | +Use Entra ID authentication with cache instances. |
| 14 | + |
| 15 | +## DESCRIPTION |
| 16 | + |
| 17 | +Azure Cache for Redis provides two authentication methods for accessing cache instances: access keys and Microsoft Entra ID. Entra ID authentication offers centralized identity management and enhanced security features. |
| 18 | + |
| 19 | +Some advantages of using Entra ID authentication over access keys include: |
| 20 | + |
| 21 | +- Support for Azure Multi-Factor Authentication (MFA). |
| 22 | +- Conditional access policies with Conditional Access. |
| 23 | + |
| 24 | +Disabling local authentication methods is not supported. However, regenerating the access keys will invalidate any previously used access keys, rendering them unusable for accessing the cache instance. |
| 25 | + |
| 26 | +See documentation references below for additional limitations and important information. |
| 27 | + |
| 28 | +## RECOMMENDATION |
| 29 | + |
| 30 | +Consider using Entra ID authentication with cache instances. |
| 31 | + |
| 32 | +## EXAMPLES |
| 33 | + |
| 34 | +### Configure with Azure template |
| 35 | + |
| 36 | +To deploy cache instances that pass this rule: |
| 37 | + |
| 38 | +- Set the `properties.redisConfiguration.aad-enabled` to `'True'`. |
| 39 | + |
| 40 | +For example: |
| 41 | + |
| 42 | +```json |
| 43 | +{ |
| 44 | + "type": "Microsoft.Cache/redis", |
| 45 | + "apiVersion": "2023-08-01", |
| 46 | + "name": "[parameters('name')]", |
| 47 | + "location": "[parameters('location')]", |
| 48 | + "properties": { |
| 49 | + "minimumTlsVersion": "1.2", |
| 50 | + "redisVersion": "latest", |
| 51 | + "sku": { |
| 52 | + "name": "Premium", |
| 53 | + "family": "P", |
| 54 | + "capacity": 1 |
| 55 | + }, |
| 56 | + "redisConfiguration": { |
| 57 | + "aad-enabled": "True" |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +### Configure with Bicep |
| 64 | + |
| 65 | +To deploy cache instances that pass this rule: |
| 66 | + |
| 67 | +- Set the `properties.redisConfiguration.aad-enabled` to `'True'`. |
| 68 | + |
| 69 | +For example: |
| 70 | + |
| 71 | +```bicep |
| 72 | +resource cache 'Microsoft.Cache/redis@2023-08-01' = { |
| 73 | + name: name |
| 74 | + location: location |
| 75 | + properties: { |
| 76 | + minimumTlsVersion: '1.2' |
| 77 | + redisVersion: 'latest' |
| 78 | + sku: { |
| 79 | + name: 'Premium' |
| 80 | + family: 'P' |
| 81 | + capacity: 1 |
| 82 | + } |
| 83 | + redisConfiguration: { |
| 84 | + 'aad-enabled': 'True' |
| 85 | + } |
| 86 | + } |
| 87 | +} |
| 88 | +``` |
| 89 | + |
| 90 | +## NOTES |
| 91 | + |
| 92 | +Microsoft Entra ID based authentication isn't supported in the Enterprise tiers of Azure Cache for Redis Enterprise. |
| 93 | + |
| 94 | +## LINKS |
| 95 | + |
| 96 | +- [SE:05 Identity and access management](https://learn.microsoft.com/azure/well-architected/security/identity-access) |
| 97 | +- [Use Microsoft Entra ID for cache authentication](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication) |
| 98 | +- [Configure role-based access control with Data Access Policy](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-configure-role-based-access-control) |
| 99 | +- [Azure security baseline for Azure Cache for Redis](https://learn.microsoft.com/security/benchmark/azure/baselines/azure-cache-for-redis-security-baseline) |
| 100 | +- [IM-1: Use centralized identity and authentication system](https://learn.microsoft.com/security/benchmark/azure/baselines/azure-cache-for-redis-security-baseline#im-1-use-centralized-identity-and-authentication-system) |
| 101 | +- [Azure resource deployment](https://learn.microsoft.com/azure/templates/microsoft.cache/redis#rediscommonpropertiesredisconfiguration) |
0 commit comments