Skip to content

daemon: Fatal on incompatible host firewall options#12495

Merged
qmonnet merged 2 commits intomasterfrom
pr/pchaigno/fatal-incompatible-host-fw-options
Jul 14, 2020
Merged

daemon: Fatal on incompatible host firewall options#12495
qmonnet merged 2 commits intomasterfrom
pr/pchaigno/fatal-incompatible-host-fw-options

Conversation

@pchaigno
Copy link
Copy Markdown
Member

@pchaigno pchaigno commented Jul 10, 2020

See commits for details.

In particular, the message of the second commit, which disallows per-endpoint routes with the host firewall, discusses an alternative:

Per-endpoint routes is a recommended setting in some cases (e.g., GKE).
In such cases, it would be possible to have a partial host firewall
enforcement, with all traffic to and from pods whitelisted. The host
firewall would then only enforce policies on packets to and from world on
the native devices (likely the first use case for the host firewall).

This commit does not implement this second approach and prefers to forbid
per-endpoint routes with the host firewall because a partial enforcement
would likely be confusing to users.

Updates: #11799

Fatal if the host firewall is used without remote node identities
Fatal if the host firewall is used with per-endpoint routes

@pchaigno pchaigno added area/daemon Impacts operation of the Cilium daemon. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. needs-backport/1.8 labels Jul 10, 2020
@pchaigno pchaigno requested a review from a team July 10, 2020 14:03
@pchaigno pchaigno marked this pull request as draft July 10, 2020 14:03
@pchaigno pchaigno force-pushed the pr/pchaigno/fatal-incompatible-host-fw-options branch from 2d169bf to ba966a4 Compare July 10, 2020 17:40
@pchaigno pchaigno marked this pull request as ready for review July 10, 2020 17:51
@pchaigno pchaigno requested a review from a team as a code owner July 10, 2020 17:51
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 10, 2020

Coverage Status

Coverage decreased (-0.03%) to 36.963% when pulling a81df6f on pr/pchaigno/fatal-incompatible-host-fw-options into c4b2c1e on master.

pchaigno added 2 commits July 11, 2020 09:40
The host firewall currently only works if remote node identities are
distinct from the host identity (i.e., REMOTE_NODE_ID is supported).

It's not clear if this restriction can be removed in the future,
especially once #12345 is merged. In particular, #12345 will redirect
packets from local endpoints through the host device if the destination
security ID is HOST_ID. If the HOST_ID includes remote nodes, then this
redirection is likely to result in packet drops.

Signed-off-by: Paul Chaignon <paul@cilium.io>
The host firewall lives only in the host device and the native devices.
Therefore, we must ensure that packet to and from local pods are routed
through the host device. If not, the host firewall will be bypassed.

Making the host firewall compatible with per-endpoint routes would
require substantial changes, which are unlikely to be a good fit for
backport. In particular, the host policies would need to be accessed
from the bpf_lxc programs. Such changes would impact the size and
complexity of bpf_lxc, as well as the loading of maps.

Per-endpoint routes is a recommended setting in some cases (e.g., GKE).
In such cases, it would be possible to have a partial host firewall
enforcement, with all traffic to and from pods whitelisted. The host
firewall would then only enforce policies on packets to and from world on
the native devices (likely the first use case for the host firewall).

This commit does not implement this second approach and prefers to forbid
per-endpoint routes with the host firewall because a partial enforcement
would likely be confusing to users.

Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno force-pushed the pr/pchaigno/fatal-incompatible-host-fw-options branch from ba966a4 to a81df6f Compare July 11, 2020 07:40
@pchaigno
Copy link
Copy Markdown
Member Author

test-me-please

Copy link
Copy Markdown
Member

@brb brb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we have a long term plan to get rid of cilium_host, so supporting host-fw with per-endpoint-routes is worth revisiting.

@maintainer-s-little-helper maintainer-s-little-helper Bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 13, 2020
@pchaigno
Copy link
Copy Markdown
Member Author

@brb Thanks for the review! Yep, supporting per-endpoint routes is definitely on the TODO for the host firewall. I just don't think it's something that we'll be able to backport, hence this temporary "solution".

@qmonnet qmonnet merged commit 8d23114 into master Jul 14, 2020
@qmonnet qmonnet deleted the pr/pchaigno/fatal-incompatible-host-fw-options branch July 14, 2020 10:16
@brb brb mentioned this pull request Jul 15, 2020
@pchaigno pchaigno added the area/host-firewall Impacts the host firewall or the host endpoint. label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Impacts operation of the Cilium daemon. area/host-firewall Impacts the host firewall or the host endpoint. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants