Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceTLS   string = "tls"
	ServiceAdmin string = "admin"
	ServiceAPI   string = "api"
)

Types of services

View Source
const (
	// log levels
	LogLevelDebug string = "debug"
	LogLevelInfo  string = "info"
	LogLevelWarn  string = "warn"
	LogLevelError string = "error"
	// log formats
	LogFormatConsole string = "console"
	LogFormatJSON    string = "json"
)
View Source
const (
	AuthNone  string = "none"
	AuthJSON  string = "json"
	AuthDB    string = "db"
	AuthSAML  string = "saml"
	AuthJWT   string = "jwt"
	AuthOAuth string = "oauth"
	AuthOIDC  string = "oidc"
)

Types of authentication

View Source
const (
	LoggingNone     string = "none"
	LoggingStdout   string = "stdout"
	LoggingFile     string = "file"
	LoggingDB       string = "db"
	LoggingGraylog  string = "graylog"
	LoggingSplunk   string = "splunk"
	LoggingLogstash string = "logstash"
	LoggingKinesis  string = "kinesis"
	LoggingS3       string = "s3"
	LoggingKafka    string = "kafka"
	LoggingElastic  string = "elastic"
)

Types of logging

View Source
const (
	CarverLocal string = "local"
	CarverDB    string = "db"
	CarverS3    string = "s3"
)

Types of carver

Variables

This section is empty.

Functions

func InitAPIFlags

func InitAPIFlags(params *ServiceFlagParams) []cli.Flag

InitAPIFlags initializes all the flags needed for the API service

func InitAdminFlags

func InitAdminFlags(params *ServiceFlagParams) []cli.Flag

InitAdminFlags initializes all the flags needed for the Admin service

func InitTLSFlags

func InitTLSFlags(params *ServiceFlagParams) []cli.Flag

InitTLSFlags initializes all the flags needed for the TLS service

Types

type DebugHTTPConfiguration added in v0.4.5

type DebugHTTPConfiguration struct {
	Enabled  bool   `json:"enabled"`
	File     string `json:"file"`
	ShowBody bool   `json:"showBody"`
}

DebugHTTPConfiguration to hold all debug configuration values

type JSONConfigurationJWT

type JSONConfigurationJWT struct {
	JWTSecret     string `json:"jwtSecret"`
	HoursToExpire int    `json:"hoursToExpire"`
}

JSONConfigurationJWT to hold all JWT configuration values

type JSONConfigurationService

type JSONConfigurationService struct {
	Listener        string `json:"listener"`
	Port            string `json:"port"`
	LogLevel        string `json:"logLevel"`
	LogFormat       string `json:"logFormat"`
	MetricsListener string `json:"metricsListener"`
	MetricsPort     string `json:"metricsPort"`
	MetricsEnabled  bool   `json:"metricsEnabled"`
	Host            string `json:"host"`
	Auth            string `json:"auth"`
	Logger          string `json:"logger"`
	Carver          string `json:"carver"`
	SessionKey      string `json:"sessionKey"`
}

JSONConfigurationService to hold the service configuration values

type JSONConfigurationWriter

type JSONConfigurationWriter struct {
	// BatchWriter configuration: it need be refactored to a separate struct
	WriterBatchSize  int           `json:"writerBatchSize"`
	WriterTimeout    time.Duration `json:"writerTimeout"`
	WriterBufferSize int           `json:"writerBufferSize"`
}

JSONConfigurationWriter to hold writer service configuration values

type KafkaConfiguration

type KafkaConfiguration struct {
	BoostrapServer    string                  `json:"bootstrap_servers"`
	SSLCALocation     string                  `json:"ssl_ca_location"`
	ConnectionTimeout time.Duration           `json:"connection_timeout"`
	SASL              KafkaSASLConfigurations `json:"sasl"`
	Topic             string                  `json:"topic"`
}

type KafkaSASLConfigurations

type KafkaSASLConfigurations struct {
	Mechanism string `json:"mechanism"`
	Username  string `json:"username"`
	Password  string `json:"password"`
}

type OsctrldConfiguration added in v0.4.5

type OsctrldConfiguration struct {
	Enabled bool `json:"enabled"`
}

OsctrldConfiguration to hold osctrld configuration values

type S3Configuration

type S3Configuration struct {
	Bucket          string `json:"bucket"`
	Region          string `json:"region"`
	AccessKey       string `json:"accessKey"`
	SecretAccessKey string `json:"secretAccesKey"`
}

S3Configuration to hold all S3 configuration values

type ServiceFlagParams

type ServiceFlagParams struct {
	// Configuration will be loaded from a file
	ConfigFlag bool
	// Service configuration file
	ServiceConfigFile string
	// DB configuration will be loaded from a file
	DBFlag bool
	// DB configuration file
	DBConfigFile string
	// Redis configuration will be loaded from a file
	RedisFlag bool
	// Redis configuration file
	RedisConfigFile string

	// Enable TLS termination
	TLSServer bool
	// TLS certificate file
	TLSCertFile string
	// TLS private key file
	TLSKeyFile string

	// Logger configuration file
	LoggerFile string
	// Logger DB configuration will be the same as the main DB
	LoggerDBSame bool
	// Always log status and on-demand query logs from nodes in database
	AlwaysLog bool

	// Carver configuration file
	CarverConfigFile string

	// JWT configuration will be loaded from a file
	JWTFlag bool
	// JWT configuration file
	JWTConfigFile string

	// osquery version to use
	OsqueryVersion string
	// JSON file with osquery tables data
	OsqueryTablesFile string

	// SAML configuration file
	SAMLConfigFile string
	// Static files folder
	StaticFiles string
	// Use offline static files
	StaticOffline bool
	// Templates folder
	TemplatesDir string
	// Carved files folder
	CarvedDir string

	// Debug HTTP configuration values
	DebugHTTPValues DebugHTTPConfiguration

	// osctrld configuration values
	OsctrldConfigValues OsctrldConfiguration

	// Service configuration values
	ConfigValues JSONConfigurationService
	// DB writer configuration values
	WriterConfig JSONConfigurationWriter
	// DB configuration values
	DBConfigValues backend.JSONConfigurationDB
	// Redis configuration values
	RedisConfigValues cache.JSONConfigurationRedis
	// S3 loggging configuration values
	S3LogConfig S3Configuration
	// S3 carver configuration values
	S3CarverConfig S3Configuration
	// Kafka logging configuration values
	KafkaConfiguration KafkaConfiguration
	// JWT configuration values
	JWTConfigValues JSONConfigurationJWT
}

ServiceFlagParams stores flag values for the each service

type TLSConfiguration added in v0.4.6

type TLSConfiguration struct {
	Service     YAMLConfigurationService `mapstructure:"service"`
	DB          YAMLConfigurationDB      `mapstructure:"db"`
	BatchWriter YAMLConfigurationWriter  `mapstructure:"batchWriter"`
	Redis       YAMLConfigurationRedis   `mapstructure:"redis"`
	Metrics     YAMLConfigurationMetrics `mapstructure:"metrics"`
	Osctrld     YAMLConfigurationOsctrld `mapstructure:"osctrld"`
	TLS         YAMLConfigurationTLS     `mapstructure:"tls"`
	Logger      YAMLConfigurationLogger  `mapstructure:"logger"`
	Carver      YAMLConfigurationCarver  `mapstructure:"carver"`
	Debug       YAMLConfigurationDebug   `mapstructure:"debug"`
}

TLSConfiguration to hold osctrl-tls configuration values

type YAMLConfigurationCarver added in v0.4.6

type YAMLConfigurationCarver struct {
	Type            string `yaml:"type"`
	CertificateFile string `yaml:"certificateFile"`
	KeyFile         string `yaml:"keyFile"`
}

YAMLConfigurationCarver to hold the carver configuration values

type YAMLConfigurationDB added in v0.4.6

