portscan

package
v1.127.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName    = "portscan"
	ModuleVersion = "1.0.0"

	// Check interval
	DefaultCheckInterval = constants.PortscanCheckInterval
)

Variables

This section is empty.

Functions

func Descriptor

func Descriptor() module.Descriptor

Descriptor returns the module descriptor NO FALLBACK - path must come from /etc/nftban/nftban.conf

Types

type Module

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

Module implements the portscan detection module

func New

func New() *Module

New creates a new portscan detection module

func (*Module) Init

func (m *Module) Init(bus *eventbus.Bus) error

Init initializes the module with the event bus

func (*Module) Name

func (m *Module) Name() string

Name returns the module identifier

func (*Module) Start

func (m *Module) Start(ctx context.Context) error

Start begins the module's background work

func (*Module) Status

func (m *Module) Status() module.Status

Status returns the current module status

func (*Module) Stop

func (m *Module) Stop() error

Stop gracefully shuts down the module

type PortscanStatusExtra added in v1.110.0

type PortscanStatusExtra struct {
	Mode              string `json:"mode"`
	SuricataAvailable bool   `json:"suricata_available"`
	ScansDetected     int64  `json:"scans_detected"`
}

PortscanStatusExtra is the typed status payload for the Portscan module's Status().Extra field. Field names map to legacy map[string]any keys via JSON tags byte-for-byte; R-12 introduces type-safety without an API change.

func (PortscanStatusExtra) ToExtraInfo added in v1.110.0

func (e PortscanStatusExtra) ToExtraInfo() module.ExtraInfo

ToExtraInfo serializes the typed struct into the module.ExtraInfo map[string]any contract expected by module.Status.Extra.

Jump to

Keyboard shortcuts

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