config

package
v0.0.0-...-738f650 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// HTTP API Server
	HTTP_API_PORT = "8090"

	// API Endpoints
	API_ALERT_STATUS_ENDPOINT           = "/api/utm-alerts/status"
	API_INCIDENT_ENDPOINT               = "/api/utm-incidents"
	API_INCIDENT_ADD_NEW_ALERT_ENDPOINT = "/api/utm-incidents/add-alerts"

	// Status codes
	API_ALERT_COMPLETED_STATUS_CODE = 5

	// Timeouts (in seconds)
	HTTP_GPT_TIMEOUT = 90 // Timeout for LLM API calls
	HTTP_TIMEOUT     = 30 // Timeout for general HTTP calls

	// Startup timing
	CONFIG_STARTUP_DELAY = 2 // Seconds to wait for config system to initialize
	ERROR_EXIT_DELAY     = 5 // Seconds to wait before exiting on fatal error

	// Config polling
	TIME_FOR_GET_CONFIG = 10 // Seconds between config refresh attempts
	CLEANER_DELAY       = 10

	// Correlation limits
	CORRELATION_MAX_ALERTS = 100 // Maximum historical alerts to fetch for correlation

	// Separators
	LOGS_SEPARATOR = "\n\n" // Double newline - cleaner for display
)

Variables

View Source
var (
	FakeUserName = "John Doe"
	FakeEmail    = "jhondoe@gmail.com"
)

Fake values for anonymization

View Source
var SensitivePatterns = map[string]*SensitivePattern{
	"email": {Regexp: `([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})`, FakeValue: "jhondoe@gmail.com"},
}

SensitivePatterns defines patterns to anonymize in alert data

Functions

func GetConfigUpdateChannel

func GetConfigUpdateChannel() <-chan *Set

func StartConfigurationSystem

func StartConfigurationSystem()

Types

type Cipher

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

func NewCipher

func NewCipher(key string) *Cipher

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(crypt string) (string, error)

type Config

type Config struct {
	// Platform (from plugins.PluginCfg("com.utmstack"))
	Backend     string
	InternalKey string

	// LLM (from YAML)
	Provider       string
	URL            string
	Model          string
	APIKey         string // decrypted
	AuthType       string // bearer | header | none
	AuthHeaderName string
	CustomHeaders  map[string]string
	MaxTokens      int
	ContextWindow  int

	// Agent behavior (from YAML)
	MaxToolIterations int
	AutoAnalyze       bool
	// AllowIncidents: whether the AUTOMATIC triage queue may create/update
	// incidents when it decides an alert warrants one. Unrelated to the
	// interactive chat — see Capabilities and TriageCapabilities.
	AllowIncidents bool
	// Capabilities: the interactive chat agent's tool groups. Always every
	// group — including "incidents" — since a person is already driving
	// that conversation; configuring SOC-AI at all is the signal it's meant
	// to be used. Never gated by AllowIncidents.
	Capabilities []string

	// Derived: true when the plugin is configured enough to run.
	ModuleActive bool
}

func GetConfig

func GetConfig(tenantID string) *Config

func GetPlatform

func GetPlatform() *Config

func (*Config) TriageCapabilities

func (c *Config) TriageCapabilities() []string

TriageCapabilities is what the AUTOMATIC triage queue may use — distinct from Capabilities (the chat's, always everything): the queue runs unattended, so unlike the chat, whether it may touch incidents is a real choice, gated by AllowIncidents. It has no business with dashboards, compliance, correlation, datasources or SOAR either way; the triage prompt never asks for them.

type SensitivePattern

type SensitivePattern struct {
	Regexp    string
	FakeValue string
	// contains filtered or unexported fields
}

SensitivePattern defines a pattern for anonymizing sensitive data

func (*SensitivePattern) GetRegexp

func (sp *SensitivePattern) GetRegexp() *regexp.Regexp

GetRegexp returns the compiled regexp, compiling it on first access

type Set

type Set struct {
	Default *Config
	Tenants map[string]*Config
}

Jump to

Keyboard shortcuts

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