Documentation
¶
Index ¶
- func ApplyFail2banSettings(jailLocalPath string) error
- func BanNotificationHandler(c *gin.Context)
- func GetJailFilterConfigHandler(c *gin.Context)
- func GetSettingsHandler(c *gin.Context)
- func HandleBanNotification(ip, jail, hostname, failures, whois, logs string) error
- func IndexHandler(c *gin.Context)
- func ListFiltersHandler(c *gin.Context)
- func LoginAuth(username, password string) smtp.Auth
- func ManageJailsHandler(c *gin.Context)
- func RegisterRoutes(r *gin.Engine)
- func RestartFail2banHandler(c *gin.Context)
- func SetJailFilterConfigHandler(c *gin.Context)
- func SummaryHandler(c *gin.Context)
- func TestEmailHandler(c *gin.Context)
- func TestFilterHandler(c *gin.Context)
- func UnbanIPHandler(c *gin.Context)
- func UpdateJailManagementHandler(c *gin.Context)
- func UpdateSettingsHandler(c *gin.Context)
- type SummaryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFail2banSettings ¶
ApplyFail2banSettings updates /etc/fail2ban/jail.local [DEFAULT] with our JSON
func BanNotificationHandler ¶
BanNotificationHandler processes incoming ban notifications from Fail2Ban.
func GetJailFilterConfigHandler ¶
GetJailFilterConfigHandler returns the raw filter config for a given jail
func GetSettingsHandler ¶
GetSettingsHandler returns the entire AppSettings struct as JSON
func HandleBanNotification ¶
HandleBanNotification processes Fail2Ban notifications, checks geo-location, and sends alerts.
func ListFiltersHandler ¶
ListFiltersHandler returns a JSON array of filter names found as *.conf in /etc/fail2ban/filter.d
func ManageJailsHandler ¶
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 ¶
RestartFail2banHandler reloads the Fail2ban service
func SetJailFilterConfigHandler ¶
SetJailFilterConfigHandler overwrites the current filter config with new content
func SummaryHandler ¶
SummaryHandler returns a JSON summary of all jails, including number of banned IPs, how many are new in the last hour, etc. and the last 5 overall ban events from the log.
func TestEmailHandler ¶
******************************************************************* * TestEmailHandler to send test-mail : * *******************************************************************
func TestFilterHandler ¶
func UnbanIPHandler ¶
UnbanIPHandler unbans a given IP in a specific jail.
func UpdateJailManagementHandler ¶
UpdateJailManagementHandler updates the enabled state for each jail. Expected JSON format: { "JailName1": true, "JailName2": false, ... } After updating, the Fail2ban service is restarted.
func UpdateSettingsHandler ¶
UpdateSettingsHandler updates the AppSettings from a JSON body