agent

package
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIToken string

APIToken is an authentication token used for the backend API as an alternative to oauth flows.

View Source
var BackoffMaxTime time.Duration

BackoffMaxTime is the maximum time for which data gatherers will be retried

View Source
var ClientID string

ClientID is the clientID in case of Venafi Cloud mode

View Source
var ConfigFilePath string

ConfigFilePath is where the agent will try to load the configuration from

View Source
var CredentialsPath string

CredentialsPath is where the agent will try to loads the credentials. (Experimental)

View Source
var InputPath string

InputPath is where the agent will read data from instead of gathering from clusters if specified

View Source
var OneShot bool

OneShot flag causes agent to run once

View Source
var OutputPath string

OutputPath is where the agent will write data to locally if specified

Period is the time waited between scans

View Source
var PrivateKeyPath string

PrivateKeyPath is the path for the service account private key in case of Venafi Cloud mode

View Source
var Profiling bool

Profiling flag enabled pprof endpoints to run on the agent

View Source
var Prometheus bool

Prometheus flag enabled Prometheus metrics endpoint to run on the agent

View Source
var StrictMode bool

StrictMode flag causes the agent to fail at the first attempt

View Source
var VenafiCloudMode bool

VenafiCloudMode flag determines which format to load for config and credential type

Functions

func Run

func Run(cmd *cobra.Command, args []string)

Run starts the agent process

Types

type Config

type Config struct {
	Schedule string        `yaml:"schedule"`
	Period   time.Duration `yaml:"period"`
	// Deprecated: Endpoint is being replaced with Server.
	Endpoint Endpoint `yaml:"endpoint"`
	// Server is the base url for the Preflight server.
	// It defaults to https://preflight.jetstack.io.
	Server string `yaml:"server"`
	// OrganizationID within Preflight that will receive the data.
	OrganizationID string `yaml:"organization_id"`
	// ClusterID is the cluster that the agent is scanning.
	ClusterID          string         `yaml:"cluster_id"`
	ClusterDescription string         `yaml:"cluster_description"`
	DataGatherers      []DataGatherer `yaml:"data-gatherers"`
	// InputPath replaces DataGatherers with input data file
	InputPath string `yaml:"input-path"`
	// OutputPath replaces Server with output data file
	OutputPath  string             `yaml:"output-path"`
	VenafiCloud *VenafiCloudConfig `yaml:"venafi-cloud,omitempty"`
}

Config wraps the options for a run of the agent.

func ParseConfig

func ParseConfig(data []byte, isVenafiCloudMode bool) (Config, error)

ParseConfig reads config into a struct used to configure running agents

func (*Config) Dump

func (c *Config) Dump() (string, error)

Dump generates a YAML string of the Config object

type DataGatherer added in v0.1.32

type DataGatherer struct {
	Kind     string `yaml:"kind"`
	Name     string `yaml:"name"`
	DataPath string `yaml:"data_path"`
	Config   datagatherer.Config
}

func (*DataGatherer) UnmarshalYAML added in v0.1.32

func (dg *DataGatherer) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a dataGatherer resolving the type according to Kind.

type Endpoint

type Endpoint struct {
	Protocol string `yaml:"protocol"`
	Host     string `yaml:"host"`
	Path     string `yaml:"path"`
}

type VenafiCloudConfig added in v0.1.40

type VenafiCloudConfig struct {
	// UploaderID is the upload ID that will be used when
	// creating a cluster connection
	UploaderID string `yaml:"uploader_id,omitempty"`
	// UploadPath is the endpoint path for the upload API.
	UploadPath string `yaml:"upload_path,omitempty"`
}

Jump to

Keyboard shortcuts

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