config

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 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

View Source
const (
	DBTypePostgres string = "postgres"
	DBTypeMySQL    string = "mysql"
	DBTypeSQLite   string = "sqlite"
)

Types of backend

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 APIConfiguration added in v0.4.7

type APIConfiguration struct {
	Service YAMLConfigurationService `mapstructure:"service"`
	DB      YAMLConfigurationDB      `mapstructure:"db"`
	Redis   YAMLConfigurationRedis   `mapstructure:"redis"`
	JWT     YAMLConfigurationJWT     `mapstructure:"jwt"`
	TLS     YAMLConfigurationTLS     `mapstructure:"tls"`
	Debug   YAMLConfigurationDebug   `mapstructure:"debug"`
}

APIConfiguration to hold osctrl-api configuration values

type AdminConfiguration added in v0.4.7

type AdminConfiguration struct {
	Service YAMLConfigurationService `mapstructure:"service"`
	DB      YAMLConfigurationDB      `mapstructure:"db"`
	Redis   YAMLConfigurationRedis   `mapstructure:"redis"`
	Osquery YAMLConfigurationOsquery `mapstructure:"osquery"`
	Osctrld YAMLConfigurationOsctrld `mapstructure:"osctrld"`
	JWT     YAMLConfigurationJWT     `mapstructure:"jwt"`
	TLS     YAMLConfigurationTLS     `mapstructure:"tls"`
	Logger  YAMLConfigurationLogger  `mapstructure:"logger"`
	Carver  YAMLConfigurationCarver  `mapstructure:"carver"`
	Admin   YAMLConfigurationAdmin   `mapstructure:"admin"`
	Debug   YAMLConfigurationDebug   `mapstructure:"debug"`
}

AdminConfiguration to hold osctrl-admin configuration values

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 OsqueryConfiguration added in v0.4.7

type OsqueryConfiguration struct {
	Version    string `json:"version"`
	TablesFile string `json:"tablesFile"`
	Logger     bool   `json:"logger"`
	Config     bool   `json:"config"`
	Query      bool   `json:"query"`
	Carve      bool   `json:"carve"`
}

OsqueryConfiguration to hold osquery 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 configuration values
	OsqueryConfigValues OsqueryConfiguration

	// 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
	// Branding image file
	BrandingImage string
	// Background image file
	BackgroundImage string
	// Audit log
	AuditLog bool

	// 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"`
	Osquery     YAMLConfigurationOsquery `mapstructure:"osquery"`
	Osctrld     YAMLConfigurationOsctrld `mapstructure:"osctrld"`
	Metrics     YAMLConfigurationMetrics `mapstructure:"metrics"`
	TLS         YAMLConfigurationTLS     `mapstructure:"tls"`
	Logger      YAMLConfigurationLogger  `mapstructure:"logger"`
	Carver      YAMLConfigurationCarver  `mapstructure:"carver"`
	Debug       YAMLConfigurationDebug   `mapstructure:"debug"`
}

TLSConfiguration to hold osctrl-tls configuration values

type YAMLConfigurationAdmin added in v0.4.8

type YAMLConfigurationAdmin struct {
	SessionKey      string `yaml:"sessionKey"`
	StaticDir       string `yaml:"staticDir"`
	StaticOffline   bool   `yaml:"keyFile"`
	TemplatesDir    string `yaml:"templatesDir"`
	BrandingImage   string `yaml:"brandingImage"`
	BackgroundImage string `yaml:"backgroundImage"`
}

YAMLConfigurationAdmin to hold admin UI specific 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 {
	Type            string `yaml:"type"` // Database type: postgres, mysql, sqlite
	Host            string `yaml:"host"`
	Port            string `yaml:"port"`
	Name            string `yaml:"name"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	SSLMode         string `yaml:"sslmode"` // For postgres
	MaxIdleConns    int    `yaml:"maxIdleConns"`
	MaxOpenConns    int    `yaml:"maxOpenConns"`
	ConnMaxLifetime int    `yaml:"connMaxLifetime"`
	ConnRetry       int    `yaml:"connRetry"`
	FilePath        string `yaml:"filePath"` // Used for SQLite
}

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 YAMLConfigurationJWT added in v0.4.7

type YAMLConfigurationJWT struct {
	JWTSecret     string `yaml:"jwtSecret"`
	HoursToExpire int    `yaml:"hoursToExpire"`
}

YAMLConfigurationJWT to hold all JWT 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 YAMLConfigurationOsquery added in v0.4.7

type YAMLConfigurationOsquery struct {
	Version    string `yaml:"version"`
	TablesFile string `yaml:"tablesFile"`
	Logger     bool   `yaml:"logger"`
	Config     bool   `yaml:"config"`
	Query      bool   `yaml:"query"`
	Carve      bool   `yaml:"carve"`
}

YAMLConfigurationOsquery to hold the osquery 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