Skip to content

Commit 2948312

Browse files
authored
Update README.md
1 parent 111bbeb commit 2948312

1 file changed

Lines changed: 35 additions & 24 deletions

File tree

README.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</p>
1717

1818
<p align="center">
19-
<img src="https://img.shields.io/badge/version-1.1.5-blue?style=flat-square" alt="Version 1.1.5">
19+
<img src="https://img.shields.io/badge/version-1.1.10-blue?style=flat-square" alt="Version 1.1.10">
2020
<img src="https://img.shields.io/badge/shell-bash%204.0%2B-4EAA25?style=flat-square&logo=gnubash&logoColor=white" alt="Bash 4.0+">
2121
<img src="https://img.shields.io/badge/platform-linux-FCC624?style=flat-square&logo=linux&logoColor=black" alt="Linux">
2222
<img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License">
@@ -26,7 +26,7 @@
2626
<p align="center">
2727
<img src="https://img.shields.io/badge/ShellCheck-passing-7B68EE?style=flat-square&logo=gnubash&logoColor=white" alt="ShellCheck">
2828
<img src="https://img.shields.io/badge/CI-passing-brightgreen?style=flat-square&logo=githubactions&logoColor=white" alt="CI Tests">
29-
<img src="https://img.shields.io/badge/BATS-375%20tests-blue?style=flat-square" alt="375 BATS Tests">
29+
<img src="https://img.shields.io/badge/BATS-380%20tests-blue?style=flat-square" alt="380 BATS Tests">
3030
<img src="https://img.shields.io/badge/security-48%20CWE%20checks-blueviolet?style=flat-square" alt="48 CWE Checks">
3131
</p>
3232

@@ -338,17 +338,20 @@ chmod +x apotropaios.sh
338338
sudo ./apotropaios.sh detect
339339

340340
# 3. Launch the interactive menu
341-
sudo ./apotropaios.sh
341+
sudo ./apotropaios.sh --interactive
342342

343343
# Or use the CLI directly:
344344
sudo ./apotropaios.sh add-rule --dst-port 443 --action accept --protocol tcp
345345
sudo ./apotropaios.sh list-rules
346346
sudo ./apotropaios.sh backup pre-deploy
347347
```
348348

349-
**Interactive menu**: Running with no arguments (or `menu`) launches a guided, 7-category menu-driven interface with validated input, cancel support, and per-backend configuration submenus.
349+
**Two operation modes:**
350350

351-
**Direct CLI**: All 17 commands work directly — `add-rule`, `remove-rule`, `list-rules`, `backup`, `restore`, `import`, `export`, etc. Every command supports `--help` for detailed usage. Full CLI reference in the [Usage Guide](docs/USAGE_GUIDE.md).
351+
- **Interactive mode** (`--interactive`): Launches the guided, 7-category menu-driven interface with validated input, cancel support, and per-backend configuration submenus. Recommended for first-time users and complex multi-step operations.
352+
- **CLI mode** (`COMMAND [OPTIONS]`): Direct command execution for scripting, automation, and advanced users. All 17 commands support `--help` for detailed usage.
353+
354+
**Backward compatibility**: Running with no arguments or the `menu` subcommand also launches the interactive menu.
352355

353356
**Alternative install methods**: See [SETUP_GUIDE.md](docs/SETUP_GUIDE.md) for system-wide installation via `make install`, configuration file setup, and first-run instructions.
354357

@@ -521,16 +524,18 @@ sudo ./apotropaios.sh status # Backend service status
521524
sudo ./apotropaios.sh system-rules # Raw rules (iptables -L, nft list, etc.)
522525
```
523526

524-
### menu
527+
### menu / --interactive
525528

526-
Launch the interactive menu-driven interface. This is the default command when no arguments are provided.
529+
Launch the interactive menu-driven interface. The `--interactive` flag provides explicit separation between interactive and CLI operation modes.
527530

528531
```bash
529-
sudo ./apotropaios.sh menu
530-
sudo ./apotropaios.sh # Same — menu is the default
532+
sudo ./apotropaios.sh --interactive # Preferred — explicit interactive mode
533+
sudo ./apotropaios.sh --interactive --backend iptables # Pre-select backend
534+
sudo ./apotropaios.sh menu # Backward compatible subcommand
535+
sudo ./apotropaios.sh # Backward compatible (no args)
531536
```
532537

