Skip to content

Commit

Permalink
e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
pereiramarco011 committed Jun 29, 2023
1 parent 6707219 commit 3dce81c
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 106 deletions.
40 changes: 21 additions & 19 deletions e2e/fixtures/E2E_CLI_031_RESULT.html

Large diffs are not rendered by default.

77 changes: 45 additions & 32 deletions e2e/fixtures/E2E_CLI_032_RESULT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files_scanned": 1,
"lines_scanned": 289,
"files_parsed": 1,
"lines_parsed": 282,
"lines_parsed": 289,
"files_failed_to_scan": 0,
"queries_total": 507,
"queries_failed_to_execute": 0,
Expand All @@ -12,14 +12,14 @@
"severity_counters": {
"HIGH": 8,
"INFO": 3,
"LOW": 2,
"LOW": 3,
"MEDIUM": 10,
"TRACE": 0
},
"total_counter": 23,
"total_counter": 24,
"total_bom_resources": 0,
"start": "2023-06-10T14:19:27.7542379+01:00",
"end": "2023-06-10T14:19:57.1698811+01:00",
"start": "2023-06-29T12:20:35.5786867+01:00",
"end": "2023-06-29T12:21:25.1837825+01:00",
"paths": [
"/path/e2e/fixtures/samples/positive.yaml"
],
Expand All @@ -37,7 +37,7 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "27c1aa11c215cb09ce1ad1e569a090d5bc80ca156c5bf81f3b52415dbd6608f0",
"similarity_id": "7d59e0095d8eda260b02394f129910d70d01b55dffb356780166354f9360d848",
"line": 104,
"resource_type": "AWS::ElasticLoadBalancingV2::Listener",
"resource_name": "ALBListener",
Expand Down Expand Up @@ -397,16 +397,16 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "d60022e14f1b45c574f71c0f48b3fee882b471819597b770e3545988a8f5295a",
"line": 19,
"similarity_id": "810487007189ac4de717dffc3204a05756e80e910b34f89ee08fd14f612328aa",
"line": 27,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"resource_name": "EcsSecurityGroupSSHinbound",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort should equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort is not equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort"
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.FromPort should equal to Resources.EcsSecurityGroupSSHinbound.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.FromPort is not equal to Resources.EcsSecurityGroupSSHinbound.Properties.ToPort"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
Expand All @@ -423,16 +423,16 @@
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "810487007189ac4de717dffc3204a05756e80e910b34f89ee08fd14f612328aa",
"line": 27,
"similarity_id": "d60022e14f1b45c574f71c0f48b3fee882b471819597b770e3545988a8f5295a",
"line": 19,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupSSHinbound",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.FromPort should equal to Resources.EcsSecurityGroupSSHinbound.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.FromPort is not equal to Resources.EcsSecurityGroupSSHinbound.Properties.ToPort"
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort should equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort is not equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort"
}
]
},
Expand All @@ -449,8 +449,21 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "81bc6465311aa1f359a617fa73beab5ce4fcea75a0e3a9eef35fc3aea109bcc9",
"line": 50,
"similarity_id": "7d931711c3ba34527d9a6660c82f06f4a2174812dcfbd69bb271187edec91a06",
"line": 51,
"resource_type": "AWS::ECS::TaskDefinition",
"resource_name": "TaskDefinition",
"issue_type": "MissingAttribute",
"search_key": "Resources.TaskDefinition.Properties.ContainerDefinitions",
"search_line": 0,
"search_value": "",
"expected_value": "'Resources.TaskDefinition.Properties.ContainerDefinitions' should contain 'HealthCheck' property",
"actual_value": "'Resources.TaskDefinition.Properties.ContainerDefinitions' doesn't contain 'HealthCheck' property"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "e08fb6aa0ab3e2ed98aa9d08d8813df89af2b0005acdbda809c86f4897715c78",
"line": 67,
"resource_type": "AWS::ECS::TaskDefinition",
"resource_name": "TaskDefinition",
"issue_type": "MissingAttribute",
Expand Down Expand Up @@ -501,29 +514,29 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "39fec612777f59fb4181dd2330ee465ec860c962acfebb07a4f1ee1f122d24e7",
"line": 35,
"similarity_id": "95883c9f983adb8f547c54e24837b6aa402978a00417be98441514959d4171d4",
"line": 27,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupALBports",
"resource_name": "EcsSecurityGroupSSHinbound",
"issue_type": "MissingAttribute",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.Description is undefined"
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.Description is undefined"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "95883c9f983adb8f547c54e24837b6aa402978a00417be98441514959d4171d4",
"line": 27,
"similarity_id": "39fec612777f59fb4181dd2330ee465ec860c962acfebb07a4f1ee1f122d24e7",
"line": 35,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupSSHinbound",
"resource_name": "EcsSecurityGroupALBports",
"issue_type": "MissingAttribute",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.Description is undefined"
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.Description is undefined"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
Expand Down
99 changes: 56 additions & 43 deletions e2e/fixtures/E2E_CLI_036_RESULT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files_scanned": 1,
"lines_scanned": 289,
"files_parsed": 1,
"lines_parsed": 282,
"lines_parsed": 289,
"files_failed_to_scan": 0,
"queries_total": 13,
"queries_failed_to_execute": 0,
Expand All @@ -12,14 +12,14 @@
"severity_counters": {
"HIGH": 6,
"INFO": 3,
"LOW": 1,
"LOW": 2,
"MEDIUM": 9,
"TRACE": 0
},
"total_counter": 19,
"total_counter": 20,
"total_bom_resources": 0,
"start": "2023-06-10T14:14:58.0283016+01:00",
"end": "2023-06-10T14:15:03.3543051+01:00",
"start": "2023-06-29T12:20:35.8372402+01:00",
"end": "2023-06-29T12:20:45.3060901+01:00",
"paths": [
"/path/e2e/fixtures/samples/positive.yaml"
],
Expand Down Expand Up @@ -128,29 +128,29 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "3c4976bcd6061315525a23a644cb6ed3bc4888794f21e8161a1cd38ea0495f30",
"line": 24,
"similarity_id": "f1f15967fd4bd2b39610dcbe3c2d641068dc1b409821142f41d179dbc360b3aa",
"line": 32,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"resource_name": "EcsSecurityGroupSSHinbound",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp should not be open to the world (0.0.0.0/0)",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp is open to the world (0.0.0.0/0)"
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp should not be open to the world (0.0.0.0/0)",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp is open to the world (0.0.0.0/0)"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "f1f15967fd4bd2b39610dcbe3c2d641068dc1b409821142f41d179dbc360b3aa",
"line": 32,
"similarity_id": "3c4976bcd6061315525a23a644cb6ed3bc4888794f21e8161a1cd38ea0495f30",
"line": 24,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupSSHinbound",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp should not be open to the world (0.0.0.0/0)",
"actual_value": "Resources.EcsSecurityGroupSSHinbound.Properties.CidrIp is open to the world (0.0.0.0/0)"
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp should not be open to the world (0.0.0.0/0)",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.CidrIp is open to the world (0.0.0.0/0)"
}
]
},
Expand Down Expand Up @@ -323,29 +323,29 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "d60022e14f1b45c574f71c0f48b3fee882b471819597b770e3545988a8f5295a",
"line": 19,
"similarity_id": "000056cd0b9697e13f2f4561f1963e34c58c042b921c4d0fad0f2fa5214374eb",
"line": 35,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"resource_name": "EcsSecurityGroupALBports",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort should equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort is not equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort"
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.FromPort should equal to Resources.EcsSecurityGroupALBports.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.FromPort is not equal to Resources.EcsSecurityGroupALBports.Properties.ToPort"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "000056cd0b9697e13f2f4561f1963e34c58c042b921c4d0fad0f2fa5214374eb",
"line": 35,
"similarity_id": "d60022e14f1b45c574f71c0f48b3fee882b471819597b770e3545988a8f5295a",
"line": 19,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupALBports",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"issue_type": "IncorrectValue",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.FromPort should equal to Resources.EcsSecurityGroupALBports.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.FromPort is not equal to Resources.EcsSecurityGroupALBports.Properties.ToPort"
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort should equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.FromPort is not equal to Resources.EcsSecurityGroupHTTPinbound02.Properties.ToPort"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
Expand Down Expand Up @@ -375,8 +375,21 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "81bc6465311aa1f359a617fa73beab5ce4fcea75a0e3a9eef35fc3aea109bcc9",
"line": 50,
"similarity_id": "7d931711c3ba34527d9a6660c82f06f4a2174812dcfbd69bb271187edec91a06",
"line": 51,
"resource_type": "AWS::ECS::TaskDefinition",
"resource_name": "TaskDefinition",
"issue_type": "MissingAttribute",
"search_key": "Resources.TaskDefinition.Properties.ContainerDefinitions",
"search_line": 0,
"search_value": "",
"expected_value": "'Resources.TaskDefinition.Properties.ContainerDefinitions' should contain 'HealthCheck' property",
"actual_value": "'Resources.TaskDefinition.Properties.ContainerDefinitions' doesn't contain 'HealthCheck' property"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "e08fb6aa0ab3e2ed98aa9d08d8813df89af2b0005acdbda809c86f4897715c78",
"line": 67,
"resource_type": "AWS::ECS::TaskDefinition",
"resource_name": "TaskDefinition",
"issue_type": "MissingAttribute",
Expand All @@ -401,16 +414,16 @@
"files": [
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "39fec612777f59fb4181dd2330ee465ec860c962acfebb07a4f1ee1f122d24e7",
"line": 35,
"similarity_id": "e96cf20cc6e1e11dce2d40d9e2b37446a00f00c3f541aa7dd13861059f6fcce8",
"line": 19,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupALBports",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"issue_type": "MissingAttribute",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.Description is undefined"
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.Description is undefined"
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
Expand All @@ -427,16 +440,16 @@
},
{
"file_name": "path\\e2e\\fixtures\\samples\\positive.yaml",
"similarity_id": "e96cf20cc6e1e11dce2d40d9e2b37446a00f00c3f541aa7dd13861059f6fcce8",
"line": 19,
"similarity_id": "39fec612777f59fb4181dd2330ee465ec860c962acfebb07a4f1ee1f122d24e7",
"line": 35,
"resource_type": "AWS::EC2::SecurityGroupIngress",
"resource_name": "EcsSecurityGroupHTTPinbound02",
"resource_name": "EcsSecurityGroupALBports",
"issue_type": "MissingAttribute",
"search_key": "Resources.EcsSecurityGroupHTTPinbound02.Properties",
"search_key": "Resources.EcsSecurityGroupALBports.Properties",
"search_line": 0,
"search_value": "",
"expected_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupHTTPinbound02.Properties.Description is undefined"
"expected_value": "Resources.EcsSecurityGroupALBports.Properties.Description should be set",
"actual_value": "Resources.EcsSecurityGroupALBports.Properties.Description is undefined"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions e2e/fixtures/E2E_CLI_036_RESULT_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files_scanned": 1,
"lines_scanned": 289,
"files_parsed": 1,
"lines_parsed": 282,
"lines_parsed": 289,
"files_failed_to_scan": 0,
"queries_total": 1,
"queries_failed_to_execute": 0,
Expand All @@ -18,8 +18,8 @@
},
"total_counter": 3,
"total_bom_resources": 0,
"start": "2023-06-10T14:21:28.3382569+01:00",
"end": "2023-06-10T14:21:30.1235832+01:00",
"start": "2023-06-29T12:20:35.085794+01:00",
"end": "2023-06-29T12:20:40.0129014+01:00",
"paths": [
"/path/e2e/fixtures/samples/positive.yaml"
],
Expand Down
20 changes: 11 additions & 9 deletions e2e/fixtures/E2E_CLI_040_RESULT.html

Large diffs are not rendered by default.

0 comments on commit 3dce81c

Please sign in to comment.