fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Android: More host vitals

Open Leanngove opened this issue 4 months ago • 5 comments

Goal

User story
As an IT admin managing Android devices,
I want Fleet to collect all vitals available in the Android Management API
so that I can see them on the Host details and eventually create more host vital labels configuration profiles, software, etc. based on Android vitals.

Vitals requested by Cisneros (⭐ indicates high priority):

  1. Last checked in ⭐ - already supported

  2. OS version ⭐ - already supported

  3. USB debugging enabled ⭐ - supported in this change. In AMAPI as adbEnabled, in our UI as "USB debugging enabled". Needs to have deviceSettingsEnabled set to true

  4. Is device rooted - not supported by AMAPI. Security posture provides some overarching information about a device's security status, as shown below (the potential values for Security posture are in the leftmost column):

    Image
  5. Security update version - supported in this change

  6. Manufacturer - supported in this change

  7. Encryption type - supported in this change, in AMAPI as encryptionStatus. Needs to have deviceSettingsEnabled set to true

  8. Passcode protected - supported in this change, in AMAPI as isDeviceSecure, in our UI as Passcode set. Needs to have deviceSettingsEnabled set to true

  9. Device owner - we already support MDM status

  10. Compatible with Android enterprise - not supported by AMAPI, but if a host isn't compatible with Android enterprise, it can't enroll in Fleet.

  11. Has Android enterprise account - not supported by AMAPI. Similarly, if a host doesn't have an Android enterprise account, it can't enroll in Fleet.

  12. Play store version / play services version - not supported by AMAPI. You can extract this if applicationReportsEnabled is enabled on the policy, and you can look up the versionName/versionCode for Play store like we would for any other app. Will not support as a part of vitals

  13. Play Protect enabled ⭐ - supported in this change, in AMAPI as verifyAppsEnabled, in our UI as Google Play Protect enabled . Needs to have deviceSettingsEnabled set to true

  14. Play Integrity API ⭐ - supported in this change indirectly as Security posture which reports what the Play Integrity API finds

  15. Storage - already supported

  16. Phone number - supported in this change, in AMAPI as phoneNumber in TelephonyInfo, only for fully managed devices.

  17. Roaming / data roaming - not supported by AMAPI.

Changes

Product

  • [ ] UI changes: Figma wireframes
  • [ ] CLI (fleetctl) usage changes: no changes
  • [ ] YAML changes: no changes
  • [ ] REST API changes: return new vitals when user runs GET /api/v1/fleet/hosts/:id, GET /api/v1/fleet/hosts/identifier/:identifier, GET /api/v1/fleet/device/:token. For the vital values, we have adb_enabled, security_update_version (same as securityPatchlevel), manufacturer, encryption_type (same as encryptionStatus), passcode_protected (same as isDeviceSecure and Passcode set), play_protect_enabled (same as verify_apps_enabled), security_posture, phone_number
  • [ ] Fleet's agent (fleetd) changes: no changes
  • [ ] Fleet server configuration changes: no changes
  • [ ] Exposed, public API endpoint changes: no changes
  • [ ] fleetdm.com changes: no changes
  • [ ] GitOps mode UI changes: no changes
  • [ ] GitOps generation changes: no changes
  • [ ] Activity changes: no changes
  • [ ] Permissions changes: no changes
  • [ ] Changes to paid features or tiers: no changes
  • [ ] My device and fleetdm.com/better changes: no changes
  • [ ] Usage statistics: no changes
  • [ ] Other reference documentation changes: no changes
  • [ ] First draft of test plan added
  • [ ] Once shipped, requester has been notified
  • [ ] Once shipped, dogfooding issue has been filed: https://github.com/fleetdm/fleet/issues/55175

Engineering

  • [x] Test plan is finalized

  • [ ] Contributor API changes: No Changes

  • [ ] REST API changes: Update rest-api.md to add the new Android-only fields to the response examples and notes for the three host detail endpoints. GET /api/v1/fleet/hosts/:id GET /api/v1/fleet/hosts/identifier/:identifier GET /api/v1/fleet/device/:token Add a documentation note (following the pattern of the iOS/iPadOS) about the additional fields that will be included for Android only hosts. system_update_status, security_posture, encryption_status ... etc (see fields above and in figma)

  • [ ] Feature guide changes: No Changes.

  • [ ] Database schema migrations: Add host_mdm_android_device_vitals. Use host_uuid as the PK. Every row will exists solely to extend a single host, and all lookups will be by host_uuid. All columns to track vitas DEFAULT NULL because vitals arrive asynchronously via Pub/Sub and some may be absent depending on device state or ownership type. Notes: telephony_infos as JSON because a device can have multiple SIMs (each with carrier + phone number). security_posture_details as JSON to store the PostureDetail[] array security_patch_level should probably be stored separately even though it's already embedded in os_version string (e.g., "Android 16 (2026-05-01)"), because the UI needs it as a standalone vital. Add created_at and updated_at so we can keep track of when the information was pulled.

  • [ ] Load testing: None required.

  • [ ] Pre-QA load test: N/A

  • [ ] Load testing/osquery-perf improvements: The Android load test agent cmd/osquery-perf/android_agent.go builds a simulated androidmanagement.Device for each status report. Sp update sendStatusReport() to populate the new AMAPI fields so the upsert path is exercised under load.

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

Risk assessment

  • Requires testing in a hosted environment: No. But need a real Android device reporting via Pub/Sub to verify end-to-end vitals flow. So could be tested in a hosted environment if local setup is too challenging.
  • Requires load testing: No
  • Risk level: Low / High: LOW
  • Risk description: N/A

Test plan

