Documentation
¶
Overview ¶
Package nftban is a system-level nftables IPS firewall.
NFTBan is a production firewall product consisting of a daemon (nftband), CLI engine (nftban-core), and shell framework. It is NOT a general-purpose Go library or embeddable SDK.
For Go Developers ¶
If you want to interact with a running NFTBan daemon from Go code, use the IPC client package:
import "github.com/itcmsgr/nftban/pkg/ipc"
client := ipc.NewClient()
resp, err := client.Ban("192.168.1.100", 0, "reason", "source")
All other packages are internal implementation details and should not be imported directly. They may change without notice between releases.
Product Documentation ¶
For installation, configuration, and usage documentation, visit: https://github.com/itcmsgr/nftban/wiki
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
nftban-core
command
|
|
|
nftban-installer
command
============================================================================= NFTBan v1.75 - nftban-installer - CLI flag parsing ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="nftban-installer-flags" meta:type="cmd" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="CLI flag definitions and environment variable overrides" meta:inventory.files="cmd/nftban-installer/flags.go" meta:inventory.binaries="" meta:inventory.env_vars="NFTBAN_TAKEOVER, NFTBAN_INSTALLER_LOG" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
|
============================================================================= NFTBan v1.75 - nftban-installer - CLI flag parsing ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="nftban-installer-flags" meta:type="cmd" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="CLI flag definitions and environment variable overrides" meta:inventory.files="cmd/nftban-installer/flags.go" meta:inventory.binaries="" meta:inventory.env_vars="NFTBAN_TAKEOVER, NFTBAN_INSTALLER_LOG" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" ============================================================================= |
|
nftban-ui
command
|
|
|
nftban-ui-auth
command
|
|
|
nftband
command
|
|
|
internal
|
|
|
analytics
Package analytics provides efficient batch operations for report generation
|
Package analytics provides efficient batch operations for report generation |
|
api
Package api provides HTTP handlers for the NFTBan web interface and REST API.
|
Package api provides HTTP handlers for the NFTBan web interface and REST API. |
|
authproto
Package authproto defines shared authentication protocol types Used by both pkg/auth and cmd/nftban-ui-auth to ensure consistency
|
Package authproto defines shared authentication protocol types Used by both pkg/auth and cmd/nftban-ui-auth to ensure consistency |
|
banlog
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com>
|
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com> |
|
constants
============================================================================= NFTBan v1.29.0 - Centralized Timeout & Interval Constants ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="constants/timeouts" meta:type="package" meta:version="1.0.0" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:description="Centralized timeout, interval, and duration constants" meta:inventory.files="timeouts.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
|
============================================================================= NFTBan v1.29.0 - Centralized Timeout & Interval Constants ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="constants/timeouts" meta:type="package" meta:version="1.0.0" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:description="Centralized timeout, interval, and duration constants" meta:inventory.files="timeouts.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" ============================================================================= |
|
feeds
Package feeds handles threat intelligence feed processing for NFTBan.
|
Package feeds handles threat intelligence feed processing for NFTBan. |
|
installer/authority
============================================================================= NFTBan v1.73 - Installer Authority Classification ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-authority-classify" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Authority decision tree: UPDATE/TAKEOVER/FRESH/ABORT" meta:inventory.files="internal/installer/authority/classify.go" meta:inventory.binaries="" meta:inventory.env_vars="NFTBAN_TAKEOVER" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Authority Classification ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-authority-classify" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Authority decision tree: UPDATE/TAKEOVER/FRESH/ABORT" meta:inventory.files="internal/installer/authority/classify.go" meta:inventory.binaries="" meta:inventory.env_vars="NFTBAN_TAKEOVER" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/detect
============================================================================= NFTBan v1.73 - Installer Conflict Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-conflicts" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Conflicting firewall detection (services + ghost nft tables)" meta:inventory.files="internal/installer/detect/conflicts.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Conflict Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-conflicts" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Conflicting firewall detection (services + ghost nft tables)" meta:inventory.files="internal/installer/detect/conflicts.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/executor
============================================================================= NFTBan v1.73 - Installer Executor Interface ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-executor" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Executor interface abstracting system commands for testability" meta:inventory.files="internal/installer/executor/executor.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Executor Interface ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-executor" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Executor interface abstracting system commands for testability" meta:inventory.files="internal/installer/executor/executor.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" ============================================================================= |
|
installer/fhs
============================================================================= NFTBan v1.73 - Installer FHS Path Constants ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-fhs-paths" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="FHS-compliant path constants matching fhs-spec.yaml" meta:inventory.files="internal/installer/fhs/paths.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer FHS Path Constants ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-fhs-paths" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="FHS-compliant path constants matching fhs-spec.yaml" meta:inventory.files="internal/installer/fhs/paths.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" ============================================================================= |
|
installer/history
============================================================================= NFTBan v1.73 - Installer Update History Writer ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-history" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="JSON update history compatible with nftban update history --json" meta:inventory.files="internal/installer/history/history.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/lib/nftban/update-history.json" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Update History Writer ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-history" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="JSON update history compatible with nftban update history --json" meta:inventory.files="internal/installer/history/history.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/lib/nftban/update-history.json" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/logging
============================================================================= NFTBan v1.73 - Installer Dual Logger ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-logger" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Dual console+file logger for installer output" meta:inventory.files="internal/installer/logging/logger.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/log/nftban/installer.log" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Dual Logger ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-logger" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Dual console+file logger for installer output" meta:inventory.files="internal/installer/logging/logger.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/log/nftban/installer.log" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/render
============================================================================= NFTBan v1.73 - Installer Config Persistence ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-render-config" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Persist SSH port and config values to conf.local and state" meta:inventory.files="internal/installer/render/config.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/etc/nftban/nftban.conf.local" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Config Persistence ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-render-config" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Persist SSH port and config values to conf.local and state" meta:inventory.files="internal/installer/render/config.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/etc/nftban/nftban.conf.local" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/services
============================================================================= NFTBan v1.73 - Installer Stale File Cleanup ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-services-cleanup" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Remove stale files, polkit rules, and legacy units from prior versions" meta:inventory.files="internal/installer/services/cleanup.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Stale File Cleanup ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-services-cleanup" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Remove stale files, polkit rules, and legacy units from prior versions" meta:inventory.files="internal/installer/services/cleanup.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/state
============================================================================= NFTBan v1.73 - Installer State File I/O ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-state-file" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="State file struct, atomic write, read, transition persistence" meta:inventory.files="internal/installer/state/file.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/lib/nftban/state/install_state" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer State File I/O ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-state-file" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="State file struct, atomic write, read, transition persistence" meta:inventory.files="internal/installer/state/file.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/var/lib/nftban/state/install_state" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/switchop
============================================================================= NFTBan v1.75.1 - Installer nftables Service Enable ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-switchop-enable" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Enable and start nftables service with xt-compat pre-check" meta:inventory.files="internal/installer/switchop/enable.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="nftables.service" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.75.1 - Installer nftables Service Enable ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-switchop-enable" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Enable and start nftables service with xt-compat pre-check" meta:inventory.files="internal/installer/switchop/enable.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="nftables.service" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
installer/validate
============================================================================= NFTBan v1.73 - Installer Post-Install Assertions ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-validate-assertions" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Post-install kernel + service + state assertions" meta:inventory.files="internal/installer/validate/assertions.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
|
============================================================================= NFTBan v1.73 - Installer Post-Install Assertions ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-validate-assertions" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Post-install kernel + service + state assertions" meta:inventory.files="internal/installer/validate/assertions.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" ============================================================================= |
|
logx
Package logx provides structured logging wrappers for NFTBan This centralizes log prefixes and makes future enhancements (JSON logs, levels) easier
|
Package logx provides structured logging wrappers for NFTBan This centralizes log prefixes and makes future enhancements (JSON logs, levels) easier |
|
metrics
Package metrics provides efficient metrics collection for NFTBan This collector replaces slow bash-based metrics with fast Go implementation
|
Package metrics provides efficient metrics collection for NFTBan This collector replaces slow bash-based metrics with fast Go implementation |
|
netutil
Package netutil provides network utility functions for NFTBan Centralizes IP address handling, whitelist checking, and CIDR operations
|
Package netutil provides network utility functions for NFTBan Centralizes IP address handling, whitelist checking, and CIDR operations |
|
nftbackend
Package nftbackend provides the core interface to nftables operations.
|
Package nftbackend provides the core interface to nftables operations. |
|
safeconv
Package safeconv provides safe integer conversion functions that check bounds before converting between integer types, preventing silent overflow bugs.
|
Package safeconv provides safe integer conversion functions that check bounds before converting between integer types, preventing silent overflow bugs. |
|
safety
Package safety provides protection mechanisms to prevent self-lockout and ensure system stability during firewall operations.
|
Package safety provides protection mechanisms to prevent self-lockout and ensure system stability during firewall operations. |
|
session
Package session provides simple in-memory session management for nftban-ui.
|
Package session provides simple in-memory session management for nftban-ui. |
|
setsync
Package setsync provides efficient synchronization of IP sets with nftables.
|
Package setsync provides efficient synchronization of IP sets with nftables. |
|
system
Package system provides unified system lookup utilities
|
Package system provides unified system lookup utilities |
|
testutil
Package testutil provides shared test utilities and fixtures for NFTBan tests.
|
Package testutil provides shared test utilities and fixtures for NFTBan tests. |
|
timeutil
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com>
|
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com> |
|
util
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com>
|
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 Antonios Voulvoulis <contact@nftban.com> |
|
watchdog
============================================================================= NFTBan v1.0 - Dynamic Watchdog Package ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="doc" meta:type="package" meta:version="1.0.0" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:description="Package documentation for NFTBan watchdog system" meta:inventory.files="" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
|
============================================================================= NFTBan v1.0 - Dynamic Watchdog Package ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="doc" meta:type="package" meta:version="1.0.0" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:description="Package documentation for NFTBan watchdog system" meta:inventory.files="" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" ============================================================================= |
|
pkg
|
|
|
ipc
Package ipc provides inter-process communication for the NFTBan daemon architecture.
|
Package ipc provides inter-process communication for the NFTBan daemon architecture. |
Click to show internal directories.
Click to hide internal directories.