Skip to content

Commit 5faa41e

Browse files
authored
fix(ec2): Allow FromPort/ToPort for ICMPv6 in W3687 (#4600)
Add icmpv6 protocol variants (58, "58", "icmpv6", "ICMPv6", "ICMPV6") to the exclusion allowlist so that W3687 does not incorrectly flag FromPort/ToPort as ignored for ICMPv6 security group rules. These properties specify ICMP type and code which are valid for ICMPv6. Fixes aws/aws-cdk#38422
1 parent 5bfafc7 commit 5faa41e

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

src/cfnlint/data/schemas/extensions/aws_ec2_securitygroup/protocols_and_port_ranges_exclude.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
17,
1414
"17",
1515
"udp",
16+
58,
17+
"58",
18+
"icmpv6",
1619
"TCP",
1720
"UDP",
18-
"ICMP"
21+
"ICMP",
22+
"ICMPv6",
23+
"ICMPV6"
1924
]
2025
},
2126
"type": [

test/unit/rules/resources/ec2/test_sg_protocols_ports_exclusive.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@ def rule():
4444
[], # wrong type
4545
[],
4646
),
47+
(
48+
{
49+
"IpProtocol": "icmpv6",
50+
"FromPort": -1,
51+
"ToPort": -1,
52+
},
53+
[],
54+
),
55+
(
56+
{
57+
"IpProtocol": "ICMPv6",
58+
"FromPort": 8,
59+
"ToPort": 0,
60+
},
61+
[],
62+
),
63+
(
64+
{
65+
"IpProtocol": 58,
66+
"FromPort": -1,
67+
"ToPort": -1,
68+
},
69+
[],
70+
),
71+
(
72+
{
73+
"IpProtocol": "58",
74+
"FromPort": -1,
75+
"ToPort": -1,
76+
},
77+
[],
78+
),
4779
(
4880
{
4981
"IpProtocol": -1,

0 commit comments

Comments
 (0)