config

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config creates an osquery configuration plugin.

See https://osquery.readthedocs.io/en/latest/development/config-plugins/ for more.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateConfigsFunc

type GenerateConfigsFunc func(ctx context.Context) (map[string]string, error)

GenerateConfigsFunc returns the configurations generated by this plugin. The returned map should use the source name as key, and the config JSON as values. The context argument can optionally be used for cancellation in long-running operations.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is an osquery configuration plugin. Plugin implements the OsqueryPlugin interface.

func NewPlugin

func NewPlugin(name string, gen GenerateConfigsFunc, ref RefreshConfigsFunc) *Plugin

NewPlugin takes a value that implements ConfigPlugin and wraps it with the appropriate methods to satisfy the OsqueryPlugin interface. Use this to easily create configuration plugins.

func (*Plugin) Call

Call is the entry point method into config plugin. "action" will be part of the request. It should either be "genConfig" or "refresh".

func (*Plugin) Name

func (t *Plugin) Name() string

Name return the plugin name.

func (*Plugin) Ping

func (t *Plugin) Ping() osquery.ExtensionStatus

Ping returns success status.

func (*Plugin) RegistryName

func (t *Plugin) RegistryName() string

RegistryName returns the registry name which is always "config" for config plugin.

func (*Plugin) Routes

Routes returns empty plugin response.

func (*Plugin) Shutdown

func (t *Plugin) Shutdown()

Shutdown plugin and cleanup.

type RefreshConfigsFunc added in v0.4.0

type RefreshConfigsFunc func(ctx context.Context, request osquery.ExtensionPluginRequest) osquery.ExtensionResponse

RefreshConfigsFunc is called by Osquery to provide latest configuration. Plugin's can optionally implement this method if they are interested in full configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL