defense

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationDefense

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

func NewApplicationDefense

func NewApplicationDefense() *ApplicationDefense

func (*ApplicationDefense) Scan

func (ad *ApplicationDefense) Scan(input string) []ThreatEvent

func (*ApplicationDefense) Status

func (ad *ApplicationDefense) Status() string

type DefenseInDepth

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

func NewDefenseInDepth

func NewDefenseInDepth() *DefenseInDepth

func (*DefenseInDepth) Scan

func (d *DefenseInDepth) Scan(input string) []ThreatEvent

func (*DefenseInDepth) Status

func (d *DefenseInDepth) Status() map[string]interface{}

func (*DefenseInDepth) UpdatePolicy

func (d *DefenseInDepth) UpdatePolicy(policy *SecurityPolicy) error

type DefenseLayer

type DefenseLayer int
const (
	LayerApplication DefenseLayer = 1
	LayerNetwork     DefenseLayer = 2
	LayerKernel      DefenseLayer = 3
)

type EventBus

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

func NewEventBus

func NewEventBus(bufferSize int) *EventBus

func (*EventBus) Events

func (eb *EventBus) Events() <-chan ThreatEvent

func (*EventBus) Publish

func (eb *EventBus) Publish(event ThreatEvent)

func (*EventBus) Subscribe

func (eb *EventBus) Subscribe(fn func(ThreatEvent))

type KernelDefense

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

func NewKernelDefense

func NewKernelDefense() *KernelDefense

func (*KernelDefense) Check

func (kd *KernelDefense) Check() []ThreatEvent

func (*KernelDefense) Status

func (kd *KernelDefense) Status() string

type NetworkDefense

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

func NewNetworkDefense

func NewNetworkDefense() *NetworkDefense

func (*NetworkDefense) AddAllowedDomain

func (nd *NetworkDefense) AddAllowedDomain(domain string)

func (*NetworkDefense) AddAllowedIP

func (nd *NetworkDefense) AddAllowedIP(ip string)

func (*NetworkDefense) Check

func (nd *NetworkDefense) Check() []ThreatEvent

func (*NetworkDefense) Status

func (nd *NetworkDefense) Status() string

type Rule

type Rule struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Action  string `json:"action"`
	Pattern string `json:"pattern"`
}

type SecurityPolicy

type SecurityPolicy struct {
	Version    string    `json:"version"`
	SHA256     string    `json:"sha256"`
	UpdatedAt  time.Time `json:"updated_at"`
	ShadowMode bool      `json:"shadow_mode"`
	CanaryMode bool      `json:"canary_mode"`
	Rules      []Rule    `json:"rules"`
}

type ThreatEvent

type ThreatEvent struct {
	Type      ThreatType   `json:"type"`
	Layer     DefenseLayer `json:"layer"`
	Severity  int          `json:"severity"`
	Message   string       `json:"message"`
	Timestamp time.Time    `json:"timestamp"`
}

type ThreatType

type ThreatType string
const (
	ThreatPromptInjection ThreatType = "prompt_injection"
	ThreatPIILeak         ThreatType = "pii_leak"
	ThreatSecretExposure  ThreatType = "secret_exposure"
	ThreatMalware         ThreatType = "malware"
	ThreatVulnerability   ThreatType = "vulnerability"
)

Jump to

Keyboard shortcuts

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