# chaifeng/ufw-docker

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/chaifeng-ufw-docker).**

6,627 stars · 495 forks · Shell · GPL-3.0

## Links

- GitHub: https://github.com/chaifeng/ufw-docker
- awesome-repositories: https://awesome-repositories.com/repository/chaifeng-ufw-docker.md

## Topics

`debian` `docker` `docker-swarm` `firewall` `linux` `security` `ubuntu` `ufw`

## Description

ufw-docker is a network security tool and firewall manager designed to enforce UFW security policies on Docker container traffic. It functions as a Linux firewall orchestrator that modifies routing and filter rules to prevent container traffic from bypassing system firewall policies via iptables.

The tool provides capabilities for isolated port exposure, allowing specific ports or protocols to be opened for containers without exposing them on the host machine. It also manages network subnet security for IPv4 and IPv6 through automatic detection and custom CIDR ranges.

The system includes automation for refreshing firewall rules when container IP addresses change and provides utilities for auditing and verifying active forwarding rules and security configurations.

## Tags

### Security & Cryptography

- [Firewalls](https://awesome-repositories.com/f/security-cryptography/firewalls.md) — Ensures Docker container traffic obeys UFW firewall rules instead of bypassing them through iptables routing.
- [Security Policy Controllers](https://awesome-repositories.com/f/security-cryptography/security-policy-controllers.md) — Implements a system that enforces UFW security policies on Docker container traffic to prevent firewall bypasses via iptables. ([source](https://github.com/chaifeng/ufw-docker/blob/master/Dockerfile))
- [CIDR-Based](https://awesome-repositories.com/f/security-cryptography/access-restrictions/cidr-based.md) — Automatically detects container network ranges to apply security policies based on CIDR blocks.
- [Container Network Filtering](https://awesome-repositories.com/f/security-cryptography/container-network-filtering.md) — Defines and enforces security policies on network traffic entering and leaving Docker containers.
- [Container Traffic Filters](https://awesome-repositories.com/f/security-cryptography/container-traffic-filters.md) — Manages permitted IPv4 and IPv6 subnets and enables exposing specific container ports without host-level exposure.
- [Docker Firewall Managers](https://awesome-repositories.com/f/security-cryptography/docker-firewall-managers.md) — Enforces UFW security policies on Docker container traffic to prevent the bypass of iptables rules.
- [Bypass Prevention](https://awesome-repositories.com/f/security-cryptography/firewall-configurations/bypass-prevention.md) — Ensures container traffic obeys default security policies instead of using direct routing to bypass the firewall. ([source](https://github.com/chaifeng/ufw-docker#readme))
- [Network Security Tools](https://awesome-repositories.com/f/security-cryptography/network-infrastructure-security/web-network-security/network-security-tools.md) — Modifies routing and filter rules to ensure container network traffic obeys system firewall policies.
- [Network Traffic Filtering](https://awesome-repositories.com/f/security-cryptography/network-traffic-filtering.md) — Ensures container network traffic is filtered and adheres to default system security policies. ([source](https://github.com/chaifeng/ufw-docker/blob/master/README.md))
- [Configuration Auditing](https://awesome-repositories.com/f/security-cryptography/firewall-configurations/configuration-auditing.md) — Validates active forwarding rules against current container configurations to ensure security policy compliance.
- [Firewall Orchestrators](https://awesome-repositories.com/f/security-cryptography/governance-policy-frameworks/security-frameworks/policy-management-systems/dynamic-rule-orchestrators/firewall-orchestrators.md) — Automates firewall reloads and synchronizes security rules across a cluster of container hosts.

### Networking & Communication

- [Firewall-Enforced Routing](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-routing-traffic-management/network-traffic-management/container-traffic-forwarding/firewall-enforced-routing.md) — Routes container traffic through the firewall to prevent network traffic from bypassing system security rules. ([source](https://github.com/chaifeng/ufw-docker/blob/master/Vagrantfile))
- [Interface-Level Packet Filtering](https://awesome-repositories.com/f/networking-communication/packet-capture-filters/interface-level-packet-filtering.md) — Intercepts network traffic at the host interface level to prevent containers from bypassing system security rules.
- [Isolated Container Port Exposures](https://awesome-repositories.com/f/networking-communication/service-port-mapping/workload-port-exposures/isolated-container-port-exposures.md) — Provides a mechanism to expose specific container ports or protocols while preventing them from being accessible on the host machine. ([source](https://github.com/chaifeng/ufw-docker#readme))
- [Container Subnet Management](https://awesome-repositories.com/f/networking-communication/container-subnet-management.md) — Manages network subnet security for IPv4 and IPv6 through automatic detection and custom CIDR ranges for containers. ([source](https://github.com/chaifeng/ufw-docker/blob/master/README.md))

### System Administration & Monitoring

- [Forwarding Chain Modifications](https://awesome-repositories.com/f/system-administration-monitoring/firewall-rule-configurations/custom-rule-chains/forwarding-chain-modifications.md) — Inserts custom routing rules into the iptables forwarding chain to force container traffic through firewall filters.
- [Automatic Rule Refreshers](https://awesome-repositories.com/f/system-administration-monitoring/firewall-rule-configurations/automatic-rule-refreshers.md) — Automatically refreshes firewall rules whenever container IP addresses change following a restart. ([source](https://github.com/chaifeng/ufw-docker/blob/master/README.md))
- [Rule Automation](https://awesome-repositories.com/f/system-administration-monitoring/firewall-rule-configurations/rule-automation.md) — Automatically updates UFW firewall rules when Docker containers restart or change IP addresses.
- [Status Verification](https://awesome-repositories.com/f/system-administration-monitoring/firewall-rule-configurations/status-verification.md) — Lists active filters and forwarding rules for specific containers to verify their current security state. ([source](https://github.com/chaifeng/ufw-docker/blob/master/README.md))

### Development Tools & Productivity

- [Firewall Rule Auditing](https://awesome-repositories.com/f/development-tools-productivity/project-configuration-utilities/configuration-auditing/firewall-rule-auditing.md) — Lists and verifies active forwarding rules and container configurations to ensure security settings are applied correctly. ([source](https://github.com/chaifeng/ufw-docker#readme))
