Skip to content

Commit 63e1f70

Browse files
committed
Extend ICMP allow to Redirect and Port Unreachable
Redirect came out of our earlier discussion, port unreachable should be useful in the limit too.
1 parent 21efccf commit 63e1f70

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

common/src/api/external/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,9 +3389,10 @@ pub enum BfdMode {
33893389
)]
33903390
pub struct ServiceIcmpConfig {
33913391
/// When enabled, Nexus is able to receive ICMP Destination Unreachable
3392-
/// (type 4, fragmentation needed) and Time Exceeded messages. These
3393-
/// enable Nexus to perform Path MTU discovery and better cope with
3394-
/// fragmentation issues. Otherwise all ICMP traffic will be dropped.
3392+
/// type 3 (port unreachable) and type 4 (fragmentation needed),
3393+
/// Redirect, and Time Exceeded messages. These enable Nexus to perform Path
3394+
/// MTU discovery and better cope with fragmentation issues. Otherwise all
3395+
/// inbound ICMP traffic will be dropped.
33953396
pub enabled: bool,
33963397
}
33973398

nexus/db-fixed-data/src/vpc_firewall_rule.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ pub static NEXUS_ICMP_FW_RULE: LazyLock<VpcFirewallRuleUpdate> =
105105
VpcFirewallRuleProtocol::Icmp(Some(VpcFirewallIcmpFilter {
106106
// Type 3 -- Destination Unreachable
107107
icmp_type: 3,
108-
// Code 4 -- Fragmentation needed
109-
code: Some(4.into()),
108+
// Codes 3,4 -- Port Unreachable, Fragmentation needed
109+
code: Some((3..=4).into()),
110+
})),
111+
VpcFirewallRuleProtocol::Icmp(Some(VpcFirewallIcmpFilter {
112+
// Type 5 -- Redirect
113+
icmp_type: 5,
114+
code: None,
110115
})),
111116
VpcFirewallRuleProtocol::Icmp(Some(VpcFirewallIcmpFilter {
112117
// Type 11 -- Time Exceeded

nexus/networking/src/firewall_rules.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ pub async fn resolve_firewall_rules_for_sled_agent(
316316
// `nexus_db_queries::fixed_data::vpc_firewall_rule` for those
317317
// rules.) If those rules change to include any filter hosts, this
318318
// logic needs to change as well.
319+
//
320+
// Note that inbound ICMP is not currently governed by this filter,
321+
// as error-type ICMP messages can arrive from any host which a
322+
// Nexus/DNS zone reaches out to *or* a gateway/router on the path to
323+
// that destination.
319324
(None, Some(allowed_ips)) => {
320325
if allowlist_applies_to_firewall_rule(rule) {
321326
match allowed_ips {

openapi/nexus.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22845,7 +22845,7 @@
2284522845
"type": "object",
2284622846
"properties": {
2284722847
"enabled": {
22848-
"description": "When enabled, Nexus is able to receive ICMP Destination Unreachable (type 4, fragmentation needed) and Time Exceeded messages. These enable Nexus to perform Path MTU discovery and better cope with fragmentation issues. Otherwise all ICMP traffic will be dropped.",
22848+
"description": "When enabled, Nexus is able to receive ICMP Destination Unreachable type 3 (port unreachable) and type 4 (fragmentation needed), Redirect, and Time Exceeded messages. These enable Nexus to perform Path MTU discovery and better cope with fragmentation issues. Otherwise all inbound ICMP traffic will be dropped.",
2284922849
"type": "boolean"
2285022850
}
2285122851
},

schema/crdb/vpc-firewall-icmp/up08.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ SELECT
1616
NOW(), NOW(), vpc.id, 'enabled',
1717
-- Apply to the Nexus and External DNS zones...
1818
ARRAY['subnet:nexus','subnet:external-dns'],
19-
-- Allow inbound ICMP Destination Unreachable (Too Large) and Time Exceeded
20-
ARRAY['icmp:3,4','icmp:11'],
19+
-- Allow inbound ICMP:
20+
-- * Destination Unreachable
21+
-- * Port Unreachable
22+
-- * Fragmentation Needed
23+
-- * Redirect
24+
-- * Time Exceeded
25+
ARRAY['icmp:3,3-4','icmp:5','icmp:11'],
2126
'inbound', 'allow', 65534
2227
FROM omicron.public.vpc
2328
WHERE vpc.id = '001de000-074c-4000-8000-000000000000'

0 commit comments

Comments
 (0)