Skip to content

Commit

Permalink
Launcher Info Table: kolide_launcher_info (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
marpaia authored Sep 5, 2017
1 parent a7e25b8 commit 9db2636
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
38 changes: 38 additions & 0 deletions osquery/launcher_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package osquery

import (
"context"

"github.com/kolide/kit/version"
"github.com/kolide/osquery-go"
"github.com/kolide/osquery-go/plugin/table"
)

func LauncherInfo(client *osquery.ExtensionManagerClient) *table.Plugin {
columns := []table.ColumnDefinition{
table.TextColumn("version"),
table.TextColumn("go_version"),
table.TextColumn("branch"),
table.TextColumn("revision"),
table.TextColumn("build_date"),
table.TextColumn("build_user"),
}
return table.NewPlugin("kolide_launcher_info", columns, generateLauncherInfo(client))
}

func generateLauncherInfo(client *osquery.ExtensionManagerClient) table.GenerateFunc {
return func(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) {
results := []map[string]string{
map[string]string{
"version": version.Version().Version,
"go_version": version.Version().GoVersion,
"branch": version.Version().Branch,
"revision": version.Version().Revision,
"build_date": version.Version().BuildDate,
"build_user": version.Version().BuildUser,
},
}

return results, nil
}
}
1 change: 1 addition & 0 deletions osquery/platform_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

func platformTables(client *osquery.ExtensionManagerClient) []*table.Plugin {
return []*table.Plugin{
LauncherInfo(client),
BestPractices(client),
EmailAddresses(client),
}
Expand Down
1 change: 1 addition & 0 deletions osquery/platform_tables_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

func platformTables(client *osquery.ExtensionManagerClient) []*table.Plugin {
return []*table.Plugin{
LauncherInfo(client),
BestPractices(client),
EmailAddresses(client),
Spotlight(),
Expand Down

0 comments on commit 9db2636

Please sign in to comment.