-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add Darwin platform optimized path columns #8482
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
Add Darwin platform optimized path columns #8482
Conversation
directionless
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay. These one do some extra stuff to expand LIKE expressions, but it's probably fine
| schema([ | ||
| Column("name", TEXT, "Name of the Name.app folder"), | ||
| Column("path", TEXT, "Absolute and full Name.app path", index=True), | ||
| Column("path", TEXT, "Absolute and full Name.app path", index=True, optimized=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole Application path accumulator could be less nested, but I think this is correct.
| description("Query file metadata in the Spotlight database.") | ||
| schema([ | ||
| Column("path", TEXT, "Path of the file", required=True), | ||
| Column("path", TEXT, "Path of the file", required=True, optimized=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if
osquery/osquery/tables/system/darwin/mdls.mm
Lines 128 to 131 in aa60bbd
| context.expandConstraints( | |
| "path", | |
| LIKE, | |
| paths, |
| Column("value", TEXT, "String value of most CF types"), | ||
| Column("path", TEXT, "(required) read preferences from a plist", | ||
| required=True), | ||
| Column("path", TEXT, "(required) read preferences from a plist", required=True, optimized=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same path expansion for LIKE, but sure
| schema([ | ||
| Column("path", TEXT, "Must provide a path or directory", | ||
| index=True, required=True), | ||
| Column("path", TEXT, "Must provide a path or directory", index=True, optimized=True, required=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same exapansions
This PR extends the optimized columns for the Darwin platform. I've split up the optimized changes into multiple PRs to make it easier to validate the table generation methods. I've only added tables where I believe and tested the generate methods support the
INoptimization.I've confirmed that the columns can support these changes by querying the tables with an
INconstraint on the optimized columns. I validated the expected results by comparing returned values from osquery 5.13.1 (beforeINoptimization existed), 5.14.1, and 5.14.1 containing these spec file changes.With each query I included a
NULL,''(empty string), and some non-existent values in myINconstraint.Tests were ran on macOS Sequoia:
Version 15.2 Beta (24C5079e).