kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
507 stars 103 forks source link

Table exec's should use `tablehelpers.Exec` #1321

Open directionless opened 1 year ago

directionless commented 1 year ago

We have a couple places we create tables by parsing the output from execs. These should all use our helper. This achieves several goals:

We should:

directionless commented 9 months ago

I think this really means pushing the dataflatten stuff to use tablehelpers.Exec

directionless commented 7 months ago

I think this had been blocked on adding WithUid functionality to our exec helper, and that's present now. 🎉

James-Pickett commented 7 months ago

If I understand correctly, the issue suggests that we lint using forbigo to ensure that code with in the /ee/tables dir only uses tableHelpers.Exec instead of directly calling Run on commands from allowedcmd. Currently golantci-lint does not support applying specific rules to specific paths in a folder. So far the only solution I have found would involve a second execution of golangci-lint that points to a different config that would only run on this specific path. I'm not sure that is worth the overhead.

directionless commented 7 months ago

We should evaulate it in other places. Either exclude, or move to the helper, depending