Skip to content
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

Remove homebrew app casks #24593

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Remove homebrew app casks #24593

wants to merge 2 commits into from

Conversation

mostlikelee
Copy link
Contributor

#22944

Removing homebrew casks that install app bundles from the macos software detail query as they are already reported in the apps table. apps table provides bundle_identifer which is used in vulnerability (CPE) matching to grab the correct vendor.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.
  • Added/updated tests
  • Manual QA for all new/changed functionality

@mostlikelee mostlikelee marked this pull request as ready for review December 10, 2024 16:25
path AS installed_path
FROM homebrew_packages
WHERE type = 'cask'
AND NOT EXISTS (SELECT 1 FROM file WHERE file.path LIKE CONCAT(homebrew_packages.path, '/%%%%', '/%%.app%%') LIMIT 1);
Copy link
Member

Choose a reason for hiding this comment

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

Double checking: LIKE with double %% (recursive search) on the file table can only be used at the end.

Copy link
Member

Choose a reason for hiding this comment

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

Double wildcards can NEVER be used mid-string (infix)

https://blog.1password.com/the-file-table-osquerys-secret-weapon/

path AS installed_path
FROM homebrew_packages
WHERE type = 'cask'
AND NOT EXISTS (SELECT 1 FROM file WHERE file.path LIKE CONCAT(homebrew_packages.path, '/%%%%', '/%%.app%%') LIMIT 1);
Copy link
Member

Choose a reason for hiding this comment

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

Am probably missing something, why not do CONCAT(homebrew_packages.path, '/%%%%/%%.app%%').

Copy link
Member

Choose a reason for hiding this comment

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

If we cannot do the filtering cleanly and without performance impact on the device we could filter results server side.

Copy link
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

Left some questions.

@lucasmrod lucasmrod self-assigned this Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.53%. Comparing base (669900c) to head (a528149).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24593      +/-   ##
==========================================
+ Coverage   63.51%   63.53%   +0.01%     
==========================================
  Files        1592     1592              
  Lines      151140   151184      +44     
  Branches     3885     3885              
==========================================
+ Hits        95994    96048      +54     
+ Misses      47492    47484       -8     
+ Partials     7654     7652       -2     
Flag Coverage Δ
backend 64.32% <ø> (+0.01%) ⬆️

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

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

@mostlikelee mostlikelee marked this pull request as draft December 10, 2024 18:01
@noahtalerman noahtalerman removed their request for review December 13, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants