Handle missing macOS bundle executable in executable_hashes table#47532
Handle missing macOS bundle executable in executable_hashes table#47532dantecatalfamo wants to merge 4 commits into
executable_hashes table#47532Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents Orbit’s macOS executable_hashes osquery table from failing (and aborting the host detail query) when a bundle’s Info.plist declares a CFBundleExecutable that doesn’t actually exist on disk (e.g. some Apple system bundles like XProtect.bundle).
Changes:
- Treat
os.Openfailures during SHA256 computation as non-fatal by returning an empty hash (and logging) instead of returning an error. - Add unit tests covering missing bundle executables for exact-path and wildcard queries.
- Add a changelog entry describing the macOS detail query fix.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| orbit/pkg/table/executable_hashes/executable_hashes.go | Changes SHA256 computation to avoid failing the table when the bundle executable can’t be opened. |
| orbit/pkg/table/executable_hashes/executable_hashes_test.go | Adds regression tests for missing executables (exact path + wildcard batch). |
| changes/45327-detail-query-error | Adds a release-note entry for the detail query fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks! I was about to file an issue for this. We have these XProtect error logs all over the place in dogfood. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #47532 +/- ##
==========================================
+ Coverage 67.18% 67.20% +0.01%
==========================================
Files 3548 3186 -362
Lines 228890 228104 -786
Branches 11909 11852 -57
==========================================
- Hits 153782 153286 -496
+ Misses 61263 60974 -289
+ Partials 13845 13844 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Related issue: Resolves #45327
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
fleetd/orbit/Fleet Desktop
runtime.GOOSis used as needed to isolate changes