Skip to content

Commit

Permalink
Add Osquery query tag
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed Oct 17, 2023
1 parent 23b9ae7 commit 3a62d82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion goztl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
libraryVersion = "0.1.39"
libraryVersion = "0.1.40"
userAgent = "goztl/" + libraryVersion
mediaType = "application/json"
)
Expand Down
2 changes: 2 additions & 0 deletions osquery_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type OsqueryQuery struct {
Value string `json:"value"`
Version int `json:"version"`
ComplianceCheckEnabled bool `json:"compliance_check_enabled"`
TagID *int `json:"tag"`
Scheduling *OsqueryQueryScheduling `json:"scheduling"`
Created Timestamp `json:"created_at"`
Updated Timestamp `json:"updated_at"`
Expand Down Expand Up @@ -77,6 +78,7 @@ type OsqueryQueryRequest struct {
Description string `json:"description"`
Value string `json:"value"`
ComplianceCheckEnabled bool `json:"compliance_check_enabled"`
TagID *int `json:"tag"`
Scheduling *OsqueryQuerySchedulingRequest `json:"scheduling"`
}

Expand Down
6 changes: 6 additions & 0 deletions osquery_queries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var oqListJSONResponse = `
"snapshot_mode": false
},
"compliance_check_enabled": false,
"tag": null,
"created_at": "2022-07-22T01:02:03.444444",
"updated_at": "2022-07-22T01:02:03.444444"
}
Expand All @@ -47,6 +48,7 @@ var oqGetJSONResponse = `
"value": "A list of user attributes",
"version": 1,
"compliance_check_enabled": false,
"tag": 17,
"scheduling": null,
"created_at": "2022-07-22T01:02:03.444444",
"updated_at": "2022-07-22T01:02:03.444444"
Expand All @@ -65,6 +67,7 @@ var oqCreateJSONResponse = `
"version": 1,
"scheduling": null,
"compliance_check_enabled": false,
"tag": 17,
"created_at": "2022-07-22T01:02:03.444444",
"updated_at": "2022-07-22T01:02:03.444444"
}
Expand All @@ -81,6 +84,7 @@ var oqUpdateJSONResponse = `
"value": "A list of user attributes",
"version": 1,
"compliance_check_enabled": false,
"tag": null,
"scheduling": {
"can_be_denylisted": true,
"interval": 161,
Expand Down Expand Up @@ -162,6 +166,7 @@ func TestOsqueryQueriesService_GetByID(t *testing.T) {
Value: "A list of user attributes",
Version: 1,
ComplianceCheckEnabled: false,
TagID: Int(17),
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand Down Expand Up @@ -300,6 +305,7 @@ func TestOsqueryQueriesService_Create(t *testing.T) {
Value: "A list of user attributes",
Version: 1,
ComplianceCheckEnabled: false,
TagID: Int(17),
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand Down

0 comments on commit 3a62d82

Please sign in to comment.