Skip to content
TomoriLabPublic

About

NetGuard™ — container network policy enforcement

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NetGuard™

한국어

NetGuard™ — container network policy enforcement

NetGuard applies ingress and egress rules with nftables inside a container’s network namespace. A host administrator manages policies in /etc/netguard. For rootless Docker workloads, the guard runs as root on the host and applies the policy in the workload’s namespace.

Install

For Debian 13, Ubuntu 26.04 LTS and AlmaLinux 10.3, download the package for your architecture from a successful package workflow run. The installation guide includes the APT and DNF commands.

Build from the source directory on Linux with a Rust toolchain that supports the 2024 edition. Live enforcement requires the nft command.

cargo build --release --locked --offline
sudo install -m 0755 target/release/netguard /usr/local/bin/netguard
netguard --version

Create a policy

sudo netguard init
sudo netguard generate network --name api --egress tcp 198.51.100.8 443
netguard list
netguard validate @api

Replace the example IP address with your service’s destination address. The generator writes /etc/netguard/api.policy. Preview the rules with netguard render @api before applying them in the target network namespace. Run netguard --help for the full command list.

Documentation

License

NetGuard is licensed under version 2 of the GNU General Public License (GPL-2.0-only). License text

AI-Generated Code Notice

Parts of this project were created with assistance from AI tools (e.g. large language models). All AI-assisted contributions were reviewed and adapted by maintainers before inclusion. If you need provenance for specific changes, please refer to the Git history and commit messages.

About

NetGuard™ — container network policy enforcement

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages