Repository navigation
Associated firewall rules - #1890
benjaminleonard wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
I think
and
are two pieces of the same puzzle. Would we be open to copy under the header that explains that? Alternately, a tooltip? Perhaps adding an "action" dropdown at the end of the row that just links back to the firewall rules tab for the associated VPC for that row? (e.g. |
|
I like the idea. My concern is that we'd be recreating API (or even networking subsystem) logic in an incomplete and possibly misleading way. For example, unless we could be very confident about our logic (not sure this is possible), we would not want to give the impression that the list is exhaustive and these rules are the only way the instance could be receiving traffic — that would be a nightmare for someone trying to debug instance networking. We'd have to include a disclaimer that the list is for convenience. |
That's fair, and perhaps the case even if implemented in |
|
Overall I do like bringing like concerns closer together.
I think this is an excellent point. Further, our differentiator (tight hardware/software co-design) should enable this exact kind of interaction. Now, that doesn't mean doing this kind of thing would be easy, but it is compelling. @benjaminleonard I would definitely want to pull in someone with more networking experience to be able to have an inform conversation about what the possibilities are here. Overall though, I think if you could get a list of all firewall rules associated to an instance then that would be a tremendously valuable experience. One thing I'd recommend is having a I think being able to add a firewall rule here would be nice too. It's obviously of secondary importance and we should be 10000% sure that the user understands where they're adding it and if it impacts anything else. So, while it would be nice, we should only do it if it doesn't generate more confusion for users. |
|
I think this is very useful in principle for helping to visualise and debug a user's network configuration! Looking at it rendered:
I had another look over features outlined in RFD21 that we don't have yet (VPC subnet routing, VPC Peering) -- I think you're right and there should 100% be a disclaimer for the reason that, e.g., custom VPC routers would be able to filter or redirect traffic such that it'd be difficult to resolve the exact set of relevant rules. I initially thought that as long as we didn't perform any excess pruning we'd have false positive FW rules at worst, but I can imagine at least one scenario where you'd miss rules unless you resolved custom router logic. I could be misinterpreting though.
Definitely necessary if/when VPC peering is implemented. |
| } | ||
| } | ||
| return false | ||
| } |
There was a problem hiding this comment.
Didn't see this function till now. Very fun. Makes me think maybe this can work.
There was a problem hiding this comment.
We should probably use .exhaustive() instead of a switch. If we add future variants we don't want it to silently fail. Exhaustive makes sure it fails at compile time so we can update it.
|
Closing for now since this was just a PoC. A great one, though! |
| break | ||
| case 'ip': | ||
| if (ips.includes(target.value)) { | ||
| return true |
There was a problem hiding this comment.
Should parse/compare similar to ipRangeCheck. A string inclusion will work fine for IPv4 but have problems for IPv6.
There was a problem hiding this comment.
Haven't touched these since last year. Though probably some evidence that if we did decide to do this, it should sit within the API rather than the console where it can drift (more easily).
| } | ||
| break | ||
| case 'instance': | ||
| if (instanceName === target.value) { |
There was a problem hiding this comment.
Assumes a name, but the PR/line 347 indicate it can be an ID.
| if (vpc && firewallRules && firewallRules.rules && subnet) { | ||
| const vpcs = [vpc.name] | ||
| const subnets = [subnet.name] | ||
| const ips = nicList && nicList.items.length > 0 ? [nicList?.items[0].ip] : [] |
There was a problem hiding this comment.
Why collapse the nicList to only 1? We pull up to 10 and isRuleApplicableToInstance can handle the inputs on a loop. Also... can an instance have two NICs across VPCs? I'll have to look at that.
Ignore the code in this PR, it's more of a discussion point than anything else, since if we did decide to do this it should probably happen at the nexus level. But I took a stab at what it might take to grab all the firewall rules that apply to the current instance.
The logic seems pretty simple – though I'm only looking at the first VPC.
The things to consider would be:
Is this useful?
I think so, much easier than looking through each firewall rule and trying to figure out if the target applies to this instance.
Can you edit items inline here
It might give the user the impression that these rules are scoped to this instance. Likewise it might be useful to allow a user to add a firewall rule here but we'd need to pre fill the target as the current instance.
How do we effectively link from back to the VPC / make it clear that these rules belong to the VPC not the instance?
This is another case for moving pagination directly under the table itself – since it doesn't support multiple tables on one page. Though it might be better to move firewall rules into its own tab.
Does this feel useful to explore? If not, or better to defer we can close this.