Supported editions for this feature: Frontline Standard and Frontline Plus; Enterprise Standard and Enterprise Plus; Education Standard and Education Plus; Enterprise Essentials Plus; Cloud Identity Premium. Compare your edition
This article describes common use cases for Context-Aware Access and includes sample configurations developed in Basic mode.
Note: Context conditions were previously referred to as access levels in the Google Admin console.
For examples of context conditions developed in Advanced mode using the CEL editor, go to Context-Aware Access examples for Advanced mode.
Allow access to contractors only through the corporate network
Many companies want to restrict contractor access to corporate resources. For example, companies who use contractors to answer general support calls or work at help centers and call centers. Similar to full-time employees, contractors must have a supported license to be covered by Context-Aware Access policies.
In this example, contractors get access to corporate resources only from a specific corporate IP address range.
| Context condition name | contractor_access |
| A contractor gets access if they | Meet attributes |
| Condition 1 attribute | IP subnet (Public) 74.125.192.0/18 |
| Policy assignment | Organizational units for contractors All apps contractors use |
Block access from known hijacker IP addresses
To protect company resources from being compromised, many companies block access to known high-risk sources.
In this example, IP address 74.125.195.105 is blocked. Users get access to corporate resources if their sessions originate from any other IP address. You can specify multiple IP addresses and ranges.
| Context condition name | block_highrisk |
| A user gets access if they | Don't meet attributes |
| Condition 1 attribute | IP subnet (Public) 74.125.195.105 |
| Policy assignment | Top-level organizational unit All apps |
Allow access from a specific private network in Google Cloud
Many companies route user traffic to Google through a Virtual Private Cloud (VPC). A VPC is a secure, isolated network within the Google Cloud environment.
Be aware that traffic that's routed through your VPC might use private IP addresses. This can cause issues with public IP or region policies.
In this example, you can allow traffic from these specific VPCs.
| Context condition name | vpc_access |
| A user gets access if they... | Meet attributes |
| Condition 1 attributes |
IP subnet (Private) Private IP Subnetwork: //compute.googleapis.com/projects/project- name-test/global/networks/network-name VPC subnet: 74.125.192.0/18 |
| Policy assignment |
Organizational units for all users All apps contractors use |
Important things to remember:
- Direct traffic only—This context condition only works for traffic that directly reaches Google's servers from the allowlisted VPC. If the traffic goes through another network or tunnel first, access isn't granted. Google only recognizes the last VPC that sends the traffic to its servers.
- Admin permissions—To view VPCs and configure this context condition, admins must have the appropriate Identity and Access Management (IAM) role, such as compute.networks.list or compute.subnetworks.list.
- External VPCs—The VPC you allowlist can be from outside your current Google Cloud domain. An admin must have view permission to add the external VPC.
Allow or disallow access from specific locations
If you have employees who regularly travel to remote corporate or partner offices, you can specify the geographical locations where they can access corporate resources.
For example, if a group of sales people regularly visit customers in Australia and India, you can limit the group's access to their home office and Australia and India. If they travel to other countries for a personal holiday as part of a business trip, they can't access corporate resources from those other countries.
In this example, the sales group can access corporate resources only from the US (home office), Australia, and India.
| Context condition name | sales_access |
| Sales gets access if they | Meet attributes |
| Condition 1 attribute | Geographic origin US, Australia, India |
| Policy assignment | Group of salespeople All apps salespeople use |
You could also create a policy to deny access from specific countries by specifying that users get access if they don't meet the conditions. You would list the countries from which you want to block access.
Use nested context conditions instead of selecting multiple context conditions in a policy
In some cases, when you try to assign multiple context conditions to a policy for an organizational unit or group and one or more applications, you might get an error message asking you to reduce the number of applications or conditions.
To prevent this error, you can reduce the number of context conditions used in a policy by nesting them into a single context condition. The nested context condition joins multiple conditions with an AND or OR operation, with each condition containing an individual context condition.
In this example, USWest, USEast, and USCentral are in 3 separate context conditions. Suppose you want users to access applications if they satisfy any of the USWest, USEast, or USCentral context conditions. You can create a single nested context condition called USRegions using the OR operator. When creating the policy, assign the context condition USRegions to the application for the organizational unit or group.
|
Context condition name |
USRegions |
|
A user gets access if they |
Meet attributes |
|
Condition 1 attribute Only one context condition per condition |
Context condition USWest |
|
Join condition 1 and condition 2 with |
OR |
|
A user gets access if they |
Meet attributes |
|
Condition 2 attribute |
Context condition USEast |
|
Join condition 2 and condition 3 with |
OR |
|
A user gets access if they |
Meet attributes |
|
Condition 3 attribute |
Context condition USCentral |
Require company-owned on desktop but not on mobile device
A company might require a company-owned desktop device, but not a company-owned mobile device.
First, create a context condition for desktop devices:
|
Context condition name |
aldesktop_access |
|
Users get access if they |
Meet attributes |
|
Condition 1 attribute |
Device policy
Device encryption = Not supported Device OS macOS = 0.0.0 Windows =0.0.0 Linux OS = 0.0.0 Chrome OS = 0.0.0 |
Then, create a context condition for mobile devices:
|
Context condition name |
almobile_access |
|
Users get access if they |
Meet attributes |
|
Condition 1 attribute |
Device OS iOS = 0.0.0 Android = 0.0.0 |
Require basic device security
Most enterprise companies now require employees to access corporate resources through devices that are encrypted and meet minimum operating system versions. Some also require that employees use company-owned devices.
You can configure these policies for all of your organizational units or only for those that work with sensitive data, such as company executives, finance, or human resources.
There are several ways you can configure a policy that includes device encryption, minimum operating system version, and company-owned devices. They each have advantages and disadvantages.
One context condition that contains all security requirements
In this example, device encryption, minimum operating system version, and company-owned device attributes are included in one context condition. Users must meet all conditions to get access.
For example, if a user device is encrypted and is company-owned but doesn't run a compliant version of the operating system, they are denied access.
Advantage: Easy to set up. When you assign this context condition in a policy applied to an app, a user has to satisfy all requirements.
Disadvantage: To separately assign the security requirements to different organizational units, you need to create a separate context condition for each security requirement.
| Context condition name | device_security |
| A user gets access if they | Meet attributes |
| Condition 1 attribute (You can add all attributes to one condition or create 3 conditions and join them with AND.) |
Device policy Device OS |
3 separate context conditions
In this example, device encryption, minimum operating system version, and company-owned device attributes are in 3 separate context conditions. Users must meet the conditions in only one context condition to get access. It's a logical OR of context conditions.
For example, a user who has an encrypted device and runs an older version of the operating system on a personal device gets access.
Advantage: A granular way of defining context conditions. You can separately assign context conditions to different organizational units.
Disadvantage: Users have to meet the conditions in only one context condition.
| Context condition name | device_encryption |
| A user gets access if they | Meet attributes |
| Condition 1 attribute |
Device policy |
| Context condition name | corp_device |
| A user gets access if they | Meet attributes |
| Condition 1 attribute |
Device policy |
| Context condition name | min_os |
| A user gets access if they | Meet attributes |
| Condition 1 attribute |
Device policy |
One context condition with nested context conditions
In this example, device encryption, minimum operating system version, and company-owned device security requirements are in 3 separate context conditions. These 3 context conditions are nested inside a fourth context condition.
When you assign the fourth context condition to a policy, users must meet the conditions in each of the 3 nested context conditions to get access. It's a logical AND of context conditions.
For example, a user who has an encrypted device and runs an older version of the operating system on a personal device is denied access.
Advantage: You retain the flexibility of separating security requirements across context conditions one, 2, and 3. Using context condition 4, you can also enforce a policy with all security requirements.
Disadvantage: The log events only capture access denied to context condition 4, and not to context conditions 1, 2, and 3, because context conditions 1, 2, and 3 aren't directly assigned to policies.
Create 3 context conditions as described in "3 separate context conditions" earlier on this page: "device_encryption," "corp_device," and "min_os." Then, create a fourth context condition called "device_security" that has 3 internal conditions. Each condition has a context condition as its attribute. You can add only one context condition attribute per condition.
| Context condition name | device_security |
| A user gets access if they | Meet attributes |
| Condition 1 attribute Only one context condition per condition |
Context condition device_encryption |
| Join condition 1 and condition 2 with | AND |
| A user gets access if they | Meet attributes |
| Condition 1 attribute | Context condition corp_device |
| Join condition 2 and condition 3 with | AND |
| A user gets access if they | Meet attributes |
| Condition 1 attribute | Context condition min_os |