Documentation
¶
Overview ¶
Package nftables provides nftables integration.
Index ¶
- func ApplyNftRules(allowlist []string, httpsPortStr, httpPortStr, dnsPortStr string) error
- func ApplyNftRulesAuto(allowlist []string, httpsPortStr, httpPortStr string) error
- func ApplyNftRulesWithContext(ctx context.Context, allowlist []string, ...) error
- func GenerateNftRuleset(allowlist []string, httpsPort, httpPort, dnsPort int, mode string) string
- func StreamNfLog() error
- func StreamNfLogWithLogger(ctx context.Context, lg *slog.Logger) error
- func Version(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyNftRules ¶
ApplyNftRules applies nftables rules using a background context.
func ApplyNftRulesAuto ¶
ApplyNftRulesAuto applies nftables rules using port numbers from environment variables or defaults.
func ApplyNftRulesWithContext ¶ added in v0.3.0
func ApplyNftRulesWithContext( ctx context.Context, allowlist []string, httpsPortStr, httpPortStr, dnsPortStr string) error
ApplyNftRulesWithContext generates and applies the nftables ruleset using the provided context.
func GenerateNftRuleset ¶
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 ¶
StreamNfLogWithLogger streams netfilter log events from group 0 using the provided logger until context is done.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.