oxidecomputer / oxidecomputer/omicron

Firewall rule resolution needs to consider external addressing

Open
#9,799 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

networking
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

Today, Nexus compiles the list of firewall rules to send to each sled agent here:

https://github.com/oxidecomputer/omicron/blob/16c22eb154598b1b40f5ac73cbc2183219b4c133/nexus/networking/src/firewall_rules.rs#L46

It does this by looking at all the instances on the sled, and then figuring out which rules apply to it. For example, if there's a FW rule targeting the subnet 1.2.3.0/24, and the instance has the VPC-private IP address 1.2.3.4, then a copy of that rule is sent to the OPTE instance on that sled. We evaluate this for a few different target types, include IP subnets, instance names, VPCs, etc.

What we don't do is consider the new attached subnets. For example, if you attach the subnet 1.2.3.0/24 to an instance named foo, and then create a firewall rule with an IP subnet target of 1.2.3.0/24, we do not consider that rule to apply to that instance. The only thing we look at for resolution is the instance name, VPC name, VPC Subnet name, or the VPC-private IP addresses of the NIC. To get that traffic to flow, one would need to specify the target in another way that does apply, such as by instance name, VPC name, or VPC Subnet name.

We should expand this to consider the attached subnets, and ideally Floating IPs as well. It could do this both with the IP and IP Subnet target types we have today, or with a new set of target types specifically for the Attached Subnet and Floating IP objects by name.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in nexus/networking/src/firewall_rules.rs at the linked rule-resolution code and trace how instance, VPC, subnet, and NIC addresses are considered. Extend the resolution criteria to account for attached subnets and determine whether Floating IPs should use existing IP target types or new named target types; done means matching firewall rules are sent to the relevant sled agent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, networking, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.