Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Split host policies for dev. VMs #15577

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

pchaigno
Copy link
Member

@pchaigno pchaigno commented Apr 6, 2021

The current extensive host policy for the development VMs (implements the most restrictive policy possible) was written to support both values of enable-remote-node-identity. When that flag is enabled, rules for the remote node are implemented with the remote-node entity; when it is disabled, the node CIDR is used.

Unfortunately, when enable-remote-node-identity is given, the policy is not the most restrictive possible anymore, because we now have additional rules matching on node CIDR. To ensure we have the most restrictive policy possible, we need to split the existing host policy into two policies, for each value of the flag.

These files are not tested anywhere and only used for local testing, so no need to run the full CI.

The current extensive host policy for the development VMs (implements
the most restrictive policy possible) was written to support both values
of enable-remote-node-identity. When that flag is enabled, rules for the
remote node are implemented with the remote-node entity; when it is
disabled, the node CIDR is used.

Unfortunately, when enable-remote-node-identity is given, the policy is
not the most restrictive possible anymore, because we now have
additional rules matching on node CIDR. To ensure we have the most
restrictive policy possible, we need to split the existing host policy
into two policies, for each value of the flag.

Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno added release-note/misc This PR makes changes that have no direct user impact. area/host-firewall Impacts the host firewall or the host endpoint. labels Apr 6, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Apr 6, 2021
@pchaigno pchaigno marked this pull request as ready for review April 6, 2021 17:21
@pchaigno pchaigno requested a review from a team as a code owner April 6, 2021 17:21
Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand why the policy is not minimal if enable-remote-node-identity=false. Presumably in that case the extra rules are no-ops because the remote-node identity is not used for determining policy posture. When it's enabled, then it looks like the new policy file is just the same as what the current policy is. Am I missing something?

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Ah, I guess the difference is that the =false case has rules for 192.168.33.0/24 but the new policy does not. 👍

@pchaigno
Copy link
Member Author

pchaigno commented Apr 6, 2021

Ah, I guess the difference is that the =false case has rules for 192.168.33.0/24 but the new policy does not. +1

Exactly.

@pchaigno pchaigno merged commit e13f6bf into cilium:master Apr 6, 2021
1.10.0 automation moved this from In progress to Done Apr 6, 2021
@pchaigno pchaigno deleted the split-hostfw-policies branch April 6, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/host-firewall Impacts the host firewall or the host endpoint. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants