DevSecOps, Docker + UFW and API protection from hacking
How to close UFW bypass via Docker, protect webhooks with HMAC signature, configure CSP and pass OWASP Top 10 security audit.
TL;DR · Key Answer
Docker by default modifies the DOCKER-USER iptables chain, bypassing UFW rules. To protect the database and internal ports, bind services to 127.0.0.1 and filter traffic in ufw-docker or DOCKER-USER.
Checklist
- Always bind internal DB/Redis ports as 127.0.0.1:5432:5432, not 0.0.0.0.
- Check the X-Signature (HMAC-SHA256 + timingSafeEqual) on every payment and bot webhook.
- Configure strict Content-Security-Policy and X-Frame-Options in middleware.
Forum Discussions (vbcd4u.com)
Все обсуждения →🛡️ Безопасность · ▲ 1
Безопасные вебхуки Kaspi QR (ApiPay/TolePay) и Freedom Pay: HMAC-SHA256 и идемпотентность
🛡️ Безопасность · ▲ 1
Смертельная ловушка Docker + UFW: почему ваши Postgres и Redis открыты всему интернету
🛡️ Безопасность · ▲ 1
Отражение атак на Production API (SSRF, IDOR, Mass Assignment) + Автономный пентест через Shannon AI (48K ⭐)
🔥 Нейросети · ▲ 0
Telegram-бот: webhook или long polling, secret_token и деплой на serverless
🔥 Нейросети · ▲ 0
Cloudflare перед сайтом: кэш статики, WAF, rate limiting и проблемы с Vercel
🔥 Нейросети · ▲ 0
Секреты в репозитории: gitleaks в pre-commit и CI и что делать при утечке
Engineering Guides (MurdaSoft)
FAQ
Why doesn't UFW block the port opened in docker-compose?
Docker adds DNAT rules to iptables before the INPUT chain, which is managed by UFW. Use binding on 127.0.0.1 or rules in the DOCKER-USER chain.