Add Windows Office vulnerability detection runtime (3/3)#42872
Add Windows Office vulnerability detection runtime (3/3)#42872mostlikelee merged 12 commits intomainfrom
Conversation
This adds the core components needed to scrape and generate Windows Office security bulletins: - cmd/winoffice/generate.go: standalone tool to generate bulletins - server/vulnerabilities/winoffice/scraper.go: scrapes Microsoft Learn - server/vulnerabilities/winoffice/bulletin.go: bulletin file types - server/vulnerabilities/io/metadata.go: WinOfficeFileName helper
This adds the runtime components for Windows Office vulnerability detection:
- server/vulnerabilities/winoffice/analyzer.go: vulnerability analysis
- server/vulnerabilities/winoffice/sync.go: sync bulletins from GitHub
- server/vulnerabilities/io/{fs,github,metadata}.go: I/O helpers for sync
- server/fleet/vulnerabilities.go: add WinOfficeSource
- cmd/fleet/cron.go: integrate winoffice vuln scanning
- Various test files and documentation
This adds the core components needed to scrape and generate Windows Office security bulletins: - cmd/winoffice/generate.go: standalone tool to generate bulletins - server/vulnerabilities/winoffice/scraper.go: scrapes Microsoft Learn - server/vulnerabilities/winoffice/bulletin.go: bulletin file types - server/vulnerabilities/io/metadata.go: WinOfficeFileName helper
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # server/vulnerabilities/winoffice/scraper.go
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
Adds runtime support for detecting Windows Microsoft Office / Microsoft 365 Apps vulnerabilities using a Fleet-generated bulletin published in the fleetdm/nvd GitHub releases, and integrates the sync+analysis into the server’s vulnerability cron workflow.
Changes:
- Added Windows Office bulletin syncing from GitHub releases plus filesystem helpers to list/delete local bulletin files.
- Implemented Windows Office version-to-bulletin matching logic and DB upsert/removal of detected CVEs.
- Wired the Windows Office sync/analyze flow into the main vulnerability cron scan and added tests.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/vulnerabilities/winoffice/sync.go | Sync latest Windows Office bulletin from GitHub releases into the local vuln data dir and clean up older copies. |
| server/vulnerabilities/winoffice/sync_test.go | Unit tests for Windows Office bulletin sync behavior (download, no-op, cleanup, error paths). |
| server/vulnerabilities/winoffice/integration_test.go | Network integration test that fetches a live bulletin and validates matching behavior. |
| server/vulnerabilities/winoffice/analyzer.go | Windows Office vulnerability analyzer: load latest bulletin, match installed Office versions, and write deltas to DB. |
| server/vulnerabilities/winoffice/analyzer_test.go | Unit tests for version parsing and build-suffix comparison helpers. |
| server/vulnerabilities/msrc/sync_test.go | Updated mocks to satisfy expanded GitHub/FS interfaces. |
| server/vulnerabilities/macoffice/sync_test.go | Updated mocks to satisfy expanded GitHub/FS interfaces. |
| server/vulnerabilities/io/metadata.go | Added Windows Office metadata filename parsing/validation helper. |
| server/vulnerabilities/io/github.go | Added WinOfficeBulletin to GitHub I/O API and implementation to select the latest asset. |
| server/vulnerabilities/io/fs.go | Added FS client support for listing Windows Office bulletin files. |
| server/fleet/vulnerabilities.go | Added WinOfficeSource vulnerability source constant. |
| cmd/fleet/cron.go | Integrated Windows Office bulletin sync + analysis into scheduled vulnerability scanning. |
| changes/39316-winoffice-vulnerability-detection | Release note entry for the new Windows Office vulnerability detection feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #42872 +/- ##
==========================================
- Coverage 66.82% 66.80% -0.02%
==========================================
Files 2544 2546 +2
Lines 204231 204538 +307
Branches 9274 9274
==========================================
+ Hits 136474 136644 +170
- Misses 55405 55504 +99
- Partials 12352 12390 +38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return local[j].Before(local[i]) | ||
| }) | ||
|
|
||
| if local[0].Before(remote) { |
There was a problem hiding this comment.
I know this is the pattern we are using from the macoffice code. So non-blocking.
But the way I understand it, is this gives us daily update granularity.
- The sync code runs on fleet server and grabs
fleet_winoffice_bulletin-2026_04_03.jsonfrom github - a new post is added to the win office website.
- the nvd repo runs and generates a "newer"
fleet_winoffice_bulletin-2026_04_03.json - the sync code runs again, but since
fleet_winoffice_bulletin-2026_04_03.jsonis already on the file system, it doesn't pull in the newer version from github. So we have to wait until tomorrow for the update.
Non-blocking, but I feel like we should adapt a SHA256 comparison instead of a date comparison. Github gives us the sha256 of the file. And we can generate one on the fleet server when comparing what to save/overwrite.
Related issue: Closes #39316
Summary
Adds runtime components for Windows Office vulnerability detection:
server/vulnerabilities/winoffice/analyzer.go- Analyzes installed Office versions against the bulletin to detect vulnerabilitiesserver/vulnerabilities/winoffice/sync.go- Syncs bulletin from GitHub releasesserver/vulnerabilities/io/{fs,github,metadata}.go- I/O helpers for bulletin syncserver/fleet/vulnerabilities.go- AddsWinOfficeSourceconstantcmd/fleet/cron.go- Integrates winoffice vulnerability scanning into the cron jobHow it works
Checklist for submitter
changes/Testing
analyzer_test.go)sync_test.go)integration_test.go)