config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 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 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 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

	// 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

Jump to

Keyboard shortcuts

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