nftables

package
v0.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package nftables provides nftables integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNftRules

func ApplyNftRules(allowlist []string, httpsPortStr, httpPortStr, dnsPortStr string) error

ApplyNftRules validates and applies nftables rules for the specified filter mode and ports.

func ApplyNftRulesAuto

func ApplyNftRulesAuto(allowlist []string, httpsPortStr, httpPortStr string) error

ApplyNftRulesAuto applies nftables rules using port numbers from environment variables or defaults.

func GenerateNftRuleset

func GenerateNftRuleset(allowlist []string, httpsPort, httpPort, dnsPort int, mode string) string

GenerateNftRuleset generates a complete nftables ruleset for the specified mode, ports, and allowlist.

func StreamNfLog

func StreamNfLog() error

StreamNfLog starts streaming netfilter log events using the default logger.

func StreamNfLogWithLogger

func StreamNfLogWithLogger(ctx context.Context, lg *slog.Logger) error

StreamNfLogWithLogger streams netfilter log events from group 0 using the provided logger until context is done.

func Version added in v0.2.11

func Version(ctx context.Context) (string, error)

Version returns the nftables version string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL