Skip to content

Commit

Permalink
Apply the rules to Ingress and Egress resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Jan 21, 2024
1 parent c1349a7 commit f033ae7
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"abbad2d61bce41659bca87b27e9ee78f\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"176f4e2894ec2acb6290a05a269e6140\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"op": "add",
"path": "/cfnSchema",
"value": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"op": "add",
"path": "/cfnSchema",
"value": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
],
"dependencies": {
"FromPort": [
"ToPort"
],
"ToPort": [
"FromPort"
]
},
"properties": {
"CidrIp": {
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"additionalProperties": false,
"cfnSchema": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
],
"createOnlyProperties": [
"/properties/IpProtocol",
"/properties/DestinationSecurityGroupId",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"additionalProperties": false,
"cfnSchema": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
],
"createOnlyProperties": [
"/properties/GroupName",
"/properties/IpProtocol",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"additionalProperties": false,
"cfnSchema": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
],
"createOnlyProperties": [
"/properties/IpProtocol",
"/properties/DestinationSecurityGroupId",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"additionalProperties": false,
"cfnSchema": [
"aws_ec2_securitygroup/protocols_and_port_ranges_include",
"aws_ec2_securitygroup/protocols_and_port_ranges_exclude",
"aws_ec2_securitygroup/all_to_and_from_ports"
],
"createOnlyProperties": [
"/properties/IpProtocol",
"/properties/DestinationSecurityGroupId",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/cfn_yaml/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUp(self):
},
"generic_bad": {
"filename": "test/fixtures/templates/bad/generic.yaml",
"failures": 33,
"failures": 34,
},
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/test_rules_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_fail_run(self):
filename = "test/fixtures/templates/bad/generic.yaml"
template = cfnlint.decode.cfn_yaml.load(filename)
cfn = Template(filename, template, ["us-east-1"])
expected_err_count = 36
expected_err_count = 37
matches = []
matches.extend(self.rules.run(filename, cfn))
assert (
Expand Down

0 comments on commit f033ae7

Please sign in to comment.