Skip to content

ACL should apply allow first when default action is allow #1833

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

Open
stgraber opened this issue Mar 23, 2025 · 2 comments
Open

ACL should apply allow first when default action is allow #1833

stgraber opened this issue Mar 23, 2025 · 2 comments
Assignees
Labels
Documentation Documentation needs updating Easy Good for new contributors
Milestone

Comments

@stgraber
Copy link
Member

stgraber commented Mar 23, 2025

Currently when applying ACLs, Incus will first apply all drop/reject, then apply the allow rules and finally the policy which defaults to reject.

That's a good order for this particular case as it allows having wide allow rules with narrow reject/drop rules to block a subset of what's allowed, then the policy rejects the rest.

But this apply order isn't a good fit when the default policy is allow as in that situation one would likely have pretty broad reject/drop rules and so want the allow rules applied first to allow a subset of what would otherwise be denied by broader reject/drop rules.

So we should change our default apply order to match, basically reversing the order if the default action is allow.

@stgraber stgraber added Documentation Documentation needs updating Easy Good for new contributors labels Mar 23, 2025
@stgraber stgraber added this to the soon milestone Mar 23, 2025
@AbhinavTiruvee
Copy link

@stgraber Hi, I'm part of a group at UT Austin taking a class on virtualization. Could my partner and I take a look at this issue and try to solve it?

@stgraber
Copy link
Member Author

stgraber commented Apr 3, 2025

Done.

You're going to want to set up Incus with OVN locally. There is some documentation for that in https://linuxcontainers.org/incus/docs/main/howto/network_ovn_setup/.

You should then be able to reproduce the current (wrong) behavior by:

  • Creating an ACL that:
    • Allows connecting to 1.1.1.1
    • Blocks connecting to 1.1.1.0/24
  • Apply the ACL to an instance
  • Set the default action for the ACL to allow

Normally you'd expect this setup to allow talking to 1.1.1.1, but because we currently apply the drop/reject ahead of the allow rules, you'll find that 1.1.1.1 won't be allowed due to the 1.1.1.0/24 reject rule.

Once the issue is fixed, the same setup should allow pinging 1.1.1.1 but reject pinging 1.1.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating Easy Good for new contributors
Development

No branches or pull requests

2 participants