Open jcgruenhage opened 2 years ago
I've thought a bit more about this, and it's a bit more complicated than I initially thought. A struct can be the source of multiple tables: In the example above, a package might have multiple dependencies, meaning that there would be a table for the package that includes every field in the struct that can only have a single value, and an additional table for ever field that can contain multiple values. These additional tables need to have some identifier from the main table, so defining a key that's copied to all additional tables is also required. All in all, not terribly difficult, but doing the right thing with nested structs will be a bit more difficult. Maybe this is something where we can piggy-back on the attributes provided by serde as well, so that we don't have to replicate renames across multiple places for example.
I've to recap the approach I took with osquery-rust. I'm sure it is quite basic at the moment because back at the time rust was pretty new to me.
Let me know, if you are still interested in getting the package and dependency list done with your own osquery plugin implemented in rust. Thank you.
@jcgruenhage, I looked into this and learned a lot. I've never heard of voidlinux or xbps before. I did not find osquery in the official voidlinux repos. I've also found https://git.jcg.re/jcgruenhage/osquery-voidlinux. I appreciate it.
Where do you get osquery for voidlinux from?
I used the binary releases from upstream.
I'm not using Void Linux anymore, I have since migrated to Cgimera Linux
:) You make me learn about other Linux distributions.
ChimeraLinux uses APK (Alpine Package Keeper) for package management. As far as I can see, this is also not (yet) supported by Osquery.
If it would be supported by Osquery, the data would be provided in table(s) dedicated to APK. This approach makes it hard to ask for an installed base in a heterogeneous Linux environment with a single SQL statement. I'm facing this challenge with RPM based and APT based distributions today. I solved it but the solution is not simple and with additional package managers on stage it gets worse.
So, I think, it would be nice to have one extension which covers "all" package managers with a common interface within Osquery.
Is your feature request related to a problem? Please describe. If each column I'm returning is defined by a struct, it's very frustrating to replicate the fields into both
ColumnDef
s and intoExtensionPluginResponse
entries by hand.Describe the solution you'd like Define a trait and implement a derive macro, so that
ColumnDef
s are automatically generated for each field in a struct, and that allow turning a value of that struct into a response entry.Describe alternatives you've considered Manually implementing that stuff, which is what I'm doing right now, but that's super annoying.
Additional context Add any other context or screenshots about the feature request here.