jmpsec / osctrl

Fast and efficient osquery management
https://osctrl.net
MIT License
387 stars 51 forks source link

fix QsqueryQueryData Data type for query results api call #474

Closed peterbogdan closed 2 months ago

peterbogdan commented 3 months ago

Update type for Data as reflected here: https://github.com/jmpsec/osctrl/blob/main/logging/db.go#L54-L54

peterbogdan commented 3 months ago

@javuto should this be moved to https://github.com/jmpsec/osctrl/blob/main/types/osquery.go to avoid having to maintain multiple instances of the same type?

javuto commented 3 months ago

Hmmm in osquery.go we have the standard types for osquery, and the other one is our internal type to handle data serialization. I think it better stays in db.go since it is still our internal type.

peterbogdan commented 3 months ago

but would it be better to define the type in a single place and use that instead of redefining it in both logging/db.go and api/postgres.go?

to not keep 2 versions up to date when things are changing

maybe something like this:

import (
    "github.com/jmpsec/osctrl/logging"
)

var logs []logging.OsqueryQueryData
javuto commented 2 months ago

Okay that makes sense, and it is better to only have to maintain that type in a single place. Would you add it in this PR? Thank you for working on it! 🙏

peterbogdan commented 2 months ago

updated