Create Conditional Access Policies

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 11 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: Creating and Managing Conditional Access Policies

Introduction: The Shift Toward Zero Trust

In the traditional model of network security, organizations relied on a "castle and moat" approach. If you were inside the corporate network, you were considered trusted, and if you were outside, you were blocked. As modern businesses shift to cloud-based services, remote work, and mobile devices, that perimeter no longer exists. Today, identity is the new perimeter. Protecting that identity requires a dynamic approach that evaluates risk in real-time rather than relying on static credentials like passwords alone.

Conditional Access (CA) policies are the engine of this modern security philosophy, often referred to as "Zero Trust." Instead of granting broad access based on a single sign-in event, Conditional Access evaluates a range of signals—such as the user's identity, the device health, the location, and the sensitivity of the application—before granting access. By implementing these policies, you ensure that only the right people, using the right devices, under the right circumstances, can access your critical data. This lesson will guide you through the architecture, implementation, and administration of these policies to help you secure your environment effectively.


Not read yet

Understanding the Anatomy of a Conditional Access Policy

At its core, a Conditional Access policy is a simple "If-Then" statement. If a specific set of conditions is met, then a specific action is triggered. To manage these effectively, you must understand the two primary components: Assignments and Access Controls.

1. Assignments (The "If")

Assignments define who, where, and what is being targeted by the policy. You can configure these in granular detail to ensure you aren't applying broad, restrictive policies where they aren't needed.

  • Users and Groups: You can target specific individual users, entire departments via security groups, or even guest accounts. It is often best practice to exclude emergency access (break-glass) accounts to prevent being locked out of your own environment.
  • Target Resources (Apps): You can define which cloud applications or services the policy protects. This might include your primary email provider, a human resources portal, or a custom internal application integrated with your identity provider.
  • Conditions: This is where the real power lies. You can define conditions based on:
    • Sign-in risk: Leveraging machine learning to detect if a login attempt looks suspicious (e.g., impossible travel or anonymous IP addresses).
    • Device platforms: Restricting access based on whether the user is on Windows, iOS, Android, or macOS.
    • Locations: Using IP ranges or GPS coordinates to allow or block access based on geographic location.
    • Client apps: Differentiating between browser-based access and modern authentication protocols used by mobile apps.

2. Access Controls (The "Then")

Once the conditions are met, the policy dictates what happens next. You have two primary paths:

  • Grant access: You can grant access but require additional steps, such as Multi-Factor Authentication (MFA), a compliant device, or a password change.
  • Block access: You can outright deny access if the conditions do not meet your security threshold.

Callout: Authentication vs. Authorization It is vital to distinguish between these two concepts. Authentication is the process of verifying who a user is (e.g., entering a password). Authorization is the process of verifying what that user is allowed to do. Conditional Access acts as an authorization layer that sits on top of the authentication process, adding a sophisticated decision-making gate before the user reaches the application.


Not read yet

Step-by-Step: Creating Your First Policy

When creating a policy, the order of operations is critical. You must ensure you have a clear plan before clicking "Enable." Follow these steps to build a policy that forces MFA for all users accessing sensitive apps.

Step 1: Define the Scope

Navigate to your identity provider's management console and locate the Conditional Access section. Create a new policy and provide a descriptive name, such as "Require MFA for All Cloud Apps."

Step 2: Configure Assignments

  1. Users: Select "All users." However, immediately add an exclusion for your "Break-glass" administrative accounts. This is a non-negotiable step to avoid lockout scenarios.
  2. Target Resources: Select "All cloud apps." If you have a specific subset of apps that require higher security, you can select those individually instead.
  3. Conditions: For a baseline security policy, you might leave conditions blank, meaning the policy applies to every login attempt regardless of location or device.

Step 3: Configure Controls

  1. Grant: Select "Grant access" and check the box for "Require multi-factor authentication."
  2. Session: Optionally, you can set session controls, such as "Sign-in frequency," which forces users to re-authenticate after a certain number of hours even if they are already logged in.

Step 4: Enable the Policy

Before hitting "On," set the policy to "Report-only." This allows the system to log what would have happened without actually blocking any users. Review these logs for a few days to ensure you aren't breaking legitimate workflows.


Not read yet

Real-World Implementation Examples

To better understand how these policies function in practice, let’s look at three common scenarios.

Scenario A: The Remote Worker Policy

You want to allow employees to work from home, but you want to ensure they are using company-managed devices.

  • Assignment: All users.
  • Condition: Device platform (Windows/macOS), Device state (Marked as compliant).
  • Control: Grant access.
  • Outcome: If an employee tries to log in from a personal laptop that isn't managed by your organization's device management system, they will be blocked, even if they have the correct password and MFA token.

