Commit Graph
266 Commits
Author SHA1 Message Date
kor-elf a44f9b4e75 Update CHANGELOG.md to fix release date for version 0.7.0 2026-03-09 21:24:25 +05:00
kor-elf 4647d1303e Update CHANGELOG.md to document new kor-elf-shield block delete command for IP unblocking 2026-03-09 21:23:28 +05:00
kor-elf 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
kor-elf a7e4c7d750 Update CHANGELOG.md to document new kor-elf-shield block add command for IP blocking 2026-03-09 17:47:53 +05:00
kor-elf 75c8eba0cd Add a command to add IP address blocking 2026-03-09 17:45:14 +05:00
kor-elf 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
kor-elf 1dbb4d0bff Refactor daemon commands to use newSocket helper for socket initialization. 2026-03-09 12:52:51 +05:00
kor-elf 993f48f541 Rename CmdBlockClear to cmdBlockClear for consistency with Go naming conventions. 2026-03-09 11:08:55 +05:00
kor-elf 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
kor-elf 42e4a8cf40 Rename ban_clear command and related references to block_clear for improved clarity and consistency. 2026-03-09 11:02:49 +05:00
kor-elf 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
kor-elf 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
kor-elf 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
kor-elf 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
kor-elf b884494250 Update CHANGELOG.md with 0.7.0 release date 2026-02-28 21:36:43 +05:00
kor-elf 598d83d6da Update CHANGELOG.md to include ban clear command information 2026-02-28 21:06:03 +05:00
kor-elf 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
kor-elf 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
kor-elf 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
kor-elf afb0773dfd Update CHANGELOG.md with password brute force protection details and link to full settings configuration 2026-02-28 20:23:45 +05:00
kor-elf 187c447301 Reorganize "Plans" section in README files for clarity 2026-02-28 20:19:57 +05:00
kor-elf 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
kor-elf 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
kor-elf aa519c8b44 Remove debug print statement from IP blocking logic 2026-02-28 18:47:16 +05:00
kor-elf 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
kor-elf 833bc394b3 Pass logger to blocking.New in server initialization for improved logging and debugging. 2026-02-28 17:50:01 +05:00
kor-elf 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
kor-elf 47aa0a9d6c Update BlockIP to return banning status (bool, error) for improved tracking and logging 2026-02-28 17:49:13 +05:00
kor-elf 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
kor-elf 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
kor-elf 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
kor-elf 187e874c29 Add List interface and implementation for managing block lists in the firewall 2026-02-28 17:47:05 +05:00
kor-elf ee5a6a2d3d Add Reason field to Blocking entity 2026-02-28 17:46:35 +05:00
kor-elf 38283247e9 Simplify List method in BlockingRepository by removing unnecessary bucket creation logic 2026-02-28 17:46:24 +05:00
kor-elf 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
kor-elf 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
kor-elf be082a1841 Fix IP address handling in BruteForceProtectionGroup to prioritize IPv4 over IPv6 2026-02-28 12:13:03 +05:00
kor-elf 4b364cbdf0 Extend daemon stop logic to clear firewall data during testing interval expiration 2026-02-28 11:45:51 +05:00
kor-elf dfa23bc7a6 Add ClearDBData method to firewall and integrate block list reload logic 2026-02-28 11:45:32 +05:00
kor-elf 3a34569e78 Add Clear method to BlockingRepository and implement bucket reset logic
- Introduced `Clear` to reset the database bucket for the `BlockingRepository`.
- Handled `ErrBucketNotFound` error to allow safe bucket recreation during cleanup.
2026-02-28 11:44:58 +05:00
kor-elf b1f5ce4e9b Add ClearDBData method to Group interface and implement it in group 2026-02-28 11:44:30 +05:00
kor-elf f2d851baa7 Add ClearDBData method to Group interface and implement it in group 2026-02-28 11:44:27 +05:00
kor-elf 2a617b5c17 Invoke ClearDBData in daemon stop logic to clean up analyzer data 2026-02-28 11:37:55 +05:00
kor-elf a648647e4a Add ClearDBData functionality for analysis and repository components
- Introduced `ClearDBData` methods in `Analysis`, `Alert`, and `BruteForceProtection` components.
- Implemented `Clear` operations for `AlertGroupRepository` and `BruteForceProtectionGroupRepository` to reset database buckets.
- Updated `Analyzer` to invoke `ClearDBData` for cleanup logic.
2026-02-28 11:37:25 +05:00
kor-elf 6b482a350b Simplify error handling logic in DBQueueClear during testing interval expiration. 2026-02-28 11:05:56 +05:00
kor-elf 097cf362e3 Add brute force protection core logic and SSH-specific rules
- Integrated brute force protection mechanisms into the analyzer.
- Added `BruteForceProtection` and `BruteForceProtectionGroup` structures with rate-limiting and group-based blocking logic.
- Implemented IP blocking via the firewall service.
- Introduced SSH brute force detection rules and notifications for detected attempts.
- Updated analyzer and firewall services to handle brute force protection rules.
- Localized new brute force protection alert messages.
2026-02-26 00:01:06 +05:00
kor-elf bf7d463930 Expand analyzer.toml with brute force protection settings
- Added configuration options for password brute-force protection, including rate limits, blocking duration, and SSH-specific settings.
- Included detailed parameter descriptions and default values to enhance setup clarity.
2026-02-25 23:58:12 +05:00
kor-elf b49889ef58 Add brute force protection to analyzer settings
- Introduced `BruteForceProtection` structure with validation and default settings.
- Integrated brute force protection logic into `Setting` methods for initialization, validation, and source generation.
- Added group-based brute force rate-limiting functionality with `_default` group included.
2026-02-25 23:57:33 +05:00
kor-elf fd899087d4 Introduce Blocking and BruteForceProtectionGroup entities and repositories
- Added `Blocking` and `BruteForceProtectionGroup` entities with associated logic.
- Implemented `BlockingRepository` for IP blocking management with add, list, and delete-expired functionalities.
- Introduced `BruteForceProtectionGroupRepository` for managing brute force protection groups.
- Updated `Repositories` to include new repositories with `app.db` and `security.db`.
2026-02-25 23:54:38 +05:00
kor-elf 8f254d11c1 Fix incorrect condition for empty rate limits in AlertGroup 2026-02-24 23:05:40 +05:00