Documentation
¶
Index ¶
- func AdvancedActionsTestHandler(c *gin.Context)
- func ApplyFail2banSettings(jailLocalPath string) error
- func BanIPHandler(c *gin.Context)
- func BanInsightsHandler(c *gin.Context)
- func BanNotificationHandler(c *gin.Context)
- func BanStatisticsHandler(c *gin.Context)
- func CreateFilterHandler(c *gin.Context)
- func CreateJailHandler(c *gin.Context)
- func DeleteFilterHandler(c *gin.Context)
- func DeleteJailHandler(c *gin.Context)
- func DeleteServerHandler(c *gin.Context)
- func GetJailFilterConfigHandler(c *gin.Context)
- func GetSettingsHandler(c *gin.Context)
- func HandleBanNotification(ctx context.Context, server config.Fail2banServer, ...) error
- func HandleUnbanNotification(ctx context.Context, server config.Fail2banServer, ...) error
- func IndexHandler(c *gin.Context)
- func ListBanEventsHandler(c *gin.Context)
- func ListFiltersHandler(c *gin.Context)
- func ListPermanentBlocksHandler(c *gin.Context)
- func ListSSHKeysHandler(c *gin.Context)
- func ListServersHandler(c *gin.Context)
- func LoginAuth(username, password string) smtp.Auth
- func ManageJailsHandler(c *gin.Context)
- func RegisterRoutes(r *gin.Engine, hub *Hub)
- func RestartFail2banHandler(c *gin.Context)
- func SetDefaultServerHandler(c *gin.Context)
- func SetJailFilterConfigHandler(c *gin.Context)
- func SetWebSocketHub(hub *Hub)
- func SummaryHandler(c *gin.Context)
- func TestEmailHandler(c *gin.Context)
- func TestFilterHandler(c *gin.Context)
- func TestLogpathHandler(c *gin.Context)
- func TestServerHandler(c *gin.Context)
- func UnbanIPHandler(c *gin.Context)
- func UnbanNotificationHandler(c *gin.Context)
- func UpdateJailManagementHandler(c *gin.Context)
- func UpdateSettingsHandler(c *gin.Context)
- func UpsertServerHandler(c *gin.Context)
- func WebSocketHandler(hub *Hub) gin.HandlerFunc
- type Client
- type Hub
- type SummaryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdvancedActionsTestHandler ¶ added in v1.2.7
AdvancedActionsTestHandler allows manual block/unblock tests.
func ApplyFail2banSettings ¶
ApplyFail2banSettings updates /etc/fail2ban/jail.local [DEFAULT] with our JSON
func BanIPHandler ¶ added in v1.2.8
BanIPHandler bans a given IP in a specific jail.
func BanInsightsHandler ¶ added in v1.2.7
BanInsightsHandler returns aggregate stats for countries and recurring IPs.
func BanNotificationHandler ¶
BanNotificationHandler processes incoming ban notifications from Fail2Ban.
func BanStatisticsHandler ¶ added in v1.2.7
BanStatisticsHandler returns aggregated ban counts per server.
func CreateFilterHandler ¶ added in v1.2.7
CreateFilterHandler creates a new filter.
func CreateJailHandler ¶ added in v1.2.7
CreateJailHandler creates a new jail.
func DeleteFilterHandler ¶ added in v1.2.7
DeleteFilterHandler deletes a filter.
func DeleteJailHandler ¶ added in v1.2.7
DeleteJailHandler deletes a jail.
func DeleteServerHandler ¶ added in v1.2.7
DeleteServerHandler removes a server configuration.
func GetJailFilterConfigHandler ¶
GetJailFilterConfigHandler returns both the filter config and jail config for a given jail
func GetSettingsHandler ¶
GetSettingsHandler returns the entire AppSettings struct as JSON
func HandleBanNotification ¶
func HandleBanNotification(ctx context.Context, server config.Fail2banServer, ip, jail, hostname, failures, whois, logs string) error
HandleBanNotification processes Fail2Ban notifications, checks geo-location, stores the event, and sends alerts.
func HandleUnbanNotification ¶ added in v1.2.7
func HandleUnbanNotification(ctx context.Context, server config.Fail2banServer, ip, jail, hostname, whois, country string) error
HandleUnbanNotification processes Fail2Ban unban notifications, stores the event, and sends alerts.
func ListBanEventsHandler ¶ added in v1.2.7
ListBanEventsHandler returns stored ban events from the internal database.
func ListFiltersHandler ¶
ListFiltersHandler returns a JSON array of filter names found as *.conf in /etc/fail2ban/filter.d
func ListPermanentBlocksHandler ¶ added in v1.2.7
ListPermanentBlocksHandler exposes the permanent block log.
func ListSSHKeysHandler ¶ added in v1.2.7
ListSSHKeysHandler returns SSH keys available on the UI host.
func ListServersHandler ¶ added in v1.2.7
ListServersHandler returns configured Fail2ban servers.
func ManageJailsHandler ¶ added in v1.2.7
ManageJailsHandler returns a list of all jails (from jail.local and jail.d) including their enabled status.
func RegisterRoutes ¶
RegisterRoutes sets up the routes for the Fail2ban UI.
func RestartFail2banHandler ¶ added in v1.2.7
RestartFail2banHandler reloads the Fail2ban service
func SetDefaultServerHandler ¶ added in v1.2.7
SetDefaultServerHandler marks a server as default.
func SetJailFilterConfigHandler ¶
SetJailFilterConfigHandler overwrites both the filter config and jail config with new content
func SetWebSocketHub ¶ added in v1.2.7
func SetWebSocketHub(hub *Hub)
SetWebSocketHub sets the global WebSocket hub instance
func SummaryHandler ¶
SummaryHandler returns a JSON summary of all jails, including number of banned IPs, how many are new in the last hour, etc.
func TestEmailHandler ¶
******************************************************************* * TestEmailHandler to send test-mail : * *******************************************************************
func TestFilterHandler ¶
func TestLogpathHandler ¶ added in v1.2.7
TestLogpathHandler tests a logpath and returns matching files Resolves Fail2Ban variables before testing Accepts optional logpath in request body, otherwise reads from saved jail config
func TestServerHandler ¶ added in v1.2.7
TestServerHandler verifies connectivity to a configured Fail2ban server.
func UnbanIPHandler ¶
UnbanIPHandler unbans a given IP in a specific jail.
func UnbanNotificationHandler ¶ added in v1.2.7
UnbanNotificationHandler processes incoming unban notifications from Fail2Ban.
func UpdateJailManagementHandler ¶ added in v1.2.7
After updating, fail2ban is reloaded to apply the changes.
func UpdateSettingsHandler ¶
UpdateSettingsHandler updates the AppSettings from a JSON body
func UpsertServerHandler ¶ added in v1.2.7
UpsertServerHandler creates or updates a Fail2ban server configuration.
func WebSocketHandler ¶ added in v1.2.7
func WebSocketHandler(hub *Hub) gin.HandlerFunc
WebSocketHandler is the Gin handler for WebSocket connections
Types ¶
type Client ¶ added in v1.2.7
type Client struct {
// contains filtered or unexported fields
}
Client represents a WebSocket connection
type Hub ¶ added in v1.2.7
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to them
func (*Hub) BroadcastBanEvent ¶ added in v1.2.7
func (h *Hub) BroadcastBanEvent(event storage.BanEventRecord)
BroadcastBanEvent broadcasts a ban event to all connected clients
func (*Hub) BroadcastUnbanEvent ¶ added in v1.2.7
func (h *Hub) BroadcastUnbanEvent(event storage.BanEventRecord)
BroadcastUnbanEvent broadcasts an unban event to all connected clients
type SummaryResponse ¶
SummaryResponse is what we return from /api/summary