-
Notifications
You must be signed in to change notification settings - Fork 0
Registry Architecture
Antonios Voulvoulis edited this page Apr 14, 2026
·
1 revision
NFTBan uses a unified registry system to maintain single sources of truth for commands, configuration, and reporting metadata.
┌──────────────────────────────────────────────────────────────────────────────┐
│ NFTBan Registry System │
├──────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ commands.registry │ │ config-registry │ │ reports-registry │ │
│ │ .yml │ │ .json │ │ .json │ │
│ │ │ │ │ │ │ │
│ │ 76 CLI commands │ │ 24 config files │ │ 18 report types │ │
│ │ • categories │ │ • mode activation │ │ • CLI commands │ │
│ │ • RBAC/audience │ │ • runtime checks │ │ • metrics │ │
│ │ • capabilities │ │ • categories │ │ • API endpoints │ │
│ │ • examples │ │ │ │ • delivery methods │ │
│ └─────────────────────┘ └─────────────────────┘ └─────────────────────┘ │
│ │
│ ┌─────────────────────┐ │
│ │ config-schema.json │ │
│ │ │ │
│ │ 960 config keys │ │
│ │ • types/defaults │ │
│ │ • validation rules │ │
│ │ • dependencies │ │
│ └─────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
| Registry | File | Purpose | Count |
|---|---|---|---|
| CLI Commands | commands.registry.yml |
Command definitions, RBAC, capabilities | 76 commands |
| Config Files | cli/lib/nftban/data/config-registry.json |
Config file metadata, mode activation | 24 files |
| Config Schema | cli/lib/nftban/data/config-schema.json |
Key definitions, types, validation | 960 keys |
| Reports | cli/lib/nftban/data/reports-registry.json |
Report types, metrics, delivery | 18 reports |
The commands registry is the single source of truth for all CLI commands.
command_name:
category: setup_discovery | immediate_action | active_protection | ...
description: "Human-readable description"
risk: core | setup | advanced
audience: [cli, auditor, panel]
capability: status_read | stats_read | config_view | enforcement | ...
mutates: true | false | conditional
supports_dry_run: true | false
requires_root: true | false
panel_expose: true | false
output_modes: [json, text]
has_json: true | false
examples:
- "nftban command example"
subcommands:
subname: {mutates: false, description: "..."}| Category | Purpose |
|---|---|
setup_discovery |
Initial setup, health checks, status |
immediate_action |
Ban/unban, whitelist management |
active_protection |
Protection modules (DDoS, portscan, etc.) |
infrastructure |
Feeds, GeoIP, trust management |
intelligence_reporting |
Stats, analytics, reports |
developer_sysadmin |
Debug, maintenance tools |
- cli: Command-line users (full access)
- auditor: Read-only audit/compliance view
- panel: Hosting panel integration (restricted)
-
Auto-generated help:
nftban helpreads from registry -
Man page generation:
tools/generate-man-pages.sh - Wiki documentation: Filter by audience for operator/auditor/panel views
-
RBAC enforcement: Check
capabilitybefore execution - Bash completion: Generate completions from command list
Defines all configuration files with mode-aware activation rules.
- Mode activation: Rules for when config files are active
- Runtime checks: Suricata detection, panel detection
- Categories: system, paths, features, modules, etc.
{
"files": {
"conf.d/ddos/classic.conf": {
"description": "DDoS Classic mode settings",
"category": "modules",
"activation": "ddos_classic",
"required": false
}
}
}Defines all 960 configuration keys with validation rules.
- type: string, integer, boolean, array, etc.
- default: Default value
- validation: Regex, range, enum values
- depends_on: Other keys this depends on
- deprecated: Deprecation info if applicable
Defines all report types with metrics and delivery options.
| Report | Category | CLI Command |
|---|---|---|
| dashboard | on_demand | nftban stats dashboard |
| daily | scheduled | nftban report generate daily |
| weekly | scheduled | nftban report generate weekly |
| health | health | nftban health |
| rbl_status | on_demand | nftban rbl status |
| rbl_watchlist | on_demand | nftban rbl watchlist check |
- stdout: Terminal output
-
filesystem: Save to
/var/lib/nftban/reports/ - email: Send via sendmail/SMTP
- api: JSON via REST API
- prometheus: Metrics export
# Quick syntax validation
nftban health registries
# JSON output for monitoring
nftban health registries --json# Full registry validation via nftban-validator
cd nftban-validator
./scripts/validate_registries.sh ../nftban ./output
# Or run all validations
./scripts/run_all.sh| Check | Description |
|---|---|
| REG-001 | JSON/YAML syntax validation |
| REG-002 | Commands registry required fields |
| REG-003 | Config file existence verification |
| REG-004 | Reports CLI command cross-check |
| REG-005 | Cross-registry consistency |
| REG-006 | Statistics summary |
# Panel-exposed commands
grep -B5 "panel_expose: true" commands.registry.yml | grep "^[a-z]"
# Auditor-visible commands
grep -B10 "auditor" commands.registry.yml | grep "^[a-z]"# RBL config files
jq '.files | to_entries[] | select(.key | startswith("conf.d/rbl"))' \
cli/lib/nftban/data/config-registry.json# Scheduled reports
jq '.report_types | to_entries[] | select(.value.category == "scheduled")' \
cli/lib/nftban/data/reports-registry.json- Single Source of Truth: Always update registry when adding commands
-
Validate Before Commit: Run
nftban health registrieslocally - Keep Synchronized: Registry should match actual implementation
- Document Examples: Include practical examples in registry entries
- Use Categories: Proper categorization aids discovery and documentation
- CLI-Commands-Reference - Full command documentation
- Configuration-Reference - All configuration keys
- Health-Check-Guide - System diagnostics
NFTBan Wiki
Getting Started
Architecture
Modules
- BotGuard (HTTP L7)
- DDoS Protection (L3/L4)
- Portscan Detection
- Login Monitoring
- Blacklist & Threat Intelligence
- Suricata IDS Integration
- DNS Tunnel Suspicion
Operator Reference
- CLI Commands Reference
- Configuration Reference
- Systemd Units & Timers
- Optimization & Tuning
- Security Operations Guide
- GeoIP Database Guide
- FHS Compliance
- Troubleshooting: Smoke & Selftest
Verification & Trust
- Glossary & Vocabulary
- Known Limitations
- Metrics & Evidence Model
- Binary Verification (SLSA)
- Security Architecture
Reference
Legal