-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7043 from Checkmarx/ruiar/add-flag-max-resolver-d…
…epth feat(engine): add --max-resolver-depth flag
- Loading branch information
Showing
52 changed files
with
416 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"kics_version": "development", | ||
"files_scanned": 1, | ||
"lines_scanned": 19, | ||
"files_parsed": 1, | ||
"lines_parsed": 19, | ||
"lines_ignored": 0, | ||
"files_failed_to_scan": 0, | ||
"queries_total": 17, | ||
"queries_failed_to_execute": 0, | ||
"queries_failed_to_compute_similarity_id": 0, | ||
"scan_id": "console", | ||
"severity_counters": { | ||
"CRITICAL": 0, | ||
"HIGH": 0, | ||
"INFO": 1, | ||
"LOW": 0, | ||
"MEDIUM": 0, | ||
"TRACE": 0 | ||
}, | ||
"total_counter": 1, | ||
"total_bom_resources": 0, | ||
"start": "2024-05-06T15:45:28.1028682+01:00", | ||
"end": "2024-05-06T15:45:29.6882643+01:00", | ||
"paths": [ | ||
"/path/test/fixtures/resolve_references" | ||
], | ||
"queries": [ | ||
{ | ||
"query_name": "Components Schema Definition Is Unused", | ||
"query_id": "962fa01e-b791-4dcc-b04a-4a3e7389be5e", | ||
"query_url": "https://swagger.io/specification/#components-object", | ||
"severity": "INFO", | ||
"platform": "OpenAPI", | ||
"category": "Best Practices", | ||
"experimental": false, | ||
"description": "Components schemas definitions should be referenced or removed from Open API definition", | ||
"description_id": "5cdc0f3b", | ||
"files": [ | ||
{ | ||
"file_name": "path\\test\\fixtures\\resolve_references\\swagger.yaml", | ||
"similarity_id": "ff39e561509c13315ce34a0be602a974d63231b70cb5cdf778109e062302f8eb", | ||
"line": 17, | ||
"issue_type": "IncorrectValue", | ||
"search_key": "components.schemas.{{MyResponse}}", | ||
"search_line": -1, | ||
"search_value": "", | ||
"expected_value": "Schema should be used as reference somewhere", | ||
"actual_value": "Schema is not used as reference" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"kics_version": "development", | ||
"files_scanned": 2, | ||
"lines_scanned": 22, | ||
"files_parsed": 2, | ||
"lines_parsed": 6887, | ||
"lines_ignored": 0, | ||
"files_failed_to_scan": 0, | ||
"queries_total": 0, | ||
"queries_failed_to_execute": 0, | ||
"queries_failed_to_compute_similarity_id": 0, | ||
"scan_id": "console", | ||
"severity_counters": { | ||
"CRITICAL": 0, | ||
"HIGH": 0, | ||
"INFO": 0, | ||
"LOW": 0, | ||
"MEDIUM": 0, | ||
"TRACE": 0 | ||
}, | ||
"total_counter": 0, | ||
"total_bom_resources": 0, | ||
"start": "2024-05-06T15:47:33.0217097+01:00", | ||
"end": "2024-05-06T15:47:35.1422829+01:00", | ||
"paths": [ | ||
"/path/test/fixtures/resolve_circular_loop" | ||
], | ||
"queries": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package testcases | ||
|
||
// E2E-CLI-094 - KICS scan and ignore references | ||
// should perform the scan successfully and return exit code 20 | ||
// this test is similar to E2E-CLI-071. Since the '--max-resolver-path' parameter is set to 0, it will not resolve any files | ||
func init() { //nolint | ||
testSample := TestCase{ | ||
Name: "should perform a valid scan and not resolve references [E2E-CLI-094]", | ||
Args: args{ | ||
Args: []cmdArgs{ | ||
[]string{"scan", "-o", "/path/e2e/output", | ||
"--output-name", "E2E_CLI_094_RESULT", | ||
"-p", "\"/path/test/fixtures/resolve_references\"", | ||
"-i", "6c35d2c6-09f2-4e5c-a094-e0e91327071d,962fa01e-b791-4dcc-b04a-4a3e7389be5e", | ||
"--enable-openapi-refs", | ||
"--max-resolver-depth", "0", | ||
}, | ||
}, | ||
ExpectedResult: []ResultsValidation{ | ||
{ | ||
ResultsFile: "E2E_CLI_094_RESULT", | ||
ResultsFormats: []string{"json"}, | ||
}, | ||
}, | ||
}, | ||
WantStatus: []int{20}, | ||
} | ||
|
||
Tests = append(Tests, testSample) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package testcases | ||
|
||
// E2E-CLI-095 - KICS scan and ignore references | ||
// should perform the scan successfully and return exit code 0 | ||
// this test sample contains a circular loop. It will stop after 15 iterations, having parsed 6887 lines | ||
func init() { //nolint | ||
testSample := TestCase{ | ||
Name: "should perform a valid scan and resolve references [E2E-CLI-095]", | ||
Args: args{ | ||
Args: []cmdArgs{ | ||
[]string{"scan", "-o", "/path/e2e/output", | ||
"--output-name", "E2E_CLI_095_RESULT", | ||
"-p", "\"/path/test/fixtures/resolve_circular_loop\"", | ||
"-i", "a88baa34-e2ad-44ea-ad6f-8cac87bc7c71", | ||
"--max-resolver-depth", "15", | ||
}, | ||
}, | ||
ExpectedResult: []ResultsValidation{ | ||
{ | ||
ResultsFile: "E2E_CLI_095_RESULT", | ||
ResultsFormats: []string{"json"}, | ||
}, | ||
}, | ||
}, | ||
WantStatus: []int{0}, | ||
} | ||
|
||
Tests = append(Tests, testSample) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.