egress

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDRsFileContent

func CIDRsFileContent(cidrs []string) string

CIDRsFileContent returns the content of /etc/pixels-egress-cidrs.

func DomainsFileContent

func DomainsFileContent(domains []string) string

DomainsFileContent returns the content of /etc/pixels-egress-domains.

func NftablesConf

func NftablesConf() string

NftablesConf returns the base nftables.conf content.

func PresetCIDRs

func PresetCIDRs(name string) []string

PresetCIDRs returns the CIDR ranges for a named preset. Returns nil if the preset doesn't exist or has no CIDRs.

func PresetDomains

func PresetDomains(name string) []string

PresetDomains returns the domain allowlist for a named preset. Returns nil if the preset doesn't exist.

func ResolveDomains

func ResolveDomains(egress string, allow []string) []string

ResolveDomains returns the final domain list for the given egress mode. Returns nil for "unrestricted".

func ResolveScript

func ResolveScript() string

ResolveScript returns the shell script that reads /etc/pixels-egress-domains and /etc/pixels-egress-cidrs, and populates the nftables allowed_v4 set.

func SafeAptScript

func SafeAptScript() string

SafeAptScript returns a wrapper script that sanitizes apt-get arguments, blocking -o flags (which allow arbitrary command execution via Pre-Invoke) and restricting to safe subcommands.

func SudoersRestricted

func SudoersRestricted() string

SudoersRestricted returns the sudoers content for restricted egress mode.

func SudoersUnrestricted

func SudoersUnrestricted() string

SudoersUnrestricted returns the blanket sudoers content (current behavior).

Types

This section is empty.

Jump to

Keyboard shortcuts

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