Commit Graph

93 Commits

Author SHA1 Message Date
bbaf0304c3 Merge pull request 'v0.3.0' (#3) from develop into main
Reviewed-on: #3
v0.3.0
2026-01-04 17:09:39 +05:00
1f8be77ab3 Clarify Docker support status in English README 2026-01-04 16:39:21 +05:00
d2795639da Update Russian README: reorder sections and clarify Docker support status 2026-01-04 16:39:08 +05:00
8638c49886 Add "Requirements" section to English README 2026-01-04 16:37:16 +05:00
66e6bad111 Add system requirements section to README 2026-01-04 16:37:06 +05:00
1a6d6b813b Update CHANGELOG.md with release date for version 0.3.0 2026-01-04 16:36:36 +05:00
9b8d07ccb3 Fix typo in CHANGELOG.md: correct WantedBy target from sysinit.target to multi-user.target 2026-01-04 16:20:05 +05:00
4b8622a870 Update CHANGELOG.md with partial Docker support details for version 0.3.0 2026-01-04 16:19:30 +05:00
b9719f7eaf Add Docker event monitoring and chain clearing functionality
- Introduced `Events` method in Docker client to stream and handle Docker events.
- Added `Clear` method to nftables chain interface for clearing rules.
- Enhanced daemon lifecycle to include Docker event monitoring when Docker support is enabled.
- Updated nftables rule management with event-driven chain clearing and reloading.
2026-01-04 16:06:01 +05:00
c424621615 Add Docker support with nftables integration
- Introduced Docker monitoring to manage nftables rules.
- Added `docker_support` option to firewall configuration.
- Integrated Docker bridge, container handling, and related network rules.
- Updated default configurations for Docker path and settings.
- Enhanced `daemon` lifecycle for Docker integration.
2026-01-04 13:59:26 +05:00
865f12d966 Update dependencies: bump go-nftables-client to v0.1.1 and make go-mail a direct dependency 2026-01-01 22:06:50 +05:00
b3a94855b8 Refactor localOutput receiver names for consistency in AddRule and AddRuleOut methods 2026-01-01 20:28:54 +05:00
4d001a026c Refactor localInput receiver names for consistency in AddRule and AddRuleIn methods 2026-01-01 20:28:37 +05:00
6e4bd17bfe Update CHANGELOG.md to include new configuration files notifications.toml and analyzer.toml 2025-12-31 23:14:09 +05:00
0bcdb7bcc7 Update LICENSE-3RD-PARTY.txt to include go-mail dependency and its MIT license details 2025-12-31 23:05:56 +05:00
5f2d5a1a9e Simplify EmptyAnalysis.Process by ignoring unused parameter 2025-12-31 23:01:20 +05:00
542f7415b7 Update CHANGELOG.md with email notification and SSH login notification details for version 0.3.0 2025-12-31 22:58:25 +05:00
8615c79f12 Refactor log analyzer to support SSH login detection
- Moved `Entry` type to `analysis` package for better organization.
- Introduced `SSH` analysis service to detect and notify about SSH logins.
- Added notification and logging for detected SSH login events.
2025-12-31 22:52:12 +05:00
b5686a2ee6 Add systemd log integration for analyzer service
- Implemented `systemd` log monitoring using `journalctl`.
- Added `BinPath` configuration for specifying binary paths.
- Introduced `ssh` unit monitoring for authorization tracking.
- Updated analyzer lifecycle to integrate log processing.
- Enhanced validation for `journalctl` path in settings.
- Updated default configurations with `journalctl` path.
2025-12-30 20:57:35 +05:00
e78685c130 Add support for analyzer service and configuration
- Introduced `analyzer` service for log parsing and authorization tracking.
- Added dedicated analyzer configuration via `analyzer.toml`.
- Integrated analyzer setup and lifecycle management into daemon runtime.
- Enhanced `setting` package to include analyzer settings parsing and validation.
- Updated daemon options to support analyzer configuration.
- Extended default configuration files for analyzer settings.
2025-12-30 15:03:41 +05:00
74dce294bf Add support for email notifications
- Introduced email notifications enabling configuration via `notifications.toml`.
- Created notification handling within `internal/daemon/notifications`.
- Added async email queue with error handling and customizable TLS configurations.
- Integrated notifications setup and validation into the daemon runtime.
2025-12-16 19:30:18 +05:00
6929ac9bf5 Update systemd service file for kor-elf-shield to improve reliability
- Added `Restart=on-failure` with a 10-second delay.
- Changed `WantedBy` target to `multi-user.target`.
- Defined service type as `simple`.
2025-12-08 23:19:38 +05:00
69157c90cb Merge pull request 'v0.2.0' (#2) from develop into main
Reviewed-on: #2
v0.2.0
2025-11-29 16:12:03 +05:00
7054efd359 Update CHANGELOG.md with release date for version 0.2.0 2025-11-29 15:41:12 +05:00
57948fb639 Add support for chain priority configuration in nftables
- Introduced `input_priority`, `output_priority`, and `forward_priority` options in `firewall.toml`.
- Updated `chains` and chain creation functions to include priority handling.
- Added validation for priority values to ensure they remain within the acceptable range (-50 to 50).
- Adjusted `reloadInput`, `reloadOutput`, and `reloadForward` to respect priority settings.
2025-11-29 15:38:58 +05:00
6e7b6093f1 Add support for clear_mode option to toggle nftables clearing behavior
- Introduced `clear_mode` parameter in `firewall.toml` with options for clearing all nftables rules (`global`) or table-specific rules (`own`).
- Updated `chains` and `firewall` logic to respect `clear_mode` configuration.
- Enhanced `options` parsing and validation for `clear_mode`.
- Updated `CHANGELOG.md` to reflect the addition of `clear_mode`.
2025-11-25 20:58:12 +05:00
e76d2ae398 Merge pull request 'v0.1.0' (#1) from develop into main
Reviewed-on: #1
v0.1.0
2025-11-08 17:34:06 +05:00
ba4d026642 Add initial CHANGELOG.md with version 0.1.0 release notes 2025-11-08 15:14:12 +05:00
3c01301fbf Add English version of README with detailed project overview and setup instructions 2025-11-08 15:13:54 +05:00
8cb5563361 Add initial README.md with project overview and setup instructions 2025-11-08 15:13:38 +05:00
e7035cffb8 Add systemd service file for kor-elf-shield 2025-11-08 15:13:10 +05:00
30e48f46a2 Add logrotate configuration for kor-elf-shield logs 2025-11-08 15:12:46 +05:00
6a310bca22 Fix typo in comment within kor-elf-shield.toml configuration 2025-11-08 14:31:14 +05:00
1398735070 Corrected typos 2025-11-08 14:30:38 +05:00
a5394a2aa1 Move configuration files to assets/configs directory 2025-11-04 19:12:56 +05:00
c305feac4a There was a typo in ConfigPath .conf, it should be .toml 2025-11-04 19:12:36 +05:00
e409d458f8 Add third-party licenses file
- Added `LICENSE-3RD-PARTY.txt` containing licenses for dependencies used in the project.
2025-11-02 22:57:17 +05:00
859e7ad4da Add "reopen_logger" command to daemon for log file management
- Introduced `CmdReopenLogger` for reopening daemon log files.
- Added `ReOpen` method to `Logger` interface and its implementations.
- Updated daemon logic to handle the "reopen_logger" command via Unix socket communication.
- Extended localization files with translations for new command messages.
- Registered `CmdReopenLogger` in the main CLI application.
2025-11-02 22:41:39 +05:00
85d55bc262 Improve error message when daemon is not running in stop command 2025-11-02 21:10:49 +05:00
d9cfecfb1e Add "status" command to daemon for runtime health checking
- Introduced `CmdStatus` command to verify if the daemon is running via Unix socket communication.
- Updated daemon logic to handle the "status" command and respond accordingly.
- Extended localization files with translations for status command messages.
- Registered `CmdStatus` in the main CLI application.
2025-11-02 21:10:27 +05:00
c8a0df90c2 Add "stop" command to daemon with Unix socket communication
- Introduced a `CmdStop` command for stopping the daemon, clearing nftables firewall rules.
- Implemented `NewSocketClient` in `internal/socket/socket.go` for Unix socket interaction.
- Updated daemon logic to handle the "stop" command via socket communication.
- Extended localization files with translations for stop command messages.
2025-11-02 20:59:15 +05:00
1183dde0f4 Refactor socket handling logic to use Connect interface abstraction
- Introduced `Connect` interface with methods for `Read`, `Write`, and `Close`.
- Added `connect` struct as an implementation of `Connect` for `net.Conn`.
- Updated command handling to use `Connect` abstraction, improving modularity and testability.
- Renamed `handleConn` to `handleAction` for better clarity.
2025-11-02 20:24:12 +05:00
0e3e8cf169 Handle closed network connection error in socket handling
- Added `isUseOfClosedNetworkError` function to identify specific "use of closed network connection" errors.
- Updated socket handling logic in `Run` method to gracefully handle closed connection errors with improved debug logging.
2025-11-02 17:42:01 +05:00
51ffb17bed Log service stop action in daemon for better traceability 2025-11-02 17:41:06 +05:00
6b11626376 Remove unused variable err in runDaemon function 2025-11-02 16:32:08 +05:00
e6f2d9108f Add Unix socket support to daemon
- Introduced `Socket` interface and implementation in `internal/daemon/socket/socket.go`.
- Added socket file management (`EnsureNoOtherProcess`, `Create`, `Close`) and command handling via `Run`.
- Updated `DaemonOptions` and configuration to include `socket_file` path.
- Integrated socket lifecycle into daemon's `Run` method for process communication.
- Added validation and default configuration for `socket_file` in `setting` package.
2025-11-02 16:15:57 +05:00
f81085dec2 Reorganize imports in main.go for better readability 2025-11-02 14:52:22 +05:00
a978518afa Refine comment in pidfile.go for clarity. 2025-11-02 14:04:07 +05:00
453aa2d20c Improve port validation error message
- Replaced generic error message with a formatted message specifying the parameter name for better clarity.
2025-11-02 00:31:14 +05:00
b9bd3edb9c Add IP-based traffic control to firewall configuration
- Introduced `IP` struct for managing IP-based rules, including fields for IPs, actions, directions, protocols, ports, and rate limits.
- Added methods to process IP configurations into `InIPs` and `OutIPs`.
- Extended reload methods for input and output to include IP-based rule handling.
- Updated `firewall.toml` with IP configuration examples and detailed documentation.
- Enhanced validation logic for IP-based settings to ensure proper configuration.
2025-11-02 00:30:17 +05:00