Versions in this module Expand all Collapse all v0 v0.4.0-beta.7 Aug 23, 2026 v0.4.0-beta.6 Aug 23, 2026 v0.4.0-beta.5 Aug 22, 2026 v0.4.0-beta.4 Aug 21, 2026 v0.4.0-beta.3 Aug 5, 2026 v0.4.0-beta.2 Aug 1, 2026 v0.4.0-beta.1 Jul 29, 2026 v0.3.0 Jun 8, 2026 Changes in this version type Manager + func (m *Manager) IsRequestWhitelisted(ip, path string) (bool, error) v0.2.0 May 25, 2026 v0.1.56 Mar 27, 2026 v0.1.55 Mar 24, 2026 v0.1.54 Mar 24, 2026 v0.1.53 Mar 23, 2026 v0.1.52 Mar 23, 2026 v0.1.51 Mar 23, 2026 v0.1.5 Mar 22, 2026 Changes in this version + const EventTypeForbiddenAccess + const EventTypeHighRequestRate + const EventTypeNotFoundProbe + const EventTypeRateLimitExceeded + const EventTypeScannerDetected + const EventTypeServerError + const EventTypeSuspiciousPath + const EventTypeUnauthorizedAccess + const LuaSecurityScript + const SeverityCritical + const SeverityHigh + const SeverityLow + const SeverityMedium + var ScannerUserAgents = []string + var SuspiciousPaths = []string + func GenerateLuaScript(agentIP string, agentPort int) (string, error) + func GetSuspiciousPathDescription(path string) string + func IsScanner(userAgent string) bool + func IsSuspiciousPath(path string) bool + type BlockedIP struct + AutoBlocked bool + BlockedAt time.Time + ExpiresAt *time.Time + ID int64 + IP string + Reason string + type DB struct + func NewDB(deploymentsPath string) (*DB, error) + func (db *DB) AddProtectedRoute(route *ProtectedRoute) (int64, error) + func (db *DB) AddWhitelistEntry(value, entryType, reason string, isInternal bool) (int64, error) + func (db *DB) BlockIP(ip, reason string, expiresAt *time.Time, autoBlocked bool) (int64, error) + func (db *DB) CleanupExpiredBlocks() (int64, error) + func (db *DB) CleanupOldEvents(olderThan time.Duration) (int64, error) + func (db *DB) Close() error + func (db *DB) DeleteProtectedRoute(id int64) error + func (db *DB) GetActiveBlockedIPs() ([]BlockedIP, error) + func (db *DB) GetBlockedIPs() ([]BlockedIP, error) + func (db *DB) GetEnabledProtectedRoutes() ([]ProtectedRoute, error) + func (db *DB) GetEventByID(id int64) (*SecurityEvent, error) + func (db *DB) GetEvents(filter *EventFilter) ([]SecurityEvent, int, error) + func (db *DB) GetProtectedRoutes() ([]ProtectedRoute, error) + func (db *DB) GetStats() (*SecurityStats, error) + func (db *DB) GetWhitelist() ([]WhitelistEntry, error) + func (db *DB) InsertEvent(event *SecurityEvent) (int64, error) + func (db *DB) IsIPBlocked(ip string) (bool, error) + func (db *DB) IsWhitelisted(value string) (bool, error) + func (db *DB) RemoveWhitelistEntry(id int64) error + func (db *DB) SeedDefaultWhitelist() error + func (db *DB) UnblockIP(ip string) error + func (db *DB) UpdateProtectedRoute(route *ProtectedRoute) error + type DeploymentStats struct + Critical int + EventCount int + High int + Name string + type Detector struct + func NewDetector() *Detector + func (d *Detector) Classify(event *IngestEvent) *SecurityEvent + func (d *Detector) CleanupOldWindows() + func (d *Detector) GetIPRequestCount(ip string) int + func (d *Detector) SetThresholds(...) + func (d *Detector) ShouldAutoBlock(ip string, event *SecurityEvent) bool + type EventFilter struct + DeploymentName string + EndTime time.Time + EventType string + Limit int + Offset int + Severity string + SourceIP string + StartTime time.Time + type IPStats struct + EventCount int + IP string + LastSeen time.Time + type IngestEvent struct + DeploymentName string + RequestMethod string + RequestPath string + SourceIP string + StatusCode int + Timestamp int64 + UserAgent string + type IngestResult struct + AutoBlocked bool + BlockTTL int + BlockedIP string + Event *SecurityEvent + type Manager struct + func NewManager(deploymentsPath string) (*Manager, error) + func (m *Manager) AddDockerGatewayToWhitelist(gatewayIP string) error + func (m *Manager) AddProtectedRoute(route *ProtectedRoute) (int64, error) + func (m *Manager) AddWhitelistEntry(value, entryType, reason string) (int64, error) + func (m *Manager) BlockIP(ip, reason string, durationSeconds int) (int64, error) + func (m *Manager) Cleanup(retentionDays int) (int64, int64, error) + func (m *Manager) Close() error + func (m *Manager) DeleteProtectedRoute(id int64) error + func (m *Manager) GetActiveBlockedIPs() ([]BlockedIP, error) + func (m *Manager) GetBlockedIPs() ([]BlockedIP, error) + func (m *Manager) GetEnabledProtectedRoutes() ([]ProtectedRoute, error) + func (m *Manager) GetEventByID(id int64) (*SecurityEvent, error) + func (m *Manager) GetEvents(filter *EventFilter) ([]SecurityEvent, int, error) + func (m *Manager) GetEventsByDeployment(name string, limit int) ([]SecurityEvent, int, error) + func (m *Manager) GetEventsByIP(ip string) ([]SecurityEvent, error) + func (m *Manager) GetProtectedRoutes() ([]ProtectedRoute, error) + func (m *Manager) GetStats() (*SecurityStats, error) + func (m *Manager) GetWhitelist() ([]WhitelistEntry, error) + func (m *Manager) IngestEvent(event *IngestEvent, autoBlockDuration time.Duration) (*IngestResult, error) + func (m *Manager) InitNginxConfigs(nginxConfigPath string) error + func (m *Manager) IsIPBlocked(ip string) (bool, error) + func (m *Manager) IsWhitelisted(value string) (bool, error) + func (m *Manager) RemoveWhitelistEntry(id int64) error + func (m *Manager) SetDetectorThresholds(...) + func (m *Manager) UnblockIP(ip string) error + func (m *Manager) UpdateProtectedRoute(route *ProtectedRoute) error + type NginxConfigGenerator struct + func NewNginxConfigGenerator(manager *Manager, configPath string) *NginxConfigGenerator + func (g *NginxConfigGenerator) EnsureSecurityConfigFiles() error + func (g *NginxConfigGenerator) GenerateProtectedLocations() (string, error) + func (g *NginxConfigGenerator) GenerateProtectedPathsConfig(paths []string) string + func (g *NginxConfigGenerator) GenerateRateLimitsConfig() (string, error) + func (g *NginxConfigGenerator) WriteRateLimitsConfig() error + type ProtectedRoute struct + BlockDuration int + CreatedAt time.Time + Enabled bool + ID int64 + PathPattern string + RateLimit int + type SecurityEvent struct + CreatedAt time.Time + DeploymentName string + EventType string + ID int64 + Message string + RawLog string + RequestMethod string + RequestPath string + Severity string + SourceIP string + StatusCode int + UserAgent string + type SecurityStats struct + BlockedIPsCount int + BySeverity map[string]int + ByType map[string]int + EventsTrend []TrendPoint + Last24Hours int + Last7Days int + ProtectedRoutesCount int + RecentCritical []SecurityEvent + TopDeployments []DeploymentStats + TopOffendingIPs []IPStats + TotalEvents int + type TrendPoint struct + Count int + Date string + type WhitelistEntry struct + CreatedAt time.Time + ID int64 + IsInternal bool + Reason string + Type string + Value string