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

Support for column options #77

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

directionless
Copy link
Member

WIP

Support column options.

See osquery/osquery#6006

plugin/table/table.go Outdated Show resolved Hide resolved
Copy link
Member

@groob groob left a comment

Choose a reason for hiding this comment

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

Overall looks good. I would like to play with the draft a bit to provide additional feedback.

plugin/table/table.go Outdated Show resolved Hide resolved
@directionless
Copy link
Member Author

Reworked everything to use functional arguments. I don't love the names, I used IsText(), because TextColumn() is taken by the existing, now deprecated, helper

@directionless
Copy link
Member Author

Not convinced I like where this went. IsFoo reads weird as an argument, vs AsFoo, but since column type is required if feels like a mis-fit

directionless added a commit to directionless/osquery-go that referenced this pull request Nov 14, 2019
This is a WIP to generate table spec files.

It pulls out some stuff from `table.go` to `column.go`

To generate specs, we need to expand the options bitmask into the set of booleans. Instead of doing that via the bitmask (as in osquery#77), this explores storing these as booleans and generating the bitmask as needed.
@directionless
Copy link
Member Author

Working with those values, I started testing them using booleans. #78 is a different approach

@ake-persson
Copy link

ake-persson commented Feb 19, 2020

+1 I like this as an alt. to map[string]interface{} #79 however this is still not granular enough since types in the Database schemas are for ex. limited to INTEGER or BIGINT this doesn't explain if it's an uint64 or int64 one example is the Users schema it has unsigned integers vs. signed integers. This would need to be expressed to be able to handle these type conversions properly.

My main use-case for #79 was using protobuf as a transport for osquery info. this req. granular types. Cur. I template the protobuf schemas from the database schemas however that is also limited since they don't incl. granular type info so you need to handle these exceptions manually osquery-protobuf.

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