533-
The menu provides seven categories: Firewall Management, Rule Management, Quick Actions, Backup & Recovery, System Information, Install & Update, and Help & Documentation.
538+
The `--interactive` flag is mutually exclusive with CLI commands and `--non-interactive`. The menu provides seven categories: Firewall Management, Rule Management, Quick Actions, Backup & Recovery, System Information, Install & Update, and Help & Documentation.
534539

535540
<p align="right">(<a href="#table-of-contents">back to top</a>)</p>
536541

@@ -542,9 +547,10 @@ These options are available on all commands:
542547

543548
| Option | Description |
544549
|--------|-------------|
550+
| `--interactive` | Launch the interactive menu-driven interface (mutually exclusive with commands and `--non-interactive`) |
545551
| `--backend <NAME>` | Select firewall backend: iptables, nftables, firewalld, ufw, ipset |
546552
| `--log-level <LEVEL>` | Set log verbosity: trace, debug, info, warning, error, critical |
547-
| `--non-interactive` | Suppress interactive prompts (for scripting) |
553+
| `--non-interactive` | Suppress interactive prompts (for scripting/automation; mutually exclusive with `--interactive`) |
548554
| `-v, --version` | Show version string and exit |
549555
| `-h, --help` | Show context-sensitive help (global or per-command) |
550556

@@ -636,9 +642,9 @@ The framework provides three levels of configuration protection:
636642
3. **Immutable snapshots**: `chattr +i` protected files that cannot be modified or deleted without explicit unlock
637643

638644
```bash
639-
sudo ./apotropaios.sh backup pre-deploy # Create labeled backup
640-
sudo ./apotropaios.sh backup # Create timestamped backup
641-
sudo ./apotropaios.sh restore # Restore from latest
645+
sudo ./apotropaios.sh backup pre-deploy # Create labeled backup
646+
sudo ./apotropaios.sh backup # Create timestamped backup
647+
sudo ./apotropaios.sh restore # Restore from latest
642648
sudo ./apotropaios.sh restore specific.tar.gz # Restore from specific backup
643649
```
644650

@@ -720,13 +726,13 @@ apotropaios/ # Repository root
720726
│ ├── install/
721727
│ │ └── installer.sh # Package installation across pkg managers
722728
│ └── menu/ # Layer 5: User Interface (2 modules)
723-
│ ├── menu_main.sh # 7-category interactive menu + rule wizard
729+
│ ├── menu_main.sh # 7-category menu, wizard, expiry monitor
724730
│ └── help_system.sh # 17 per-command help pages
725-
├── tests/ # BATS test suite (375 tests, 13 files)
731+
├── tests/ # BATS test suite (380 tests, 13 files)
726732
│ ├── helpers/test_helper.bash # Shared setup/teardown
727733
│ ├── fixtures/ # Test data (sample rules, invalid configs)
728734
│ ├── unit/ # 234 tests across 8 files
729-
│ ├── integration/ # 93 tests across 4 files
735+
│ ├── integration/ # 98 tests across 4 files
730736
│ └── security/ # 48 CWE-mapped tests
731737
├── .github/
732738
│ ├── workflows/ci.yml # 6-stage CI: lint, security, tests, 5-distro matrix
@@ -814,10 +820,10 @@ sudo ./apotropaios.sh detect # Test with detect command
814820

815821
### "Invalid option" in the interactive menu
816822

817-
Ensure you are running version 1.1.5 or later. Earlier versions had a sanitization bug (BUG-010) that caused all menu input to be rejected:
823+
Ensure you are running version 1.1.10 or later. Earlier versions had a sanitization bug (BUG-010) that caused all menu input to be rejected:
818824

819825
```bash
820-
sudo ./apotropaios.sh --version # Should show v1.1.5+
826+
sudo ./apotropaios.sh --version # Should show v1.1.10+
821827
```
822828

823829
### "Root privileges required"
@@ -857,7 +863,7 @@ Check directory permissions and disk space:
857863

