Skip to content

Software > OS: Show Android versions and vulnerabilities - #49399

Merged
juan-fdz-hawa merged 11 commits into
mainfrom
35075-software-os-show-android-versions-and-vulnerabilities
Jul 16, 2026
Merged

Software > OS: Show Android versions and vulnerabilities#49399
juan-fdz-hawa merged 11 commits into
mainfrom
35075-software-os-show-android-versions-and-vulnerabilities

Conversation

@juan-fdz-hawa

@juan-fdz-hawa juan-fdz-hawa commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Resolves #35075

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features
    • Added Android OS vulnerability analysis driven by OSV artifacts, with security patch level–aware matching and results per Android major version.
    • Introduced an Android processing mode to generate deterministic, compressed per-version OSV artifacts.
    • Enabled Android in vulnerability handling end-to-end, including OS version formatting that includes the security patch level.
    • Updated Software > OS to display Android vulnerabilities instead of showing an unsupported state.
  • Bug Fixes
    • Sorted platform operating systems by version for consistent display.
  • Tests
    • Expanded unit, integration, backend, and frontend coverage for Android artifact generation, parsing, deduplication, resolution, formatting, sync/cleanup, and UI rendering.

juan-fdz-hawa and others added 4 commits July 15, 2026 06:53
Relates to #47334

Capture SoftwareInfo.securityPatchLevel from the Android Management API
device report and fold it into the host's OS version, so Android
versions read as "Android 16 (2026-05-01)" instead of just "Android 16".
This makes the operating_systems row distinct per patch level, which is
the vulnerability-relevant granularity for Android (AMAPI exposes no
minor version).

Both the enroll path (addNewHost) and the detail-report path
(updateHost), plus the operating_systems upsert, now go through a shared
androidOSVersion helper. Devices that don't report a patch level fall
back to the bare major version, so they still enroll without error.
**Related issue:** Resolves #47335

# Checklist for submitter

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.
- [x] Timeouts are implemented and retries are limited to avoid infinite
loops

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
  - Added Android OSV processing support.
- Generates compressed vulnerability artifacts for each Android major
version.
- Includes Android CVE identifiers, severity ratings, fixed security
patch levels, and deterministic vulnerability listings.
  - Supports filtering output by Android version.
- Consolidates duplicate advisories and retains the latest available
security patch level.
- **Bug Fixes**
- Normalizes Android “next” version labels and excludes unsupported
kernel- or SoC-specific entries.
  - Prevents unsupported delta-processing options in Android mode.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
**Related issue:** Resolves #47336

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
Relates to #47337

Mark android as a vulnerability-supported platform so the Software > OS
experience surfaces Android CVEs instead of a "Not supported" state.
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.73455% with 141 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.16%. Comparing base (883efbf) to head (4cb7c13).
⚠️ Report is 63 commits behind head on main.

Files with missing lines Patch % Lines
cmd/osv-processor/main.go 75.26% 32 Missing and 14 partials ⚠️
cmd/fleet/cron.go 0.00% 36 Missing and 1 partial ⚠️
server/vulnerabilities/osv/sync.go 56.09% 31 Missing and 5 partials ⚠️
server/vulnerabilities/android/analyzer.go 81.65% 11 Missing and 9 partials ⚠️
server/mdm/android/service/pubsub.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #49399      +/-   ##
==========================================
+ Coverage   67.97%   68.16%   +0.19%     
==========================================
  Files        3801     3850      +49     
  Lines      239965   243898    +3933     
  Branches    12693    13121     +428     
==========================================
+ Hits       163123   166260    +3137     
- Misses      62058    62610     +552     
- Partials    14784    15028     +244     
Flag Coverage Δ
backend 69.66% <67.73%> (+0.09%) ⬆️
frontend 60.14% <ø> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7661e9b2-480e-4967-85f1-5713648caedc

📥 Commits

Reviewing files that changed from the base of the PR and between daef14c and 4cb7c13.

📒 Files selected for processing (1)
  • frontend/pages/DashboardPage/cards/OperatingSystems/OSTableConfig.tsx

Walkthrough

Android host and operating-system versions now include security patch levels. The OSV processor generates compressed Android artifacts by major version, synchronization refreshes and removes outdated artifacts, and a new analyzer matches vulnerabilities by security patch level. Fleet cron runs Android OSV analysis when enabled. Android is marked as supported in the frontend, with Software OS table and details coverage for Android vulnerabilities.

