When configured properly what can avoid data leakage?

A firewall can avoid data leakage.