📖 Scenario: You are an IT administrator for a company. You want to create a conditional access policy in Azure Active Directory to control access to company resources based on user location.
🎯 Goal: Build a conditional access policy that blocks access from all locations except trusted IP ranges.
📋 What You'll Learn
Create a dictionary called policy with the policy name and state
Add a list called trusted_locations with specific IP ranges
Add a condition in policy to include only trusted locations
Set the access control to block access from non-trusted locations
💡 Why This Matters
🌍 Real World
Conditional access policies help secure company resources by controlling who can access them and from where.
💼 Career
IT administrators and cloud security engineers use conditional access policies daily to enforce security rules in Azure Active Directory.
Progress0 / 4 steps
1
Create the initial policy dictionary
Create a dictionary called policy with keys name set to "Block access outside trusted locations" and state set to "enabled".
Azure
Hint
Use a Python dictionary with the exact keys and values.
2
Add trusted IP locations list
Create a list called trusted_locations with these exact IP ranges: "192.168.1.0/24" and "10.0.0.0/24".
Azure
Hint
Use a Python list with the exact IP ranges as strings.
3
Add location condition to the policy
Add a key conditions to policy with a nested dictionary that has key locations containing a key include set to the trusted_locations list.
Azure
Hint
Use nested dictionaries to add the conditions key with locations and include keys.
4
Set access control to block non-trusted locations
Add a key grantControls to policy with a key operator set to "OR" and a key builtInControls set to a list containing "block".
Azure
Hint
Add the grantControls dictionary with operator and builtInControls keys to block access.
Practice
(1/5)
1. What is the main purpose of a Conditional Access Policy in Azure?
easy
A. To store user passwords securely
B. To create virtual machines automatically
C. To control user access based on specific conditions like location or device
Conditional Access Policies are designed to control access to resources based on conditions such as user location, device state, or risk level.
Step 2: Compare options with purpose
Only To control user access based on specific conditions like location or device describes controlling user access based on conditions, which matches the policy's purpose.
Final Answer:
To control user access based on specific conditions like location or device -> Option C
Quick Check:
Conditional Access controls access by conditions = A [OK]
Hint: Focus on access control based on conditions, not unrelated tasks [OK]
Common Mistakes:
Confusing Conditional Access with general security monitoring
Thinking it manages passwords or virtual machines
Assuming it blocks all users without conditions
2. Which of the following is the correct way to require multi-factor authentication (MFA) in a Conditional Access policy?
easy
A. Disable all sign-in risk detections
B. Enable the policy without any conditions
C. Add a user to the policy without specifying controls
D. Set the grant control to 'Require multi-factor authentication'
Solution
Step 1: Identify how MFA is enforced in Conditional Access
MFA is enforced by setting the grant control to 'Require multi-factor authentication' in the policy settings.
Step 2: Evaluate options for correct MFA enforcement
Only Set the grant control to 'Require multi-factor authentication' correctly sets the grant control to require MFA; others do not enforce MFA properly.
Final Answer:
Set the grant control to 'Require multi-factor authentication' -> Option D
Quick Check:
MFA requires grant control setting = D [OK]
Hint: Look for 'grant control' settings to enforce MFA [OK]
Common Mistakes:
Enabling policy without specifying MFA control
Assuming adding users alone enforces MFA
Disabling risk detection does not require MFA
3. Given a Conditional Access policy that requires MFA only when users sign in from outside the corporate network, what happens if a user signs in from inside the network?
medium
A. The user is granted access without MFA
B. The user is blocked from signing in
C. The user must complete MFA every time
D. The user is forced to reset their password
Solution
Step 1: Understand the policy condition
The policy requires MFA only when users sign in from outside the corporate network, so inside network sign-ins are exempt.
Step 2: Determine user experience inside the network
Since the condition does not apply inside the network, users can sign in without MFA.
Final Answer:
The user is granted access without MFA -> Option A
Quick Check:
MFA required only outside network means inside no MFA = C [OK]
Hint: Check where conditions apply; inside network usually skips MFA [OK]
Common Mistakes:
Assuming MFA is always required regardless of location
Thinking users are blocked inside the network
Confusing MFA with password reset requirements
4. You created a Conditional Access policy to block access from unmanaged devices, but users report they can still sign in from their personal devices. What is the most likely cause?
medium
A. The policy is not assigned to the correct users or groups
B. The policy requires MFA instead of blocking access
C. The users are signing in from managed devices
D. The policy is disabled
Solution
Step 1: Check policy assignment
If users can sign in despite the block, the policy might not be assigned to those users or groups.
Step 2: Evaluate other options
The policy requires MFA instead of blocking access is incorrect because requiring MFA does not block access. The users are signing in from managed devices contradicts the problem statement. The policy is disabled would block all users, not just unmanaged devices.
Final Answer:
The policy is not assigned to the correct users or groups -> Option A
Quick Check:
Policy assignment controls who is affected = A [OK]
Hint: Verify policy targets users/groups to enforce rules [OK]
Common Mistakes:
Confusing MFA requirement with blocking access
Assuming devices are managed without verification
Forgetting to enable the policy
5. You want to create a Conditional Access policy that requires MFA only for users accessing a sensitive app from outside trusted locations, but allows seamless access otherwise. Which combination of conditions and controls should you configure?
hard
A. Assign policy to all users, target all apps, require MFA for all sign-ins regardless of location
B. Assign policy to users, target the sensitive app, set location condition to exclude trusted locations, grant control to require MFA
C. Assign policy to users, target the sensitive app, require password reset for all locations
D. Assign policy to users, target the sensitive app, block access from all locations except trusted ones
Solution
Step 1: Define policy scope and conditions
The policy should apply to specific users and the sensitive app only, with a location condition that excludes trusted locations.
Step 2: Set grant control to require MFA
Grant control should require MFA only when users access from outside trusted locations, allowing seamless access inside.
Step 3: Evaluate other options
Assign policy to all users, target all apps, require MFA for all sign-ins regardless of location forces MFA always, not conditional. Assign policy to users, target the sensitive app, require password reset for all locations incorrectly requires password reset. Assign policy to users, target the sensitive app, block access from all locations except trusted ones blocks access instead of requiring MFA.
Final Answer:
Assign policy to users, target the sensitive app, set location condition to exclude trusted locations, grant control to require MFA -> Option B
Quick Check:
Conditional MFA with location exclusion = B [OK]
Hint: Use location exclusion and grant control 'require MFA' for conditional access [OK]
Common Mistakes:
Applying MFA to all apps and users unnecessarily
Using block instead of MFA for outside locations
Confusing password reset with MFA requirement
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.