Possibly related PRs

  • fleetdm/fleet#49272 — Overlaps with Android security-patch-aware host and operating-system version formatting.
  • fleetdm/fleet#49293 — Covers the Android OSV artifact generation and scanning flow used by this change.
  • fleetdm/fleet#47074 — Updates related frontend Android vulnerability-support rendering.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.74% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main Android OS versions and vulnerabilities change.
Description check ✅ Passed The description includes the linked issue, changes file, and testing notes, and the omitted checklist items appear intentionally removed.
Linked Issues check ✅ Passed The code changes match #35075 by adding Android OS version formatting, vulnerability syncing, and UI support across OS pages.
Out of Scope Changes check ✅ Passed The extra edits, like sorting OS versions and tooltip text, support the Android OS vulnerability flow and do not look unrelated.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 35075-software-os-show-android-versions-and-vulnerabilities

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/osv-processor/main.go`:
- Around line 1036-1039: Update the no-results branch in the Android
vulnerability processing flow around collected so that len(collected) == 0
returns a descriptive error instead of nil, while preserving the warning log and
successful return for non-empty collections.

In `@server/mdm/android/service/pubsub.go`:
- Line 739: Update the Android host OS synchronization around
androidHostOSVersion and updateHostOperatingSystem() so an empty
SoftwareInfo.AndroidVersion keeps host.Host.OSVersion and the existing
operating_systems record consistent. Ensure the corresponding operating-system
row is updated or cleared when no patch-level version is provided, while
preserving normal version updates and keeping /os_versions and vulnerability
filtering aligned.

In `@server/mdm/android/tests/integration_os_version_test.go`:
- Around line 124-131: Update the SQL query inside the mysqltest.ExecAdhocSQL
assertion to filter Android rows to the three versions expected by this
scenario, while preserving the existing ORDER BY version and assertion. Scope
the change to the query in this test so unrelated or future Android fixtures
cannot affect the result.

In `@server/vulnerabilities/android/analyzer.go`:
- Around line 91-97: Update the cache.get handling in the Android analyzer flow
to suppress only the dedicated not-found error; propagate gzip, JSON decoding,
and other I/O failures to the cron error handler. Use the existing not-found
error symbol or introduce a dedicated sentinel at the cache boundary, and update
the corrupt-artifact test to assert the error is returned rather than treated as
a missing artifact.
- Around line 103-137: When hostSPL is empty, return before loading existing
vulnerabilities or calculating the delta, preserving existing Android findings.
Update the analyzer flow around the hostSPL matching block and add coverage for
an unknown SPL with existing records to verify no deletions occur.

In `@server/vulnerabilities/osv/sync.go`:
- Around line 337-366: Update RefreshAndroid to derive the artifact date from
release using releaseDateFromAssets(release) after getLatestRelease succeeds,
then pass that date to both syncAndroidOSV and removeOldAndroidOSVArtifacts
instead of the cron execution time now. Add a regression test covering a release
date different from now.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8a8de870-0ba3-402a-98e6-19550318a373

📥 Commits

Reviewing files that changed from the base of the PR and between 3e695c7 and 606df17.

📒 Files selected for processing (16)
  • cmd/fleet/cron.go
  • cmd/osv-processor/main.go
  • cmd/osv-processor/main_test.go
  • frontend/interfaces/platform.ts
  • frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tests.tsx
  • frontend/pages/SoftwarePage/SoftwareOSDetailsPage/SoftwareOSDetailsPage.tests.tsx
  • server/datastore/mysql/operating_systems.go
  • server/datastore/mysql/operating_systems_test.go
  • server/fleet/vulnerabilities.go
  • server/mdm/android/service/pubsub.go
  • server/mdm/android/service/pubsub_test.go
  • server/mdm/android/tests/integration_os_version_test.go
  • server/vulnerabilities/android/analyzer.go
  • server/vulnerabilities/android/analyzer_test.go
  • server/vulnerabilities/osv/sync.go
  • server/vulnerabilities/osv/sync_test.go

Comment thread cmd/osv-processor/main.go
Comment thread server/mdm/android/service/pubsub.go
Comment thread server/mdm/android/tests/integration_os_version_test.go
Comment thread server/vulnerabilities/android/analyzer.go
Comment thread server/vulnerabilities/android/analyzer.go Outdated
Comment thread server/vulnerabilities/osv/sync.go
@juan-fdz-hawa
juan-fdz-hawa merged commit 621ede7 into main Jul 16, 2026
46 checks passed
@juan-fdz-hawa
juan-fdz-hawa deleted the 35075-software-os-show-android-versions-and-vulnerabilities branch July 16, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Software > OS: Show Android versions and vulnerabilities

2 participants