Make sure to go through the list and consider all events that might be related to this story, so we catch edge cases earlier.

  • The new properties ONLY apply to Android. Omit the new host vital values from the API and UI if the host OS is not Android (don't surface them at all, even with empty strings/null as value).
  • The Phone number value is only applicable to company-owned (fully-managed) hosts.
  • Enroll an Android device (fully-managed). Verify all new vitals appear on the Host details page and in the GET /api/v1/fleet/hosts/:id response
  • Verify the same fields appear via GET /api/v1/fleet/hosts/identifier/:identifier and GET /api/v1/fleet/device/:token

Edge cases

  • [ ] Enroll a personal (BYOD) Android device. Verify Phone number is not shown in the UI or API response.
  • [ ] Verify behavior when DeviceSettings is null in the status report (e.g. a device that hasn't reported yet). The vitals should be omitted or show as empty, not error.
  • [ ] Verify a device with multiple SIM cards shows the primary phone number with a hoverable tooltip listing all numbers.
  • [ ] Verify Kernel version and Bootloader version truncate with a tooltip showing the full value when the value is long.
  • [ ] Verify on a server upgraded from a prior version that existing Android hosts show null/empty vitals until their next status report, and do not error.

UI

  • [ ] Verify tooltips with "Learn more" links render correctly for: Encryption status, Security posture, Software update status.
  • [ ] Verify the OS version value has a tooltip showing "Android API level: {N}".
  • [ ] Verify enum values display in human-readable form: Security posture ("Secure", "At risk", "Potentially compromised"), Encryption status ("Active", "Inactive", etc.), Software update status ("Up to date", "Update pending", etc.).
  • [ ] Verify expected UI states (loading, empty, error states if applicable)

Supplemental testing

Testing notes

Confirmation

  1. [x] Engineer: Added comment to user story confirming successful completion of test plan (include any special setup, test data, or configuration used during development/testing if applicable).
  2. [ ] QA: Added comment to user story confirming successful completion of test plan.
  3. [ ] QA: Determined whether this story needs Playwright automation.
    • Needs automation: Yes / No
    • If yes, filed a follow-up issue in the :help-qa project with status "Needs automation":

Leanngove avatar Jul 22 '26 21:07 Leanngove

Test plan

Fleet's Android policy already enables all AMAPI status reporting settings, so a normally-enrolled device reports these vitals without extra setup.

  1. Enroll a company-owned (fully managed) Android host. Fleet writes vitals at enrollment and refreshes them on every AMAPI status report; there's no refetch for Android, so a value the enrollment payload didn't carry fills in on a later report rather than on demand.
  2. On Host details > Vitals, verify these rows show real values: Bootloader version, Carrier, Encryption status, IMEI (or MEID, whichever the device reports), Kernel version, Manufacturer, Passcode set, Phone number, Play Protect enabled, Security posture, Security update version, Software update status, USB debugging enabled. Carrier and Phone number need an active SIM; a Wi-Fi-only device shows them empty.
  3. Verify enum vitals read in plain English, not as AMAPI enums — e.g. Encryption status "Active", Security posture "Secure", Software update status "Up to date".
  4. Verify the OS version shows without the trailing patch date (e.g. "Android 16", not "Android 16 (2026-05-01)") and hovering it shows "Android API level: {N}". Only the Vitals card strips the date — the Hosts list column and the API still show the full string, by design.
  5. GET /api/v1/fleet/hosts/:id returns the same values as adb_enabled, passcode_protected, play_protect_enabled, encryption_type, manufacturer, security_update_version, device_kernel_version, bootloader_version, system_update_status, security_posture, api_level, telephony_infos, and imei or meid. A vital the device doesn't report is omitted rather than null — a device with no security risks reports no security_posture_details, and a GSM device reports no meid.
  6. Verify the same fields come back from GET /api/v1/fleet/hosts/identifier/:identifier. (GET /api/v1/fleet/device/:token is not testable here: Android hosts have no My device page and never get a device token.)
  7. Enroll a personal (BYOD) Android host and verify Phone number, Carrier, IMEI and MEID appear in neither the Vitals card nor the API response. Which of the remaining vitals a work profile reports is up to AMAPI, so treat only the suppression as a pass/fail.
  8. Verify a non-Android host (macOS or Windows) returns none of the new fields from GET /api/v1/fleet/hosts/:id.

dantecatalfamo avatar Sep 18 '26 18:09 dantecatalfamo

QA

Tested on a Samsung SM-A376U1, Android 16, enrolled both as company-owned (fully managed) and personal (work profile).

Company-owned

  • ✅ All new vitals show on Host details: USB debugging enabled, Security update version, Manufacturer, Encryption status, Passcode set, Play Protect enabled, Security posture, Software update status, Kernel version, Bootloader version, Processor type
  • ✅ Carrier and Phone number show --- with no SIM, and fill in after an eSIM is activated (Carrier: Mint, Phone number populated on the next report)
  • ✅ IMEI and Serial number show
  • ✅ Disk space available shows once the device reports storage

Personal (BYOD)

  • ✅ IMEI, Carrier, and Phone number are hidden, as the test plan says
  • ✅ Enrollment ID shows, and the other vitals match the company-owned host

AndreyKizimenko avatar Sep 23 '26 16:09 AndreyKizimenko

@terry-kwok-code testing toast notifications

AndreyKizimenko avatar Sep 23 '26 21:09 AndreyKizimenko

Notified customer-cisneros-a of release, closing

pintomi1989 avatar Oct 19 '26 17:10 pintomi1989

Admins see more clearly Android vitals flow in security grows

fleet-release avatar Oct 19 '26 17:10 fleet-release