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

Add support for stateless rules in network ACLs #651

Closed
stgraber opened this issue Mar 24, 2024 · 5 comments
Closed

Add support for stateless rules in network ACLs #651

stgraber opened this issue Mar 24, 2024 · 5 comments
Assignees
Labels
API Changes to the REST API Easy Good for new contributors
Milestone

Comments

@stgraber
Copy link
Member

Currently all ACL rules are assumed to be stateful.

That's certainly fine as a default as stateless firewalling can be a bit tricky to get right, but for very high throughput/pps applications, it's a very useful tool and so should be supported.

@stgraber stgraber added Feature API Changes to the REST API labels Mar 24, 2024
@stgraber stgraber added this to the soon milestone Mar 24, 2024
@stgraber
Copy link
Member Author

We can do this by adding a new allow-stateless action which in the OVN case makes us use allow-stateless rather than the current allow-related.

@stgraber stgraber added the Easy Good for new contributors label Mar 24, 2024
@christina-zh
Copy link

Im interested in working on this issue, can I be assigned to it please?

@stgraber
Copy link
Member Author

stgraber commented Mar 28, 2024

For this one, you're going to want to:

  • Add an API extension string for the change (say network_acl_stateless)
  • Add the new value to the list in doc/howto/network_acls.md
  • Add it to ValidActions in internal/server/network/acl/driver_common.go
  • Add it to ovnRuleCriteriaToOVNACLRule in internal/server/network/acl/acl_ovn.go (and remove the TODO). The priority remains PortGroupAllow, it's just the action that will differ
  • Add logic to internal/server/network/acl/acl_firewall.go to map a stateless ACL to a normal allowRule (with a TODO comment to add NOTRACK support later)

And I think that should be it to get this working.

Expected commit list based on the above should be:

  • api: Add network_acl_stateless
  • doc/network_acl: Add allow-stateless action
  • incusd/network/acl: Add allow-stateless action

Testing this locally won't be the easiest unfortunately as you'd need to first get a working Incus setup, then also install OVN and set that up.
https://linuxcontainers.org/incus/docs/main/howto/network_ovn_setup/#network-ovn-setup should help if you want to do that.

Though the issue is likely simple enough that you should be able to do it blind and I'll then test it for you on a proper OVN cluster.

@atomus1990
Copy link

Stateless is supported for strictly for OVN networks? Or is supported for Bridge networks also?

@stgraber
Copy link
Member Author

Only OVN at this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Easy Good for new contributors
Development

No branches or pull requests

3 participants