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

Add kolide_snap_upgradeable table and new data_table exec parser #1636

Merged
merged 21 commits into from
Mar 25, 2024

Conversation

Micah-Kolide
Copy link
Contributor

@Micah-Kolide Micah-Kolide commented Mar 1, 2024

I've created a new string delimited method for processing csv-esque/data table output.

Initially I was aiming to utilize this new method for both flatpak and snap, but due to many issues that arose with flatpak (they are commented in that PR) I've only stuck with snap for now.

$ snap refresh --list
Name    Version   Rev   Size  Publisher   Notes
core22  20240111  1122  77MB  canonical✓  base

osquery> SELECT * FROM kolide_snap_upgradeable;
+-------------+--------+-----------+-------------+-------+
| fullkey     | parent | key       | value       | query |
+-------------+--------+-----------+-------------+-------+
| 0/Version   | 0      | Version   | 20240111    | *     |
| 0/Rev       | 0      | Rev       | 1122        | *     |
| 0/Size      | 0      | Size      | 77MB        | *     |
| 0/Publisher | 0      | Publisher | canonical** | *     |
| 0/Notes     | 0      | Notes     | base        | *     |
| 0/Name      | 0      | Name      | core22      | *     |
+-------------+--------+-----------+-------------+-------+

@Micah-Kolide Micah-Kolide changed the title Add string delimited line func and snap upgradeable table Add StringDelimitedLineFunc method and kolide_snap_upgradeable table Mar 1, 2024
@Micah-Kolide Micah-Kolide marked this pull request as ready for review March 1, 2024 20:26
RebeccaMahany
RebeccaMahany previously approved these changes Mar 1, 2024
Copy link
Contributor

@RebeccaMahany RebeccaMahany left a comment

Choose a reason for hiding this comment

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

LGTM -- just one nitpick about casing

ee/dataflatten/string_delimited.go Outdated Show resolved Hide resolved
ee/dataflatten/string_delimited.go Outdated Show resolved Hide resolved
RebeccaMahany
RebeccaMahany previously approved these changes Mar 1, 2024
@directionless directionless changed the title Add StringDelimitedLineFunc method and kolide_snap_upgradeable table Add kolide_snap_upgradeable table and StringDelimitedLineFunc method Mar 1, 2024
ee/dataflatten/string_delimited.go Outdated Show resolved Hide resolved
ee/tables/dataflattentable/tables.go Outdated Show resolved Hide resolved
@Micah-Kolide Micah-Kolide changed the title Add kolide_snap_upgradeable table and StringDelimitedLineFunc method Add kolide_snap_upgradeable table and new data_table exec parser Mar 11, 2024
directionless
directionless previously approved these changes Mar 12, 2024
Copy link
Contributor

@directionless directionless left a comment

Choose a reason for hiding this comment

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

I think this looks pretty good. I like the idiom of New with options to create a parser. I think it gives us lots of rope.

I'm not totally sold on all the options, and I suspect we'll eventually want functional arguments there. But you've got good test cases, so it's easy to refactor later.

Oh, please rename Parser to NewParser or New before merging.

ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
directionless
directionless previously approved these changes Mar 15, 2024
Copy link
Contributor

@directionless directionless left a 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. A couple of nits, but you could ignore them

ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
RebeccaMahany
RebeccaMahany previously approved these changes Mar 20, 2024
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
ee/tables/execparsers/data_table/parser.go Outdated Show resolved Hide resolved
@directionless directionless added this pull request to the merge queue Mar 25, 2024
Merged via the queue into main with commit 9b277e8 Mar 25, 2024
31 checks passed
@directionless directionless deleted the micah/add_string_delimited_line_func branch March 25, 2024 17:30
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.

3 participants