profile

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyProfile

func ApplyProfile(profile ProfileType) error

ApplyProfile creates/updates the symlink to the selected profile YAML

func EnsureProfilesExist

func EnsureProfilesExist() error

EnsureProfilesExist checks if all profile templates are installed

func GetProfileYAMLPath

func GetProfileYAMLPath(profile ProfileType) (string, error)

GetProfileYAMLPath returns the path to the YAML file for a profile

func GetSuricataConfigPath

func GetSuricataConfigPath() (string, error)

GetSuricataConfigPath returns the path to the active Suricata config (symlink)

func ValidateProfile

func ValidateProfile() error

ValidateProfile checks if the current profile symlink is valid

Types

type DetectionResult

type DetectionResult struct {
	Profile    ProfileType `json:"profile"`
	ProfileStr string      `json:"profile_name"`
	CPUCount   int         `json:"cpu_count"`
	RAMGB      float64     `json:"ram_gb"`
	Reason     string      `json:"reason"`
}

DetectionResult contains system resource detection results

func DetectOptimalProfile

func DetectOptimalProfile() (*DetectionResult, error)

DetectOptimalProfile auto-detects the best Suricata profile based on system resources

type ProfileSpec

type ProfileSpec struct {
	Profile       ProfileType
	Name          string
	MinCPU        int
	MinRAMGB      float64
	RingSize      int
	FlowTimeout   int // seconds for established flows
	HTTPBodyLimit string
	DetectProfile string
	UseCase       string
}

ProfileSpec contains profile characteristics

func GetAllProfiles

func GetAllProfiles() []ProfileSpec

GetAllProfiles returns specifications for all profiles

func GetProfileSpec

func GetProfileSpec(p ProfileType) ProfileSpec

GetProfileSpec returns the specification for a given profile

type ProfileType

type ProfileType int

ProfileType represents the Suricata performance profile

const (
	// ProfileMinimal is for 2 cores / 2 GB RAM
	ProfileMinimal ProfileType = iota
	// ProfileStandard is for 4 cores / 4-8 GB RAM (DEFAULT)
	ProfileStandard
	// ProfileMaximum is for 8+ cores / 8-16 GB RAM
	ProfileMaximum
)

func GetCurrentProfile

func GetCurrentProfile() (ProfileType, error)

GetCurrentProfile reads the current active profile

func ProfileFromString

func ProfileFromString(s string) (ProfileType, error)

ProfileFromString parses a profile name

func (ProfileType) String

func (p ProfileType) String() string

String returns the profile name

Jump to

Keyboard shortcuts

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