Commit Graph

227 Commits

Author SHA1 Message Date
eaa3513e03 Add blocklists package for managing blocklist settings and sources
- Introduced `blocklists` package to handle blocklist configuration and source processing.
- Added `Setting` struct with TOML file validation, default values, and configuration parsing.
- Implemented `Sources` struct for defining blocklist source attributes and validation.
- Added support for JSON, TXT, and RSS source types with respective parsers.
2026-03-19 19:51:47 +05:00
6d35c3e5bf Add FalseBlocklist implementation for no-op blocklist operations
- Introduced `FalseBlocklist` struct as a placeholder implementation of the `Blocklist` interface.
- Added `NftReload`, `Run`, and `Close` methods with no-op behavior.
2026-03-19 19:50:53 +05:00
3061d0f31e Add blocklist package with implementation of Blocklist interface
- Introduced `blocklist` package for managing blocklist lifecycle and operations.
- Implemented methods for reloading, running, and closing blocklists.
- Added `refreshSource` and `processUpdateData` for handling source updates.
- Integrated lock mechanisms for thread-safe operations.
2026-03-19 19:50:19 +05:00
5e0fb5787a Add BlocklistSource interface and implementations for fetching blocklist data
- Introduced `BlocklistSource` interface with `Get` method to retrieve IPv4/IPv6 blocklists.
- Added `blocklistSource` and `blocklistSourceZip` structures to support standard and ZIP-configured data sources.
2026-03-19 19:49:21 +05:00
c0573c4e36 Add Config struct for blocklist configuration management
- Introduced `Config` and `SourceConfig` structs to manage blocklist repository and source settings.
2026-03-19 19:48:37 +05:00
8468fe851b Add blocklist implementation for managing IPv4/IPv6 blocklists
- Implemented `Blocklist` interface with methods for replacing blocklist elements and adding rules to chains.
- Added support for both IPv4 and IPv6 address handling.
- Introduced `NewBlocklist` for initializing blocklist instances.
2026-03-19 19:47:13 +05:00
6438358a53 Add ReplaceElements method for batch updating firewall blocklist
- Introduced `ReplaceElements` to allow bulk replacement of blocklist entries.
- Implemented `chunkStrings` helper for batching updates efficiently.
2026-03-19 19:45:38 +05:00
489c5c0cbe Add blocklistBucket for Blocklist handling in repository 2026-03-19 19:35:47 +05:00
7c15813b0e Add Blocklist repository with CRUD operations
- Implemented `Blocklist` entity.
- Introduced `BlocklistRepository` with `Get` and `Update` methods.
- Updated repository interface and initialization to include blocklist handling.
2026-03-19 19:35:19 +05:00
3515b66dc7 Update dependencies: add kor-elf-shield/blocklist v1.1.0. 2026-03-19 19:34:00 +05:00
63bc845b8b Update CHANGELOG.md to set release date for version 0.8.0 2026-03-09 21:26:14 +05:00
a44f9b4e75 Update CHANGELOG.md to fix release date for version 0.7.0 2026-03-09 21:24:25 +05:00
4647d1303e Update CHANGELOG.md to document new kor-elf-shield block delete command for IP unblocking 2026-03-09 21:23:28 +05:00
221fdb8d3b Add command for removing IP addresses from the block list
- Introduced `block delete` command to remove IPs from the block list.
- Added `UnblockIP` method to support IP removal in the firewall.
- Updated internationalization files for delete command descriptions.
- Enhanced repository with `DeleteByIP` for targeted IP removal.
2026-03-09 21:21:28 +05:00
a7e4c7d750 Update CHANGELOG.md to document new kor-elf-shield block add command for IP blocking 2026-03-09 17:47:53 +05:00
75c8eba0cd Add a command to add IP address blocking 2026-03-09 17:45:14 +05:00
bf8711aadd Add support for structured socket commands with JSON and argument parsing
- Introduced `SendCommand` for sending commands with arguments over sockets.
- Updated socket communication to encode/decode commands as JSON.
- Refactored daemon handlers to process commands with arguments.
- Added `Message` struct and `parseCommand` function for improved command handling.
2026-03-09 16:16:50 +05:00
1dbb4d0bff Refactor daemon commands to use newSocket helper for socket initialization. 2026-03-09 12:52:51 +05:00
993f48f541 Rename CmdBlockClear to cmdBlockClear for consistency with Go naming conventions. 2026-03-09 11:08:55 +05:00
286f32b618 Rename kor-elf-shield ban clear command to kor-elf-shield block clear and update CHANGELOG.md. 2026-03-09 11:05:34 +05:00
42e4a8cf40 Rename ban_clear command and related references to block_clear for improved clarity and consistency. 2026-03-09 11:02:49 +05:00
be3861ee6e Update CHANGELOG.md with 0.8.0 release details and added configuration parameters for brute force protection 2026-03-09 11:02:12 +05:00
d0a358a445 Expand analyzer configuration with block type and port settings
- Added support for specifying `block_type` and `ports` in brute force protection groups.
- Enhanced rate limit configuration to override `block_type` and define specific ports for blocking.
- Updated documentation in `analyzer.toml` with examples for new settings.
2026-03-09 10:47:14 +05:00
39cfb8a7b6 Add support for IP and port-based brute force protection
- Introduced `Block` interface to handle IP and port blocking configurations.
- Added `BlockIPWithPorts` functionality for enhanced blocking with ports.
- Enhanced brute force protection to support IP and port-based rules.
- Updated `Blocking` entity and repository for port-specific blocking.
- Added internationalization for port-based brute force notifications.
- Refactored the analyzer to accommodate new block configurations.
2026-03-05 01:10:02 +05:00
65eaa37637 Refactor firewall type handling and port configuration
- Introduced `types` package with structured definitions (`Protocol`, `Action`, `Direction`, `PolicyDrop`, etc.).
- Replaced primitive types for port-related logic with `L4Port` interface for improved encapsulation.
- Updated firewall methods to use `L4Port`, enhancing readability and reducing direct type handling.
- Adjusted validation and configuration logic to leverage new `types`.
2026-03-02 22:20:06 +05:00
b884494250 Update CHANGELOG.md with 0.7.0 release date 2026-02-28 21:36:43 +05:00
598d83d6da Update CHANGELOG.md to include ban clear command information 2026-02-28 21:06:03 +05:00
f737edc3ce Add ban_clear command to unban all blocked IPs via the daemon
- Introduced `ban_clear` CLI command for clearing all banned IPs.
- Implemented `UnblockAllIPs` in the firewall for IP unblocking.
- Added internationalization messages for `ban_clear` actions.
2026-02-28 21:02:43 +05:00
dc85bc759a Add DeleteIP method to remove IPs from firewall lists
- Implemented `DeleteIP` to remove IPv4 and IPv6 addresses.
2026-02-28 21:02:12 +05:00
93b2927da7 Add DeleteElement method to manage firewall list elements
- Implemented `DeleteElement` to remove elements from the list.
- Updated `AddElement` to improve command construction with family inclusion.
2026-02-28 21:01:53 +05:00
afb0773dfd Update CHANGELOG.md with password brute force protection details and link to full settings configuration 2026-02-28 20:23:45 +05:00
187c447301 Reorganize "Plans" section in README files for clarity 2026-02-28 20:19:57 +05:00
3ec6b4c72d Expand brute force protection configuration with groups and rules
- Added support for defining groups with rate limits (`bruteForceProtection.groups`).
- Introduced rule configuration for log monitoring and grouping (`bruteForceProtection.rules`).
- Enhanced `analyzer.toml` with detailed examples and documentation for new settings.
2026-02-28 20:14:44 +05:00
b63e3adbd3 Add support for brute force protection rules and groups
- Introduced `BruteForceProtectionGroup` for managing rate limits and validation.
- Added `BruteForceProtectionRule` for defining protection rules with patterns.
- Updated `BruteForceProtection` to include groups and rules.
- Enhanced `ToSources` to process rules and associate them with defined groups.
2026-02-28 20:14:11 +05:00
aa519c8b44 Remove debug print statement from IP blocking logic 2026-02-28 18:47:16 +05:00
8329da32e3 Add reloadBlockList method to handle block list reloading in the firewall
- Implements `reloadBlockList` to reload IP block lists via `NftReload`.
- Links block lists to chains using `AddRuleToChain`.
2026-02-28 17:50:17 +05:00
833bc394b3 Pass logger to blocking.New in server initialization for improved logging and debugging. 2026-02-28 17:50:01 +05:00
e422bc4206 Add blocking package for IP blocking management
- Introduced `blocking` implementation with methods for managing blocked IPs.
- Added `NftReload` for reloading block lists into the firewall.
- Created `BlockIP` to block specific IPs with expiration and logging support.
- Implemented `ClearDBData` for clearing database blocking entries.
2026-02-28 17:49:39 +05:00
47aa0a9d6c Update BlockIP to return banning status (bool, error) for improved tracking and logging 2026-02-28 17:49:13 +05:00
58dbee450a Refactor BruteForceProtection to improve error handling and notification clarity
- Updated `BlockIPFunc` to return `(bool, error)` for better banning status tracking.
- Enhanced notification messages to include errors and blocked time (`blockSec`).
- Simplified `sendNotifyError` logic by embedding error context in `bruteForceProtectionNotify`.
2026-02-28 17:48:51 +05:00
68034fd6f9 Add before-local-input and after-local-input chains with block list API
- Introduced `NewBeforeLocalInput` and `NewAfterLocalInput` chain methods.
- Added `NewBlockListIP` for creating IP block lists linked to chains.
2026-02-28 17:48:12 +05:00
7b77b8730e Add ListIP interface and implementation for IP block list management in the firewall
- Implemented `NewListIP` for creating IPv4 and IPv6 block lists with timeout support.
- Added methods `AddIP` to add IPs to the lists and `AddRuleToChain` to link block lists to firewall chains.
2026-02-28 17:47:31 +05:00
187e874c29 Add List interface and implementation for managing block lists in the firewall 2026-02-28 17:47:05 +05:00
ee5a6a2d3d Add Reason field to Blocking entity 2026-02-28 17:46:35 +05:00
38283247e9 Simplify List method in BlockingRepository by removing unnecessary bucket creation logic 2026-02-28 17:46:24 +05:00
79c7ef1f91 Add before-local-input and after-local-input chains to enhance firewall rule management
- Implemented `BeforeLocalInput` and `AfterLocalInput` chain structures with rule management methods.
- Integrated chains into `reloadInput` logic for improved rule execution ordering.
2026-02-28 17:43:32 +05:00
e29d0de632 Add blockSec localization and integrate blocked time into notifications
- Added `blockSec` message to English, Kazakh, and Russian locale files.
- Extended `BruteForceProtection` logic to include blocked time (`blockSec`) in notifications.
2026-02-28 12:45:51 +05:00
be082a1841 Fix IP address handling in BruteForceProtectionGroup to prioritize IPv4 over IPv6 2026-02-28 12:13:03 +05:00
4b364cbdf0 Extend daemon stop logic to clear firewall data during testing interval expiration 2026-02-28 11:45:51 +05:00
dfa23bc7a6 Add ClearDBData method to firewall and integrate block list reload logic 2026-02-28 11:45:32 +05:00