Skip to content

Commit 5e9dd09

Browse files
authored
Merge pull request #106 from Dokploy/102-docker-bypasses-ufw-firewall-rules---security-documentation-needs-update
docs: add warning about Docker bypassing UFW rules in security docume…
2 parents 6686011 + 9ad5902 commit 5e9dd09

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

apps/docs/content/docs/core/remote-servers/security.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ UFW is an essential security component that manages incoming and outgoing networ
2020
- ✅ Default incoming policy should be set to 'deny'
2121
- ✅ Only necessary ports should be opened
2222

23+
<Callout type="warn">
24+
**Important: Docker Bypasses UFW Rules**
25+
26+
Docker directly modifies `iptables` rules, which means it bypasses UFW firewall rules. This is a critical security issue: **ports exposed by Docker containers remain accessible from the public internet even when UFW rules should block them**, creating a false sense of security.
27+
28+
For example, if you have UFW configured to deny all incoming traffic by default, but you run a Docker container with `-p 3000:3000`, port 3000 will still be accessible from the internet despite your UFW configuration.
29+
30+
**Solutions:**
31+
32+
- **ufw-docker**: Use the [ufw-docker](https://github.com/chaifeng/ufw-docker) utility to properly integrate Docker with UFW, ensuring that Docker containers respect UFW firewall rules.
33+
34+
- **VPS Provider Firewall**: Configure your cloud provider's firewall (e.g., AWS Security Groups, DigitalOcean Firewalls) to block public access to Docker-exposed ports. This operates before Docker's iptables rules and provides reliable protection.
35+
36+
</Callout>
37+
2338
### SSH Security
2439
Secure Shell (SSH) configuration is crucial for safe remote server access.
2540

0 commit comments

Comments
 (0)