Scenario B: The "Impossible Travel" Policy

You want to detect if an account has been compromised by checking for suspicious activity.

  • Assignment: All users.
  • Condition: User risk level = High (detected by AI).
  • Control: Require password change.
  • Outcome: If a user logs in from New York and then again from London 20 minutes later, the system flags a "High Risk" event. The user is automatically prompted to reset their password before they can continue.

Scenario C: The Legacy App Restriction

You want to move away from older, less secure authentication protocols (like POP3 or IMAP) that don't support modern MFA.

  • Assignment: All users.
  • Condition: Client apps = "Other clients" (this targets legacy protocols).
  • Control: Block access.
  • Outcome: Users attempting to connect via outdated email clients that do not support modern authentication are denied, forcing them to upgrade to a secure client.

Not read yet

Best Practices for Policy Administration

Managing Conditional Access is not a "set it and forget it" task. As your organization grows, so too will the complexity of your access needs.

1. Always Use "Report-Only" Mode

Never enable a policy immediately. The "Report-only" mode is your safety net. It provides insights into how many users would be affected by the policy without interrupting their work. Use this data to refine your exclusions or adjust your conditions before going live.

2. Keep Policies Simple

It is tempting to build one massive policy with dozens of conditions. This is a mistake. It becomes nearly impossible to troubleshoot when something goes wrong. Instead, create multiple, smaller policies that are easy to read and manage. For example, have one policy for MFA, one for device compliance, and one for location-based access.

3. Implement Break-Glass Accounts

Every administrator should have at least two cloud-only accounts that are excluded from all Conditional Access policies. These accounts should have complex, long passwords stored in a secure physical vault. If you accidentally misconfigure a policy that blocks everyone, these accounts remain your only way back into the system.

Warning: The "Lockout" Risk It is alarmingly easy to create a policy that locks out every user in your organization, including administrators. Always use a test group when implementing a new policy. Assign the policy to a small group of pilot users first, verify that they can still access their resources, and only then expand the assignment to the rest of the organization.


Not read yet

Common Pitfalls and Troubleshooting

Even with the best planning, issues can arise. Here are the most frequent mistakes administrators make.

  • Conflicting Policies: If you have two policies that apply to the same user—one that grants access and one that blocks it—the "Block" policy will always win. This is a security design choice to ensure that restrictive measures take priority.
  • Ignoring Service Accounts: You might have automated scripts or service accounts that run on servers. If you apply a "Require MFA" policy to these accounts, the scripts will fail because they cannot perform MFA. Always exclude service accounts from MFA policies and secure them using other methods, like managed identities or certificates.
  • Device Compliance Misconfiguration: If you require "Compliant Devices," ensure that the device management service (like Intune) is actually syncing status correctly. If a device is healthy but the signal isn't reaching the identity provider, the user will be blocked.

Troubleshooting Workflow

If a user reports they are locked out, follow this systematic approach:

  1. Check Sign-in Logs: Look at the specific user's sign-in activity. The logs will explicitly tell you which Conditional Access policy was triggered and why it resulted in a block or an MFA prompt.
  2. Review Policy Application: Identify if the policy is in "Report-only" or "On." If it's on, compare the user's attributes (location, device status) against the policy conditions.
  3. Use the "What If" Tool: Most modern identity providers include a "What If" tool. You can simulate a login attempt for a specific user, from a specific location, using a specific device. This tool will tell you exactly which policies apply to that scenario.

Not read yet

Comparison: Traditional vs. Conditional Access

The following table highlights the differences between legacy perimeter-based security and modern Conditional Access.

Feature Traditional Security Conditional Access
Trust Model Network-based (Inside = Trusted) Identity-based (Zero Trust)
Visibility Limited to network traffic Granular per-session logs
Flexibility Static (On or Off) Dynamic (Risk-based)
User Experience Frequent password changes Risk-based MFA prompts
Management Manual firewall updates Automated policy engine

Code Example: Automating Policy Creation

While many administrators use the graphical interface, you can also manage policies using Graph API or PowerShell. This is useful for maintaining consistency across multiple tenants or documenting your infrastructure as code.

Below is an example of a PowerShell snippet (using the Microsoft Graph module) to list all currently active Conditional Access policies.

# Connect to Microsoft Graph with appropriate permissions
Connect-MgGraph -Scopes "Policy.Read.All"

# Retrieve all Conditional Access policies
$policies = Get-MgIdentityConditionalAccessPolicy

# Filter and display active policies
$activePolicies = $policies | Where-Object { $_.State -eq 'Enabled' }

foreach ($policy in $activePolicies) {
    Write-Host "Policy Name: $($policy.DisplayName)"
    Write-Host "State: $($policy.State)"
    Write-Host "----------------------------"
}

Explanation: This script connects to the Microsoft Graph API, pulls all Conditional Access policies, and filters them to show only those currently enabled. Using automation like this allows you to audit your security posture regularly without manually checking the portal.


Not read yet

Advanced Concepts: Session Controls

Session controls are an often-overlooked aspect of Conditional Access. They allow you to control the user experience after they have been granted access.

  • App-Enforced Restrictions: This allows an application (like a web-based document editor) to enforce its own set of rules, such as preventing downloads or printing, even if the user has technically passed the identity check.
  • Conditional Access App Control: This routes traffic through a proxy. It allows you to monitor and control sessions in real-time. For example, you can block "Upload" actions in a cloud file-sharing app if the user is on an unmanaged device, while still allowing them to "View" the files.
  • Sign-in Frequency: This forces users to re-authenticate at specific intervals (e.g., every 12 hours). This is useful for high-security environments where you want to ensure the user is still present and authorized.

Callout: The "Sign-in Frequency" Trade-off While increasing the sign-in frequency adds a layer of security, it also increases user friction. If you set this too low (e.g., every hour), users will become frustrated by constant prompts. Always balance security requirements against the productivity needs of your workforce.


Not read yet

Integrating Location-Based Policies

Location is one of the most common conditions used in Conditional Access. However, it is important to understand how "location" is defined in the cloud.

  1. Named Locations: You define these using public IP ranges (IPv4 or IPv6). If your office has a static public IP, you can create a "Trusted Location" for that office.
  2. Country/Region: You can block access from entire countries where your organization does not conduct business. This is a very effective way to reduce the "attack surface" of your identity provider, as it prevents automated attacks from regions you don't serve.
  3. GPS-based Location: This requires the user to have a mobile app installed that can report their precise geographic location. This is more difficult to manage but provides much higher accuracy than IP-based detection.

Best Practice: When using country-based blocking, ensure you don't accidentally block your own remote workers who might be traveling. Always have a "fallback" policy or ensure that users have a way to verify their identity (like MFA) even if they are connecting from a "non-trusted" location.


Not read yet

Frequently Asked Questions

Q: Can I use Conditional Access with non-Microsoft apps? A: Yes. As long as your application is integrated with your identity provider (using SAML, OIDC, or OAuth), Conditional Access can protect it. The identity provider acts as the gatekeeper regardless of where the app is hosted.

Q: How does Conditional Access affect mobile devices? A: You can use Conditional Access to ensure that mobile devices are registered and compliant with your MDM (Mobile Device Management) solution. If a user tries to access corporate email on an unmanaged phone, the policy can deny access until the device is enrolled.

Q: What if the internet goes down at the office? A: Conditional Access policies are evaluated in the cloud. If your office loses internet, your users won't be able to reach the cloud applications anyway, so the policies remain effective at protecting the resources once the connection is restored.

Q: Is there a limit to how many policies I can create? A: Most identity providers have a limit on the number of active policies. While this limit is usually quite high (e.g., 200+), you should strive to keep your policy count low for manageability. Use groups and clear naming conventions to keep things organized.


Not read yet

Summary and Key Takeaways

Implementing Conditional Access is a journey, not a destination. It requires a deep understanding of your organization's workflows, a commitment to testing, and a proactive approach to monitoring.

Key Takeaways:

  1. Identity is the Perimeter: Move away from network-based security. Assume that any device, anywhere, could be a potential point of entry, and verify every request.
  2. Start with "Report-only": Never deploy a policy without testing. Use the report-only mode to visualize the impact on your users before you enforce the change.
  3. Prioritize Break-Glass Accounts: Always maintain at least two administrative accounts that are exempt from Conditional Access policies to prevent catastrophic lockout scenarios.
  4. Use Granular Policies: Avoid "one-size-fits-all" policies. Create specific policies for specific needs—such as one for MFA, one for device compliance, and one for geographic restrictions.
  5. Leverage Risk Signals: Use the automated risk detection features provided by your identity platform to identify and block suspicious sign-in attempts in real-time.
  6. Continuous Monitoring: Periodically review your sign-in logs and policy performance. As your organization evolves, your policies should be updated to reflect new applications and changing security requirements.
  7. Document Everything: Maintain a clear record of why each policy exists. When a new administrator joins, they should be able to look at your policy list and understand the intent behind every rule.

By following these principles, you will move your organization toward a more secure, flexible, and resilient infrastructure. Conditional Access is not just a security tool; it is a fundamental component of enabling a modern, productive workforce. Take the time to plan your policies, involve your stakeholders, and always, always test before you enforce.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.