Learn Secure identity and access (AZ-500) with Interactive Flashcards
Master key concepts in Secure identity and access through our interactive flashcard system. Click on each card to reveal detailed explanations and enhance your understanding.
Azure built-in role assignments
Azure built-in role assignments are a fundamental component of Azure Role-Based Access Control (RBAC), which enables fine-grained access management for Azure resources. These predefined roles contain specific sets of permissions that allow users, groups, service principals, or managed identities to perform particular actions within Azure.
Azure provides over 120 built-in roles organized into four fundamental categories. The first is Owner, which grants full access to all resources including the ability to delegate access to others. The second is Contributor, allowing users to create and manage all resource types but restricting access management capabilities. The third is Reader, which permits viewing existing resources only. The fourth is User Access Administrator, enabling management of user access to Azure resources.
Role assignments consist of three key elements: the security principal (who receives access), the role definition (what permissions are granted), and the scope (where the permissions apply). Scopes can be assigned at management group, subscription, resource group, or individual resource levels, with permissions inherited downward through the hierarchy.
For security engineers, understanding built-in roles is essential for implementing the principle of least privilege. Rather than granting broad Owner or Contributor access, you should assign specific roles like Security Reader, Security Admin, or Key Vault Secrets User based on actual job requirements.
Common security-focused built-in roles include Security Admin for managing security policies and alerts, Security Reader for viewing security configurations, and Managed Identity Operator for assigning managed identities. Additionally, roles like Virtual Machine Contributor or Network Contributor limit access to specific resource types.
Best practices include regularly auditing role assignments using Azure Policy or Microsoft Defender for Cloud, using Azure AD Privileged Identity Management (PIM) for just-in-time access, and creating custom roles only when built-in roles do not meet specific requirements. This approach ensures proper access governance while maintaining operational efficiency.
Custom roles in Azure and Microsoft Entra
Custom roles in Azure and Microsoft Entra provide granular access control when built-in roles do not meet your organization's specific security requirements. These roles allow you to define precise permissions tailored to your operational needs.
**Azure Custom Roles:**
Azure Role-Based Access Control (RBAC) enables you to create custom roles by combining specific actions, data actions, and scopes. A custom role definition includes:
- **Actions**: Control plane operations (e.g., Microsoft.Compute/virtualMachines/read)
- **NotActions**: Operations to exclude from allowed actions
- **DataActions**: Data plane operations (e.g., Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read)
- **NotDataActions**: Data operations to exclude
- **AssignableScopes**: Where the role can be assigned (management groups, subscriptions, resource groups)
Custom roles can be created using Azure Portal, PowerShell, Azure CLI, or REST API. Each Azure AD tenant can have up to 5,000 custom roles.
**Microsoft Entra Custom Roles:**
Microsoft Entra ID (formerly Azure AD) custom roles allow fine-grained delegation of identity management tasks. These roles control access to Entra resources such as:
- Application registrations
- Enterprise applications
- User and group management
- Administrative units
Entra custom roles use a permission model based on resource types and actions. You define which permissions to include, then assign the role at tenant-wide scope or scoped to specific objects like administrative units or app registrations.
**Key Considerations:**
- Follow the principle of least privilege when designing custom roles
- Document role purposes and review them periodically
- Test custom roles in non-production environments first
- Use Azure Policy alongside RBAC for comprehensive governance
- Monitor role assignments through Azure Activity Logs and Entra audit logs
Custom roles enhance security posture by ensuring users receive only the permissions necessary for their job functions, reducing the risk of privilege escalation and unauthorized access.
Microsoft Entra Privileged Identity Management (PIM)
Microsoft Entra Privileged Identity Management (PIM) is a service within Microsoft Entra ID that enables organizations to manage, control, and monitor access to critical resources. PIM addresses the security risks associated with standing privileged access by implementing just-in-time (JIT) privileged access principles.
PIM allows administrators to configure time-bound access to privileged roles, meaning users only receive elevated permissions when they need them and for a limited duration. This significantly reduces the attack surface by minimizing the window during which privileged credentials could be compromised or misused.
Key features of PIM include role activation workflows, where users must request activation of their eligible roles. Organizations can require approval processes, multi-factor authentication, or justification before granting temporary elevated access. This ensures accountability and creates an audit trail for all privileged activities.
PIM supports both Microsoft Entra roles (such as Global Administrator or User Administrator) and Azure resource roles (like Owner or Contributor on subscriptions and resource groups). This comprehensive coverage allows centralized governance across the entire Azure ecosystem.
Access reviews are another essential component, enabling periodic verification that users still require their assigned privileges. Organizations can schedule recurring reviews to ensure role assignments remain appropriate and aligned with business needs.
The service provides detailed audit logs and alerts, allowing security teams to monitor privileged access patterns and detect anomalous behavior. Notifications can be configured for various events, including role activations and assignments.
PIM also supports Privileged Access Groups, enabling just-in-time membership to security groups that control access to sensitive resources or applications.
By implementing PIM, organizations can enforce the principle of least privilege, reduce persistent administrator accounts, maintain compliance requirements, and strengthen their overall security posture. The service integrates seamlessly with other Microsoft security tools, providing a comprehensive identity governance solution for enterprise environments.
Multi-factor authentication (MFA) for Azure resources
Multi-factor authentication (MFA) for Azure resources is a critical security mechanism that requires users to provide two or more verification methods before gaining access to protected resources. This layered approach significantly enhances security by combining something you know (password), something you have (phone or security key), and something you are (biometrics).
In Azure, MFA is implemented through Microsoft Entra ID (formerly Azure Active Directory) and can be enforced across various scenarios. The primary authentication factors include: SMS verification codes, phone calls, Microsoft Authenticator app notifications, OATH hardware tokens, and FIDO2 security keys.
Azure offers several ways to implement MFA:
1. **Security Defaults**: A baseline protection that enforces MFA for all users when accessing Azure portal, Azure CLI, or Azure PowerShell.
2. **Conditional Access Policies**: Provides granular control over when MFA is required based on conditions such as user location, device state, application being accessed, or risk level detected.
3. **Per-User MFA**: Allows administrators to enable MFA for specific user accounts, though this method offers less flexibility than Conditional Access.
4. **Privileged Identity Management (PIM)**: Requires MFA when users activate privileged roles, adding an extra layer of protection for administrative access.
For Azure resources specifically, MFA can be required when users attempt to manage resources through the Azure portal, access applications integrated with Microsoft Entra ID, or connect to Azure services via APIs and command-line tools.
Best practices include enabling MFA for all privileged accounts, using Conditional Access policies for risk-based authentication, encouraging users to register multiple verification methods, and implementing passwordless authentication options like FIDO2 keys for enhanced security.
MFA effectively reduces the risk of credential theft and unauthorized access, as attackers would need to compromise multiple authentication factors simultaneously to breach an account.
Conditional Access policies for cloud resources
Conditional Access policies are a powerful feature in Microsoft Entra ID (formerly Azure AD) that act as gatekeepers for accessing cloud resources. These policies enable organizations to implement automated access control decisions based on specific conditions and signals. At their core, Conditional Access policies follow an if-then logic: if a user wants to access a resource, then they must complete a specific action or meet certain requirements. The policies evaluate multiple signals including user identity, device platform, location, application being accessed, and real-time risk detection. Common signals include user or group membership, IP location information, device state and compliance status, specific applications, and sign-in risk levels calculated by Identity Protection. Based on these signals, organizations can enforce various controls. Access can be granted, blocked, or granted with additional requirements such as multi-factor authentication (MFA), requiring a compliant device, requiring a hybrid Azure AD joined device, or requiring approved client applications. Conditional Access policies are essential for implementing Zero Trust security principles. They help ensure that only authorized users on compliant devices from trusted locations can access sensitive resources. Organizations typically create policies for scenarios like requiring MFA for administrators, blocking legacy authentication protocols, requiring managed devices for specific applications, and blocking access from high-risk locations. Policy components include assignments (users, cloud apps, conditions) and access controls (grant or block, session controls). Session controls provide limited experiences within cloud applications, such as app-enforced restrictions and Conditional Access App Control through Microsoft Defender for Cloud Apps. Best practices include starting with report-only mode to understand policy impact before enforcement, creating emergency access accounts excluded from policies, and using named locations for trusted IP ranges. Conditional Access is available with Azure AD Premium P1 and P2 licenses.
Enterprise application access and OAuth permission grants
Enterprise application access in Azure Active Directory (Azure AD) refers to managing how users and groups can access applications registered in your organization's directory. When you integrate applications with Azure AD, you gain centralized control over authentication, authorization, and single sign-on capabilities. Administrators can configure which users or groups have permission to access specific enterprise applications, implement conditional access policies, and monitor application usage through audit logs.
OAuth permission grants are a fundamental component of the authorization framework in Azure AD. When an application needs to access resources on behalf of a user or as itself, it must request specific permissions. There are two types of permissions: delegated permissions and application permissions.
Delegated permissions are used when an application acts on behalf of a signed-in user. The application can only perform actions that the user themselves could perform. These permissions require user consent or administrator consent depending on the sensitivity level.
Application permissions are used when an application runs as a background service or daemon with no signed-in user. These permissions always require administrator consent because they grant broad access to organizational data.
The consent framework in Azure AD allows users or administrators to grant these permissions. User consent enables individual users to approve low-risk permissions, while admin consent is required for permissions that access sensitive organizational data or for tenant-wide approval.
Security engineers must carefully review and manage OAuth permission grants to prevent excessive access. Best practices include implementing a consent workflow where administrators review permission requests, regularly auditing granted permissions using the Azure portal or Microsoft Graph API, and configuring user consent settings to restrict which permissions users can approve themselves. Understanding these concepts helps maintain a secure identity posture while enabling productive application access across the organization.
Microsoft Entra app registrations
Microsoft Entra app registrations serve as the foundation for establishing identity and authentication for applications within the Microsoft Entra ID (formerly Azure Active Directory) ecosystem. When you register an application, you create an identity configuration that enables your app to integrate with Microsoft's identity platform for authentication and authorization purposes.
An app registration creates two related objects: an application object and a service principal. The application object serves as a global template defining the app's properties, while the service principal represents the local instance in a specific tenant, controlling what the app can actually do within that directory.
Key components of app registrations include:
**Application (Client) ID**: A unique identifier assigned to your application, used during authentication flows to identify which app is requesting access.
**Redirect URIs**: URLs where Microsoft Entra ID sends authentication responses after users sign in or grant consent.
**Certificates and Secrets**: Credentials that applications use to authenticate themselves when requesting tokens. Certificates are recommended for production environments due to enhanced security.
**API Permissions**: Define what resources and scopes your application can access. These can be delegated permissions (acting on behalf of users) or application permissions (acting as the app itself).
**Exposed APIs**: Allow your application to define its own scopes that other applications can request access to.
From a security perspective, app registrations require careful management. Security engineers should implement least privilege principles when assigning permissions, regularly audit registered applications, monitor for unused or orphaned registrations, and ensure proper credential rotation policies are in place.
App registrations support various authentication scenarios including single-page applications, web apps, mobile apps, daemon services, and APIs. Understanding these registrations is essential for implementing secure identity solutions and controlling how applications interact with organizational resources and user data within your Azure environment.
App registration permission scopes and consent
App registration permission scopes and consent are fundamental concepts in Azure Active Directory (Azure AD) that control how applications access protected resources and APIs.
Permission scopes define the level of access an application can request to resources like Microsoft Graph, Azure services, or custom APIs. There are two types of permissions:
1. **Delegated Permissions**: Used when a signed-in user is present. The application acts on behalf of the user, and the effective permissions are the intersection of the app's delegated permissions and the user's privileges.
2. **Application Permissions**: Used for background services or daemons running with no signed-in user. The application operates with its own identity and typically requires administrator consent.
Permission scopes follow the format 'resource.operation.constraint' - for example, 'User.Read' allows reading the signed-in user's profile, while 'User.Read.All' permits reading all users' profiles.
**Consent** is the process by which users or administrators grant applications the requested permissions:
- **User Consent**: Individual users can grant permissions that affect only their own data, provided the tenant policy allows it and the permissions are classified as low-risk.
- **Admin Consent**: Required for high-privilege permissions affecting organization-wide resources. Administrators grant consent on behalf of all users in the tenant.
- **Admin Consent Workflow**: Enables users to request admin consent when they cannot self-consent, creating an approval process.
Best practices include:
- Following the principle of least privilege when requesting scopes
- Clearly documenting why each permission is needed
- Using incremental consent to request permissions only when required
- Regularly reviewing and auditing granted permissions
Understanding these concepts is essential for implementing secure authentication flows and ensuring applications have appropriate access levels while maintaining organizational security policies in Azure environments.
Service principals management
Service principals management is a critical aspect of Azure identity and access security that enables applications, services, and automation tools to authenticate and access Azure resources securely.
A service principal is essentially an identity created for use with applications, hosted services, and automated tools to access specific Azure resources. Think of it as an identity for your application, similar to how a user account represents a human user.
There are three types of service principals in Azure:
1. **Application Service Principal**: Created when you register an application in Azure Active Directory. It represents the application instance in your tenant and defines what resources the application can access.
2. **Managed Identity**: A special type of service principal that eliminates the need to manage credentials. Azure handles the identity lifecycle and credential rotation automatically. There are system-assigned and user-assigned managed identities.
3. **Legacy Service Principal**: Created for applications registered in a different tenant or for legacy apps.
Key management practices include:
- **Principle of Least Privilege**: Assign only the minimum permissions required for the service principal to perform its tasks using Azure RBAC.
- **Credential Management**: For application service principals, rotate secrets and certificates regularly. Set appropriate expiration dates and monitor credential usage.
- **Monitoring and Auditing**: Enable Azure AD sign-in logs to track service principal authentication activities and detect anomalous behavior.
- **Use Managed Identities When Possible**: They provide enhanced security by handling credential management through the Azure platform.
- **Conditional Access Policies**: Apply policies to service principals to control access based on conditions like location or risk level.
- **Regular Review**: Periodically audit service principals to remove unused ones and verify permissions remain appropriate.
Proper service principal management ensures your Azure environment maintains strong security posture while enabling automated and programmatic access to resources.
Managed identities for Azure resources
Managed identities for Azure resources provide an automatically managed identity in Azure Active Directory (Azure AD) that applications can use to authenticate to services that support Azure AD authentication. This feature eliminates the need for developers to manage credentials in their code, configuration files, or environment variables.
There are two types of managed identities:
1. **System-assigned managed identity**: This identity is enabled on an Azure service instance (such as a virtual machine, App Service, or Azure Function). When enabled, Azure creates an identity tied to that resource's lifecycle. When the resource is deleted, Azure automatically cleans up the identity. Only that specific Azure resource can use this identity to request tokens from Azure AD.
2. **User-assigned managed identity**: This is created as a standalone Azure resource. You can assign it to one or more Azure service instances. The identity is managed separately from the resources that use it, meaning it persists even when associated resources are deleted.
**Key Benefits:**
- **Credential management**: Azure handles the rotation and protection of credentials automatically
- **Simplified authentication**: Applications can obtain tokens for Azure services like Key Vault, Azure SQL, Storage, and others
- **Security enhancement**: Reduces the risk of credential exposure since secrets are never stored in code
- **Cost-effective**: No additional charges for using managed identities
**Common Use Cases:**
- Accessing Azure Key Vault secrets from applications
- Connecting to Azure SQL Database from App Services
- Accessing Azure Storage from virtual machines
- Authenticating to Azure Resource Manager for automation tasks
To implement managed identities, you enable the identity on the resource, grant appropriate role-based access control (RBAC) permissions to the identity, and then use Azure SDKs or REST APIs to acquire tokens. This approach follows the principle of least privilege and significantly improves the security posture of Azure deployments.