Page MenuHomePhabricator

IPsec: add firewall rules
Closed, DeclinedPublic

Description

To ensure that use of IPsec shall be enforced rather than simply allowed, support addition of firewall rules which block unencrypted traffic

Configuration parameters: left|rightupdown (probably not left|rightfirewall, which is about forwarding)

The ports wouldn't change and in transport mode the protocol would remain IP (0) rather than ESP (50), so we'd need deeper packet inspection to determine whether a packet uses IPsec.

The goal would be "don't let nodes in remote colos contact backend Varnish instances unless they're using IPsec".

Event Timeline

• Gage claimed this task.
• Gage raised the priority of this task from to High.
• Gage updated the task description. (Show Details)
• Gage added a project: ops-core.
• Gage changed the visibility from "Public (No Login Required)" to "WMF-NDA (Project)".
• Gage changed the edit policy from "All Users" to "WMF-NDA (Project)".
• Gage added subscribers: Aklapper, jeremyb, • rtimport and 3 others.
• Gage lowered the priority of this task from High to Low.Jan 13 2015, 9:13 PM
• Gage changed the visibility from "WMF-NDA (Project)" to "Public (No Login Required)".
• Gage changed the edit policy from "WMF-NDA (Project)" to "All Users".
• Gage set Security to None.

Given that Varnish nodes have only private IPs there is no explicit need for this. Proper configuration of security associations between nodes in cache colos and main colos would ensure that traffic is encrypted; firewall rules would only confirm/enforce this.

Also, loading iptables on these high performance boxes can have an impact on network performance, so we should hope to avoid it for that reason too.

If implemented, this task will be completed after T92604. Once we are confident in traffic flows over IPsec we may wish to use firewall rules to explicitly disallow unencrypted traffic.

In T85823#974563, @Gage wrote:

Given that Varnish nodes have only private IPs there is no explicit need for this. Proper configuration of security associations between nodes in cache colos and main colos would ensure that traffic is encrypted; firewall rules would only confirm/enforce this.

What we're actively trying to prevent here with ipsec is a determined MITM. The fact that the addresses are "private" is irrelevant - they're still flowing over intercontinental/transcontinental links we don't own. We eventually need a way to ensure that this MITM cannot force esams and eqiad nodes to view each other as not being configured for ipsec and thus causing plaintext traffic to flow (e.g. by blocking IKE between them so that the sessions are never established).

As mark said, though, iptables on high-traffic boxes like this is tricky. We should explore what the simplest option would be.

Dzahn added a parent task: Restricted Task.Jul 7 2015, 2:35 AM

At this point, I think even if we evaded the iptables perf issues, I'm not comfortable enough with the risk balance to try to enforce ipsec-only communication with our current host-based model. I think in the long view, the current ipsec deployment is a stopgap measure to help prevent passive snooping until we figure out how to do Better Things, and combined with the icinga alerting we have pretty decent visibility into any IKE blocking as well.