type YAMLConfigurationDB struct {
	Host            string `yaml:"host"`
	Port            string `yaml:"port"`
	Name            string `yaml:"name"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	SSLMode         string `yaml:"sslmode"`
	MaxIdleConns    int    `yaml:"maxIdleConns"`
	MaxOpenConns    int    `yaml:"maxOpenConns"`
	ConnMaxLifetime int    `yaml:"connMaxLifetime"`
	ConnRetry       int    `yaml:"connRetry"`
}

YAMLConfigurationDB to hold all backend configuration values

type YAMLConfigurationDebug added in v0.4.6

type YAMLConfigurationDebug struct {
	EnableHTTP bool   `yaml:"enableHttp"`
	HTTPFile   string `yaml:"httpFile"`
	ShowBody   bool   `yaml:"showBody"`
}

YAMLConfigurationDebug to hold the debug configuration values

type YAMLConfigurationLogger added in v0.4.6

type YAMLConfigurationLogger struct {
	Type         string `yaml:"type"`
	LoggerDBSame bool   `yaml:"loggerDBSame"`
	AlwaysLog    bool   `yaml:"alwaysLog"`
}

YAMLConfigurationLogger to hold the logger configuration values

type YAMLConfigurationMetrics added in v0.4.6

type YAMLConfigurationMetrics struct {
	Enabled  bool   `yaml:"enabled"`
	Listener string `yaml:"listener"`
	Port     string `yaml:"port"`
}

YAMLConfigurationMetrics to hold the metrics configuration values

type YAMLConfigurationOsctrld added in v0.4.6

type YAMLConfigurationOsctrld struct {
	Enabled bool `yaml:"enabled"`
}

YAMLConfigurationOsctrld to hold the osctrld configuration values

type YAMLConfigurationRedis added in v0.4.6

type YAMLConfigurationRedis struct {
	Host             string `yaml:"host"`
	Port             string `yaml:"port"`
	Password         string `yaml:"password"`
	ConnectionString string `yaml:"connectionString"`
	DB               int    `yaml:"db"`
	ConnRetry        int    `yaml:"connRetry"`
}

YAMLConfigurationRedis to hold all redis configuration values

type YAMLConfigurationSAML added in v0.4.6

type YAMLConfigurationSAML struct {
	CertPath     string `yaml:"certpath"`
	KeyPath      string `yaml:"keypath"`
	MetaDataURL  string `yaml:"metadataurl"`
	RootURL      string `yaml:"rooturl"`
	LoginURL     string `yaml:"loginurl"`
	LogoutURL    string `yaml:"logouturl"`
	JITProvision bool   `yaml:"jitprovision"`
	SPInitiated  bool   `yaml:"spinitiated"`
}

YAMLConfigurationSAML to keep all SAML details for auth

type YAMLConfigurationService added in v0.4.6

type YAMLConfigurationService struct {
	Listener  string `yaml:"listener"`
	Port      string `yaml:"port"`
	LogLevel  string `yaml:"logLevel"`
	LogFormat string `yaml:"logFormat"`
	Host      string `yaml:"host"`
	Auth      string `yaml:"auth"`
}

YAMLConfigurationService to hold the service configuration values

type YAMLConfigurationTLS added in v0.4.6

type YAMLConfigurationTLS struct {
	Termination     bool   `yaml:"termination"`
	CertificateFile string `yaml:"certificateFile"`
	KeyFile         string `yaml:"keyFile"`
}

YAMLConfigurationTLS to hold the TLS/SSL termination configuration values

type YAMLConfigurationWriter added in v0.4.6

type YAMLConfigurationWriter struct {
	// BatchWriter configuration: it need be refactored to a separate struct
	WriterBatchSize  int `yaml:"writerBatchSize"`
	WriterTimeout    int `yaml:"writerTimeout"`
	WriterBufferSize int `yaml:"writerBufferSize"`
}

YAMLConfigurationWriter to hold the DB batch writer configuration values

Jump to

Keyboard shortcuts

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