858864
```bash
859865
ls -la data/logs/ # Check permissions
860-
df -h # Check disk space
866+
df -h # Check disk space
861867
sudo ./apotropaios.sh --log-level trace detect # Maximum diagnostic detail
862868
```
863869

@@ -869,7 +875,7 @@ For additional troubleshooting scenarios, see the [Wiki Troubleshooting Guide](d
869875

870876
## Testing
871877

872-
The project includes a comprehensive test suite built on [BATS](https://github.com/bats-core/bats-core) (Bash Automated Testing System) with 375 tests covering validation, security, lifecycle, CLI, help system, and backup operations.
878+
The project includes a comprehensive test suite built on [BATS](https://github.com/bats-core/bats-core) (Bash Automated Testing System) with 380 tests covering validation, security, lifecycle, CLI, help system, and backup operations.
873879

874880
```bash
875881
# Run the full test suite (lint + all tests)
@@ -927,7 +933,7 @@ Contributions are welcome and appreciated. To contribute:
927933

928934
### Guidelines
929935

930-
- Run `make test` before submitting — all 375 tests must pass
936+
- Run `make test` before submitting — all 380 tests must pass
931937
- Run `make lint` — ShellCheck must report no warnings
932938
- Run `make security-scan` — no new warnings introduced
933939
- Follow the existing code style: comprehensive function documentation headers (Synopsis, Description, Parameters, Returns), inline comments explaining non-obvious logic, and consistent formatting
@@ -967,7 +973,12 @@ For the complete development guide including environment setup, test architectur
967973

968974
| Version | Date | Changes |
969975
|---------|------|---------|
970-
| **1.1.5** | 2026-03-27 | Security audit: 10 findings resolved (compound removal, flock locking, whitelist sanitization, log masking expansion, nft -f removal, eval elimination). 375 tests. |
976+
| **1.1.10** | 2026-03-29 | Background expiry monitor (30s interval, auto-deactivation). Proactive terminal alerts at 10-minute mark. Inline expiry warnings on main menu. |
977+
| **1.1.9** | 2026-03-29 | Firewalld status shows all zones. Zone selector rewritten (nameref, no subshell hang). UFW port-less rule fix. Improved error logging across firewalld and ufw. |
978+
| **1.1.8** | 2026-03-28 | Firewalld full zone support (dynamic zone selection, all-zone reset, zone-aware config submenu). Iptables table selection in config submenu. |
979+
| **1.1.7** | 2026-03-28 | Bug fixes: immutable verify false positive, rule confirmation invisible, firewalld rich rule protocol, expired rules message. Rule wizard cancel support. |
980+
| **1.1.6** | 2026-03-28 | `--interactive` flag for explicit menu mode. ShellCheck compliance (7 fixes). CI Node.js 24 migration. Security scan refinement. Packaging expansion (dist-venv, release). 380 tests. |
981+
| **1.1.5** | 2026-03-27 | Security audit: 10 findings resolved (compound removal, flock locking, whitelist sanitization, log masking expansion, nft -f removal, eval elimination). |
971982
| **1.1.4** | 2026-03-25 | Critical startup fix (PATTERN_SHELL_META portability). Security test suite (48 CWE tests). CI/CD pipeline. Community files. |
972983
| **1.1.3** | 2026-03-24 | Compound actions (`log,drop`). Connection tracking. Rate limiting. Enhanced UFW config. CLI flags for all new options. |
973984
| **1.1.2** | 2026-03-24 | Crash fixes (menu options 4-8). Backend config submenus for ipset, iptables, nftables, firewalld, ufw. |
@@ -1050,7 +1061,7 @@ This software is intended for authorized systems administration, network securit
10501061
sudo ./apotropaios.sh detect # System scan
10511062
sudo ./apotropaios.sh --log-level trace detect # Maximum diagnostic detail
10521063
sudo ./apotropaios.sh --version # Check version
1053-
bash --version # Check bash version
1064+
bash --version # Check bash version
10541065
```
10551066

10561067
<p align="right">(<a href="#table-of-contents">back to top</a>)</p>

0 commit comments

Comments
 (0)