-
Notifications
You must be signed in to change notification settings - Fork 447
Add device management documentation #6323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/configure-device-registration.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/device-assurance-policies.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/device-attestation.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/device-attributes.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/enforce-device-policy-at-login.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/index.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {% include "../../../../../includes/guides/device-management/view-user-devices.md" %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Configure device registration | ||
|
|
||
| Before {{product_name}} can assert anything about a device, the device has to be registered. Registration links a device to a user account and establishes the credential the device uses to identify itself afterwards. | ||
|
|
||
| ## App-native authentication is required | ||
|
|
||
| Registration requires the device to generate a cryptographic key pair, hold the private key in the secure hardware of the device, and sign a challenge with it. Only a native mobile or desktop application can do that. A browser-based redirect sign-in has no access to the key store of the device, so device registration cannot be offered in that case. | ||
|
|
||
| In practice, your application must be a native application using [app-native authentication]({{base_path}}/guides/authentication/app-native-authentication/) before any of this applies. Users who sign in through a standard browser redirect do not see a device registration step and cannot be enrolled. | ||
|
|
||
| ## Registration flows | ||
|
|
||
| A device can be registered through three different flows. Which one you use depends on when in the lifecycle of the user you want the device enrolled. All three run inside app-native authentication. | ||
|
|
||
| ### Self-registration | ||
|
|
||
| The user signs themselves up and registers their device as part of creating their account. Registration happens at the same moment the account is created, so the user has a trusted device from their first sign-in. | ||
|
|
||
| Use this when users onboard themselves through a public sign-up page. See [Self registration]({{base_path}}/guides/flows/self-registration/). | ||
|
|
||
| ### Invited user registration | ||
|
|
||
| An administrator invites the user, the user accepts the invitation, and the device is registered as part of accepting it. The account already exists, and the invitation flow completes the setup, including enrolling the device. | ||
|
|
||
| Use this when access is granted by an administrator rather than requested by the user, which is the usual pattern inside an organization. See [Invited user registration]({{base_path}}/guides/flows/invited-user-registration/). | ||
|
|
||
| ### Dedicated device registration flow | ||
|
|
||
| A standalone flow whose only purpose is registering a device against an account that already exists. The user authenticates as they normally would, then goes through device registration on its own. | ||
|
|
||
| Use this for the cases the other two flows do not cover, which in practice is most of the ongoing work: | ||
|
|
||
| - A user who already had an account before device assurance was introduced. | ||
|
|
||
| - A user who has replaced their phone. | ||
|
|
||
| - A user who needs a second device, such as a tablet alongside a phone, or a work laptop alongside both. | ||
|
|
||
| Most organizations end up using this flow far more than the other two once the initial rollout is done. | ||
|
Check warning on line 39 in en/includes/guides/device-management/configure-device-registration.md
|
||
|
|
||
| ## Attach a policy to registration | ||
|
|
||
| Any of the three flows can optionally enforce a [device assurance policy]({{base_path}}/guides/device-management/device-assurance-policies/) at registration time. Set the policy name on the device registration step in the flow, and non-compliant devices are refused at the point of registration rather than allowed in and blocked later. | ||
|
Check warning on line 43 in en/includes/guides/device-management/configure-device-registration.md
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift Add the missing configuration procedure. Line 43 tells the reader to set a policy name but does not identify the console navigation, field or API parameter, prerequisites, or success check. Add numbered configuration steps and direct links to the relevant flow-specific instructions. Include outcome confirmation and troubleshooting. As per coding guidelines, task-based documentation must include prerequisites, sequential steps, outcome confirmation, troubleshooting, and next steps. 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| If you leave the policy name unset, the device is registered without any posture check. The device is identified, but nothing is asserted about how secure it is. | ||
|
Check warning on line 45 in en/includes/guides/device-management/configure-device-registration.md
|
||
|
|
||
| !!! tip | ||
| Enforcing at registration is worth doing even when you also [enforce at login]({{base_path}}/guides/device-management/enforce-device-policy-at-login/). It gives the user a clear failure at a moment when they are already setting something up and expecting to follow instructions, rather than at the start of a working day when they are trying to get to work. | ||
|
Check warning on line 48 in en/includes/guides/device-management/configure-device-registration.md
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Device assurance policies | ||
|
|
||
| A device assurance policy is a named set of conditions that a device must meet. You define the policy once and then reference it by name in two places: at [registration time]({{base_path}}/guides/device-management/configure-device-registration/) and at [login time]({{base_path}}/guides/device-management/enforce-device-policy-at-login/). | ||
|
|
||
| A policy is made up of one rule per platform. You do not write a single rule that covers every operating system. Instead, you write an Android rule, an iOS rule, a macOS rule, and a Windows rule, and {{product_name}} evaluates each one only against devices of that platform. | ||
|
|
||
| This design exists because the security attributes of an Android phone and a Windows laptop do not overlap. Asking a Windows machine whether it is jailbroken is meaningless. | ||
|
Check warning on line 7 in en/includes/guides/device-management/device-assurance-policies.md
|
||
|
|
||
| ## How a policy is structured | ||
|
|
||
| The following example shows a policy named `Corporate Device Policy` with a rule for each of the four platforms. | ||
|
|
||
| ```text | ||
| Policy: "Corporate Device Policy" | ||
| ├── android → rule: isRooted equals false AND lockScreen equals true AND diskEncryption equals true | ||
| ├── ios → rule: jailbreak equals false AND passcode equals true | ||
| ├── macos → rule: diskEncryption equals true AND secureEnclave equals true | ||
| └── windows → rule: trustedPlatformModule equals true AND windowsHello equals true | ||
| ``` | ||
|
|
||
| When a device presents itself, {{product_name}} reads its `platform` attribute, picks the matching rule, and evaluates only that rule. If the device reports a platform that has no rule, no condition applies to it and the device passes. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- applicable repository conventions ---'
find /tmp/coderabbit-repo-knowledge/wso2-docs-is-5c3f68ab -type f -name '*.md' -maxdepth 3 -print
printf '%s\n' '--- target document ---'
cat -n en/includes/guides/device-management/device-assurance-policies.md
printf '%s\n' '--- related source references ---'
rg -n --glob '!en/includes/guides/device-management/device-assurance-policies.md' \
'device assurance|platform attribute|platform|assurance policy|matching rule|condition applies' .Repository: wso2/docs-is Length of output: 50369 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- target document ---'
cat -n en/includes/guides/device-management/device-assurance-policies.md
printf '%s\n' '--- knowledge files and scoped matches ---'
find /tmp/coderabbit-repo-knowledge/wso2-docs-is-5c3f68ab -type f -name '*.md' -print
rg -n -i --glob '*.md' 'device|assurance|platform|security' /tmp/coderabbit-repo-knowledge/wso2-docs-is-5c3f68ab || true
printf '%s\n' '--- repository files related to device assurance ---'
git ls-files | rg -i 'device|assurance|policy' | head -200
printf '%s\n' '--- exact source references ---'
rg -n -i --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'device assurance|device-assurance|platform.*attribute|assurance.*policy|matching.*platform|unrecognized.*platform' \
--glob '*.java' --glob '*.xml' --glob '*.yaml' --glob '*.yml' --glob '*.md' . | head -300Repository: wso2/docs-is Length of output: 39259 🌐 Web query:
💡 Result: WSO2 Identity Server does not have a native, single configuration setting labeled "fail open" for "missing platform" in its device assurance or adaptive authentication policies [1][2]. Instead, device assurance and adaptive authentication in WSO2 Identity Server are typically implemented using customizable JavaScript-based adaptive authentication scripts and conditional authentication templates [1][2][3]. Behavior for unrecognized or missing device platforms is entirely determined by the logic defined within these scripts [4][3]. If a policy is intended to "fail open" (i.e., allow access) when a platform is unrecognized or missing, this must be explicitly coded into the authentication script [1][5]. Key points regarding this implementation: 1. Adaptive Authentication Scripts: The server uses conditional authentication scripts to evaluate incoming requests [1][2]. Within these scripts, you can inspect request headers (such as User-Agent) or other context attributes to identify the device platform [5]. 2. Defining Policy Logic: You must define the conditional logic yourself [4]. For example, a script might include a condition such as: if (isRecognized(platform)) { executeStep(2); // Enforce extra security } else { // Implicitly continues or explicitly allows access (Fail Open) } 3. Extensibility: Because the platform uses an adaptive engine, there is no "default" behavior for missing platforms that cannot be overridden [4][3]. If your script does not explicitly call for a step-up authentication or a deny action for an unrecognized platform, the flow will naturally continue based on the rest of the defined authentication steps (typically resulting in a "fail open" or "allow" state, provided no other restrictive policies are triggered) [5][3]. If you are experiencing unexpected "fail open" behavior, review your custom authentication scripts to ensure they contain explicit checks for the device platform and appropriate handling logic for cases where that platform information is absent or unrecognized [1][5]. If you are looking for advanced device management capabilities (such as enforcing specific security postures), these are often implemented by integrating the identity server with specialized device management services via the adaptive authentication framework [4][3]. Citations:
🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- device-management documentation ---'
for f in \
en/includes/guides/device-management/device-attributes.md \
en/includes/guides/device-management/configure-device-registration.md \
en/includes/guides/device-management/enforce-device-policy-at-login.md \
en/includes/guides/device-management/index.md
do
echo "--- $f"
cat -n "$f"
done
printf '%s\n' '--- repository convention for documentation scope ---'
cat /tmp/coderabbit-repo-knowledge/wso2-docs-is-5c3f68ab/conventions/repo-wide.md
printf '%s\n' '--- change summary ---'
git diff --stat -- en/includes/guides/device-management/device-assurance-policies.mdRepository: wso2/docs-is Length of output: 21102 🌐 Web query:
💡 Result: There is no standard API, function, or property named isDevicePolicyCompliant in WSO2 Identity Server or common major platforms. It is likely you are referring to a custom function or a concept related to device security, compliance, or management within an identity provider or mobile device management (MDM) context. Based on WSO2 Identity Server technical documentation, here is the context regarding device management and policy-related checks: 1. Device-Based Adaptive Authentication: WSO2 Identity Server uses conditional authentication templates to verify if a device is recognized (i.e., "trusted") using cookies [1][2]. This determines if a device is known to the system, rather than strictly "compliant" with a security policy [1][2]. 2. FIDO2 Attestation: The platform performs security validations for devices during registration, such as verifying device genuineness, certification status, and security issues via the FIDO Alliance’s Metadata Service (MDS) [3][4]. 3. Push Authenticator Apps: When building custom push authenticators, the platform uses a platform field (e.g., FCM, APNS) to identify the push service [5][6]. The system also uses cryptographic signatures to ensure that authentication requests are bound to a registered device [7]. 4. Conditional Authentication API: WSO2 provides objects for extracting device information from user agents (e.g., userAgent.platform, userAgent.device) to write scripts [8], but these do not inherently check for device policy compliance. If you are encountering this in a specific codebase, it is highly probable that isDevicePolicyCompliant is a custom-defined function implemented by a developer to interface with an external MDM provider or a custom security policy engine. To find its origin, you should search your internal codebase for the definition of this function or check the specific SDK you are using. Citations:
Remove the unconditional pass claim until policy behavior is defined.
🤖 Prompt for AI Agents |
||
|
|
||
| !!! warning | ||
| Leaving a platform out of a policy means devices on that platform are never checked. Add a rule for every platform you intend to enforce. | ||
|
|
||
| ## Create a policy | ||
|
|
||
| Policies are created and managed from the {{product_name}} Console. Each policy needs the following: | ||
|
|
||
| <table> | ||
| <thead> | ||
| <tr> | ||
| <th>Field</th> | ||
| <th>Description</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td><b>Name</b></td> | ||
| <td>A name that is unique within the organization. This is the name you reference from the registration flow and from the adaptive authentication script, so pick something stable. The name cannot be changed after you create the policy.</td> | ||
| </tr> | ||
| <tr> | ||
| <td><b>Rules</b></td> | ||
| <td>One rule per platform you want to cover. Leave a platform out entirely if you do not want to enforce anything on it.</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| When you build a rule, the Console offers only the attributes that apply to the platform whose rule you are editing. For the full set, see [Device attributes]({{base_path}}/guides/device-management/device-attributes/). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Device attestation | ||
|
|
||
| Attestation is how {{product_name}} learns whether a device is genuine rather than an emulator, a modified build, or a repackaged copy of your application. Google and Apple each provide an attestation service, and {{product_name}} turns their verdict into a [device attribute]({{base_path}}/guides/device-management/device-attributes/) that you can write policy conditions against. | ||
|
|
||
| ## Configure attestation | ||
|
|
||
| Attestation is configured per application, on the **Advanced** tab of the application under the **Client Attestation** section. For the full steps, including the service account credentials needed for Android and the app ID needed for Apple, see [Secure app-native authentication flows]({{base_path}}/guides/authentication/app-native-authentication/secure-app-native-authentication-flows/#using-client-attestation). | ||
|
|
||
| !!! note | ||
| Until attestation is configured for an application, the `Android integrity` and `iOS device genuine` attributes carry no useful verdict. A policy that depends on them will not behave as you expect. | ||
|
|
||
| ## Android integrity levels | ||
|
|
||
| Google returns a verdict, and {{product_name}} maps it to one of the following values, strongest first. | ||
|
|
||
| <table> | ||
| <thead> | ||
|
Comment on lines
+14
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- scoped repository knowledge ---'
for f in /tmp/coderabbit-repo-knowledge/wso2-docs-is-5c3f68ab/*/*.md; do
case "$f" in
*/learnings/*|*/architecture/*|*/conventions/*) printf '\n### %s\n' "$f"; head -120 "$f" ;;
esac
done
printf '%s\n' '--- changed file status and diff ---'
git diff --stat -- en/includes/guides/device-management/device-attestation.md
git diff -- en/includes/guides/device-management/device-attestation.md
printf '%s\n' '--- targeted document sections ---'
nl -ba en/includes/guides/device-management/device-attestation.md | sed -n '1,75p'
printf '%s\n' '--- directly related terms in the document ---'
rg -n -C 3 'MEETS_|INTEGRITY_FAILED|verdict|stronger|Console|device integrity|virtual' en/includes/guides/device-management/device-attestation.mdRepository: wso2/docs-is Length of output: 23703 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository status and diff summary ---'
git status --short -- en/includes/guides/device-management/device-attestation.md
git diff --numstat -- en/includes/guides/device-management/device-attestation.md
git diff --cached --numstat -- en/includes/guides/device-management/device-attestation.md
printf '%s\n' '--- exact Android verdict and attribute references ---'
rg -n -C 4 --glob '!*.lock' --glob '!node_modules/**' \
'MEETS_STRONG_INTEGRITY|MEETS_DEVICE_INTEGRITY|MEETS_BASIC_INTEGRITY|MEETS_VIRTUAL_INTEGRITY|INTEGRITY_FAILED|Android integrity|android.*integrity|integrity.*attribute' .
printf '%s\n' '--- candidate files and relevant declarations ---'
git ls-files | rg 'attestation|device|attribute|policy|console' | head -120Repository: wso2/docs-is Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target file history context ---'
git status --short -- en/includes/guides/device-management/device-attestation.md
git diff --name-only HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md || true
git diff HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md | sed -n '1,180p' || true
printf '%s\n' '--- bounded tracked references ---'
git grep -n -I -E 'MEETS_STRONG_INTEGRITY|MEETS_DEVICE_INTEGRITY|MEETS_BASIC_INTEGRITY|MEETS_VIRTUAL_INTEGRITY|INTEGRITY_FAILED|Android integrity|android.*integrity|integrity.*attribute' -- \
'*.md' '*.yaml' '*.yml' '*.json' '*.toml' '*.xml' '*.java' '*.kt' '*.ts' '*.tsx' '*.js' '*.jsx' \
':!**/node_modules/**' ':!**/build/**' ':!**/dist/**' ':!**/static/**' ':!**/site/**' \
| head -240Repository: wso2/docs-is Length of output: 50369 🌐 Web query:
💡 Result: In the Google Play Integrity API, the verdicts Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- prior command header ---'
sed -n '1,140p' /tmp/coderabbit-shell-logs/shell-output-9H3Z63
printf '%s\n' '--- target file and commit-level change ---'
git status --short -- en/includes/guides/device-management/device-attestation.md
git diff --name-status HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md || true
git diff HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md | sed -n '1,160p' || true
printf '%s\n' '--- exact references in non-generated text/source ---'
git grep -n -I -E 'MEETS_STRONG_INTEGRITY|MEETS_DEVICE_INTEGRITY|MEETS_BASIC_INTEGRITY|MEETS_VIRTUAL_INTEGRITY|INTEGRITY_FAILED|Android integrity' -- \
'*.md' '*.yaml' '*.yml' '*.json' '*.toml' '*.xml' '*.java' '*.kt' \
':!**/vendor/**' ':!**/static/**' ':!**/site/**' ':!**/public/**' \
| head -200Repository: wso2/docs-is Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- status and target diff only ---'
git status --short -- en/includes/guides/device-management/device-attestation.md
git diff --name-status HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md || true
git diff HEAD^ HEAD -- en/includes/guides/device-management/device-attestation.md | head -160 || true
printf '%s\n' '--- exact references in Markdown only ---'
git grep -n -I -E 'MEETS_STRONG_INTEGRITY|MEETS_DEVICE_INTEGRITY|MEETS_BASIC_INTEGRITY|MEETS_VIRTUAL_INTEGRITY|INTEGRITY_FAILED|Android integrity' -- '*.md' | head -160Repository: wso2/docs-is Length of output: 4749 🌐 Web query:
💡 Result: The deviceRecognitionVerdict field in the Google Play Integrity API provides information about the integrity and environment of the device where your app is running [1]. MEETS_DEVICE_INTEGRITY This label indicates that the app is running on a genuine, certified Android device [1]. On Android 13 and higher, this includes hardware-backed verification that the bootloader is locked and the OS is a certified image from the manufacturer [1]. MEETS_VIRTUAL_INTEGRITY This label appears if the app is running on an Android emulator that includes Google Play services and passes system integrity checks, meeting core compatibility requirements [1]. This is typically seen with Google Play Games for PC [1]. Empty (or omitted) verdict If the deviceRecognitionVerdict array is empty or the field is omitted, it indicates that the device does not meet the criteria for the other labels [1]. This often means the device shows signs of potential attack (such as API hooking) or system compromise (such as being rooted), or the app is running on a physical or virtual device that failed to pass Google Play integrity checks [1]. UNEVALUATED There is no standard verdict label called UNEVALUATED in the documented deviceRecognitionVerdict array. If you are seeing this value, it may be a custom placeholder, a result of a misinterpretation of an empty or missing field, or an indication that the integrity check could not be performed or concluded for that specific device [1]. Official documentation specifies that when no criteria are met, the field is simply empty or omitted [1]. Citations: 🌐 Web query:
💡 Result: In the context of the Android Play Integrity API, MEETS_DEVICE_INTEGRITY is one of the device integrity verdicts returned by Google to help developers determine if an app is running on a genuine, unmodified Android device that meets system integrity standards [1][2]. When the Play Integrity API returns this verdict, it indicates that the device is running a version of Android that is recognized by Google and passes basic integrity checks. This level signifies that the device is running in an environment that is not compromised by known security threats or tampering that would otherwise trigger a lower integrity rating [2]. Developers often use this verdict as a security signal in application-native authentication flows [1][2]. By requiring a satisfactory integrity token from the Android client, backend services—such as the WSO2 Identity Server—can ensure that the authentication request is originating from a legitimate, trusted device instance, thereby mitigating the risk of abuse, bot attacks, and unauthorized access [1][2][3]. While the API provides different levels of integrity, MEETS_DEVICE_INTEGRITY generally confirms that the device is in a secure enough state for typical app operations. Developers should incorporate the validation of these integrity tokens into their backend authentication logic to verify the device's trustworthiness before granting access to sensitive functionality [1][2]. Citations:
Document the Play Integrity normalization contract. Google returns 🤖 Prompt for AI AgentsSource: MCP tools |
||
| <tr> | ||
| <th>Value</th> | ||
| <th>What Google is saying</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td><code>MEETS_STRONG_INTEGRITY</code></td> | ||
| <td>Genuine device, recent security updates, and strong hardware-backed guarantees.</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>MEETS_DEVICE_INTEGRITY</code></td> | ||
| <td>Genuine Android device running genuine Android software.</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>MEETS_BASIC_INTEGRITY</code></td> | ||
| <td>The device passes basic checks, but Google cannot fully vouch for it.</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>MEETS_VIRTUAL_INTEGRITY</code></td> | ||
| <td>An emulator running genuine Android software, rather than a physical device.</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>INTEGRITY_FAILED</code></td> | ||
| <td>Google could not verify the device, or attestation is not working.</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| Because these values are ordered, a sensible rule is `Android integrity` equals `MEETS_DEVICE_INTEGRITY` or stronger, rather than merely "not failed". | ||
|
|
||
| ## iOS device genuine | ||
|
Check warning on line 49 in en/includes/guides/device-management/device-attestation.md
|
||
|
|
||
| Attestation from Apple is a simpler yes-or-no verdict. Either the device and the application passed verification (`true`) or they did not (`false`). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Device attributes | ||
|
|
||
| These are the attributes you can build [device assurance policy]({{base_path}}/guides/device-management/device-assurance-policies/) conditions from. Each attribute is only available on the platforms listed below, and the Console offers only the attributes that make sense for the platform whose rule you are editing. | ||
|
|
||
| ## Available on every platform | ||
|
|
||
| | Attribute | What it checks | Values | | ||
| | --------- | -------------- | ------ | | ||
| | **platform** | The operating system the device runs. {{product_name}} uses this to select which rule applies, so you rarely need to test it inside a rule. | `android`, `ios`, `macos`, `windows` | | ||
| | **lock screen** | Whether the device has any screen lock configured at all. This is the broadest check for whether a device is locked when idle. | `true`, `false` | | ||
|
|
||
| ## Android | ||
|
|
||
| | Attribute | What it checks | Values | | ||
| | --------- | -------------- | ------ | | ||
| | **Android OS version** | The Android major version the device runs. Supports `equals`, `greater than or equal to`, and `in`. | `9` through `17` | | ||
| | **is rooted** | Whether the device has been rooted, giving apps and the user unrestricted system access. A rooted device can defeat most other protections, so this is often the first condition to add. | `true`, `false` | | ||
| | **USB debugging** | Whether developer-mode USB debugging is turned on. When enabled, anyone with physical access and a cable can read application data and drive the device. | `true`, `false` | | ||
| | **hardware keystore** | Whether cryptographic keys are held in dedicated security hardware rather than in software. Hardware-held keys cannot be copied off the device. | `true`, `false` | | ||
| | **biometric** | Whether the user has enrolled a fingerprint or a face for unlocking. | `true`, `false` | | ||
| | **screen lock complexity** | How strong the screen lock is. `high` means a long password or a complex PIN. `low` means something trivially guessable, such as a four-digit PIN or a swipe pattern. | `high`, `medium`, `low` | | ||
| | **disk encryption** | Whether device storage is encrypted at rest, so data cannot be read by pulling the storage out of a lost or stolen device. | `true`, `false` | | ||
| | **network proxies** | Whether a network proxy is configured. A proxy can be legitimate corporate infrastructure, but it can also be an attacker intercepting traffic. Decide which case applies in your environment before enforcing this. | `true`, `false` | | ||
| | **WiFi network security** | Whether the Wi-Fi network the device is currently on is encrypted rather than an open public network. | `true`, `false` | | ||
| | **Android integrity** | Google's verdict on whether this is a genuine, unmodified Android device. This attribute is only meaningful when [device attestation]({{base_path}}/guides/device-management/device-attestation/) is configured. | `MEETS_STRONG_INTEGRITY`, `MEETS_DEVICE_INTEGRITY`, `MEETS_BASIC_INTEGRITY`, `MEETS_VIRTUAL_INTEGRITY`, `INTEGRITY_FAILED` | | ||
|
|
||
| ## iOS | ||
|
Check warning on line 27 in en/includes/guides/device-management/device-attributes.md
|
||
|
|
||
| | Attribute | What it checks | Values | | ||
| | --------- | -------------- | ------ | | ||
| | **iOS version** | The iOS major version the device runs. Supports `equals`, `greater than or equal to`, and `in`. | `14` through `26`, plus `LATEST_IOS` and `SECOND_LATEST_IOS` | | ||
| | **jailbreak** | Whether the device has been jailbroken. Jailbreaking gives the same unrestricted access that rooting gives on Android, and is equally worth blocking. | `true`, `false` | | ||
|
Check warning on line 32 in en/includes/guides/device-management/device-attributes.md
|
||
| | **passcode** | Whether the user has set a device passcode. Without one, most of the data protection in iOS does nothing. | `true`, `false` | | ||
| | **Touch ID or Face ID** | Whether the user has enrolled a fingerprint or a face for unlocking. | `true`, `false` | | ||
| | **iOS device genuine** | The verdict from Apple on whether this is a genuine iOS device running a genuine copy of your application. See [device attestation]({{base_path}}/guides/device-management/device-attestation/). | `true`, `false` | | ||
|
|
||
| ## macOS | ||
|
|
||
| | Attribute | What it checks | Values | | ||
| | --------- | -------------- | ------ | | ||
| | **macOS version** | The macOS major version. Supports `equals`, `greater than or equal to`, and `in`. | `12` through `15`, plus `LATEST_MACOS` and `SECOND_LATEST_MACOS` | | ||
| | **disk encryption** | Whether FileVault is on, encrypting the disk at rest. | `true`, `false` | | ||
| | **secure enclave** | Whether the Mac has a Secure Enclave, the dedicated security chip that holds keys and biometric data separately from the main processor. | `true`, `false` | | ||
|
|
||
| ## Windows | ||
|
|
||
| | Attribute | What it checks | Values | | ||
| | --------- | -------------- | ------ | | ||
| | **Windows version** | The Windows major version. Supports `equals`, `greater than or equal to`, and `in`. | `10`, `11`, plus `LATEST_WINDOWS` and `SECOND_LATEST_WINDOWS` | | ||
| | **disk encryption** | Whether BitLocker is on, encrypting the drive at rest. | `true`, `false` | | ||
| | **Windows Hello** | Whether Windows Hello, the built-in biometric or PIN sign-in, is configured. | `true`, `false` | | ||
| | **Trusted Platform Module** | Whether a TPM is present and enabled. The TPM is the hardware that makes BitLocker and Windows Hello meaningfully secure rather than merely convenient. | `true`, `false` | | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Enforce a device policy at login | ||
|
|
||
| Registration decides whether a device is allowed to be registered. Login decides whether a device is allowed in today. These are separate checks on purpose. A phone that was compliant when it registered six months ago may have been rooted since, or may have fallen behind on operating system updates. | ||
|
|
||
| Login enforcement is done through a [conditional authentication]({{base_path}}/guides/authentication/conditional-auth/) script on the sign-in flow of the application. The script has access to the data reported by the device and can decide what to do with it: allow the sign-in, block it, or step up to an additional factor. | ||
|
|
||
| ## Enforcement patterns | ||
|
|
||
| Because the decision sits in a script, you can be more nuanced than a simple pass or fail. The following patterns are common: | ||
|
|
||
| - **Hard block** - The device is non-compliant, so refuse the sign-in and tell the user what to fix. | ||
|
|
||
| - **Step up** - The device is non-compliant, so require an additional factor rather than refusing outright. | ||
|
|
||
| - **Sensitive applications only** - Enforce the policy on the finance application but not on the cafeteria menu application. | ||
|
|
||
| - **Grace period** - Warn users for a period before enforcing, so they have time to bring devices into line. | ||
|
|
||
| ## Add the script | ||
|
|
||
| To enforce a policy on the login flow of an application: | ||
|
|
||
| 1. On the {{product_name}} Console, click **Applications**. | ||
|
|
||
| 2. Select the relevant application and go to its **Login Flow** tab. | ||
|
|
||
| 3. Add the following script, replacing `Main Policy` with the name of your [device assurance policy]({{base_path}}/guides/device-management/device-assurance-policies/). | ||
|
|
||
| ```js | ||
| var onLoginRequest = function(context) { | ||
| executeStep(1, { | ||
| onSuccess: function(context) { | ||
| var failedFields = isDevicePolicyCompliant(context, "Main Policy"); | ||
| if (failedFields) { | ||
| fail({ | ||
| "errorCode": "DEVICE_NON_COMPLIANT", | ||
| "errorMessage": "Device policy failed for: " + failedFields | ||
| }); | ||
| } | ||
| } | ||
| }); | ||
| }; | ||
| ``` | ||
|
|
||
| 4. Click **Update** to confirm. | ||
|
|
||
| ## How it works | ||
|
|
||
| `isDevicePolicyCompliant(context, policyName)` evaluates the named policy against the device that is making the request and returns the fields that failed. When the device satisfies every condition in the rule for its platform, the function returns nothing and the sign-in proceeds. | ||
|
|
||
| The example above passes the failed fields into the error message, so the user is told what to fix rather than being refused without explanation. To step up instead of blocking, call `executeStep` for an additional factor in place of `fail`. | ||
|
|
||
| !!! note | ||
| The policy name in the script must match the name of the policy exactly. Since a policy name cannot be changed after creation, the reference stays valid once you have set it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove or support the organization-usage claim.
Most organizations end up using this flow far more than the other twois an unverified claim. Remove the sentence or replace it with a product-specific, sourced statement.As per coding guidelines, documentation must not contain unverified claims.
🤖 Prompt for AI Agents
Source: Coding guidelines