mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
c5f0e5a6b4
- Osquery Options (to be renamed to Options after current Options removed) - Labels - Queries - Packs
51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
package kolide
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
)
|
|
|
|
type OsqueryOptionsStore interface {
|
|
ApplyOptions(options *OptionsSpec) error
|
|
GetOptions() (*OptionsSpec, error)
|
|
OptionsForPlatform(platform string) (json.RawMessage, error)
|
|
}
|
|
|
|
type OsqueryOptionsService interface {
|
|
ApplyOptionsSpec(ctx context.Context, spec *OptionsSpec) error
|
|
GetOptionsSpec(ctx context.Context) (*OptionsSpec, error)
|
|
}
|
|
|
|
type OptionsObject struct {
|
|
ObjectMetadata
|
|
Spec OptionsSpec `json:"spec"`
|
|
}
|
|
|
|
type OptionsSpec struct {
|
|
Config json.RawMessage `json:"config"`
|
|
Overrides OptionsOverrides `json:"overrides,omitempty"`
|
|
}
|
|
|
|
type OptionsOverrides struct {
|
|
Platforms map[string]json.RawMessage `json:"platforms,omitempty"`
|
|
}
|
|
|
|
const (
|
|
OptionsKind = "Options"
|
|
)
|
|
|
|
// OptionOverrideType is used to designate which override type a given set of
|
|
// options is used for. Currently the only supported override type is by
|
|
// platform.
|
|
type OptionOverrideType int
|
|
|
|
const (
|
|
// OptionOverrideTypeDefault indicates that this is the default config
|
|
// (provided to hosts when there is no override set for them).
|
|
OptionOverrideTypeDefault OptionOverrideType = iota
|
|
// OptionOverrideTypePlatform indicates that this is a
|
|
// platform-specific config override (with precedence over the default
|
|
// config).
|
|
OptionOverrideTypePlatform
|
|
)
|