management

package
v0.0.0-...-5452022 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAgent

func DeleteAgent(c *gin.Context)

delete an agent based on name using a surrealdb token.

func GetPipeline

func GetPipeline(c *gin.Context)

func ListRuleTables

func ListRuleTables(c *gin.Context)

list all tables in the rules database

func LoginUser

func LoginUser(c *gin.Context)

use the token for management, needs different database variable than main one

func RegisterUser

func RegisterUser(c *gin.Context)

stuff for updating rules, enrichments, agents (all things management)

func SearchRules

func SearchRules(c *gin.Context)

search database for specific rule matching

func Tables

func Tables(db *surrealdb.DB) (tables []string)

fetch all tables

func UpdateAgent

func UpdateAgent(c *gin.Context)

update an agent's config based on name and using surrealDB token.

func UpdatePipeline

func UpdatePipeline(c *gin.Context)

func UpdateRules

func UpdateRules(c *gin.Context)

func UpdateUser

func UpdateUser(c *gin.Context)

update a system user on the database level.

Types

type AgentConfigUpdate

type AgentConfigUpdate struct {
	Name   string `json:"name"`   // agent hostname
	Config string `json:"config"` // base64 encoded yaml configuration
}

type AgentDel

type AgentDel struct {
	AgentName string `json:"agent_name"`
}

type Conditions

type Conditions struct {
	Contains    []string `yaml:"contains,omitempty"`     // contains can be regex or NOT
	NotContains []string `yaml:"not_contains,omitempty"` // can be regex or NOT
	Equals      []any    `yaml:"equals,omitempty"`
	NotEquals   []any    `yaml:"not_equals,omitempty"`
	LessThan    []any    `yaml:"less_than,omitempty"`
	GreaterThan []any    `yaml:"greater_than,omitempty"`
	Field       string   `yaml:"field"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error" example:"Invalid input"`
}

--- api output default types ---

type Result

type Result struct {
	Result string `json:"result" example:"ok"`
}

type Rule

type Rule struct {
	Streams     []string   `yaml:"streams"`
	Conditions  Conditions `yaml:"conditions"`
	Level       int        `yaml:"level"`
	Description string     `yaml:"description"`
	ID          string     `yaml:"id"`
	Groups      []string   `yaml:"groups"`
}

yaml stuff

type RuleFile

type RuleFile struct {
	Rules []Rule `yaml:"rules"` // array of rule files
}

type SurrealRule

type SurrealRule struct {
	ID       *models.RecordID `json:"id,omitempty"`
	RuleData Rule             `json:"rule_data,omitempty"`
}

type UpdateRule

type UpdateRule struct {
	Table    string `json:"table"`
	RuleData string `json:"rule_data"` // base64 data (easier to deal with)

}

update rule based on filename/table name

type UpdateUserJSON

type UpdateUserJSON struct {
	Action    string `json:"action"`
	Username  string `json:"username"`
	Access    string `json:"access,omitempty"`
	Namespace string `json:"namespace"`
	Database  string `json:"database"`
	UserPass  string `json:"user_password,omitempty"`
}

type UserLogin

type UserLogin struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserRegister

type UserRegister struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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