Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Severity #62

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Critical Severity #62

merged 3 commits into from
Jun 3, 2024

Conversation

RahulPidde23
Copy link

Changes
Critical severity feature for ADO plugin is supported.

Test Cases
Note - Test below cases with SAST 9.7,9.6,9.5 version

Case 1

  • Create a new Project with ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = disabled
    • Enable CxSAST Vulnerability Thresholds = disabled
    • Enable Project's Policy Enforcement = disabled

Check below points

  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 2

  • Run a scan with existing Project with ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = disabled
    • Enable CxSAST Vulnerability Thresholds = disabled
    • Enable Project's Policy Enforcement = disabled

Check below points

  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 3

  • Create a new/existing Project with (build no. 128) ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = Enabled
    • Enable CxSAST Vulnerability Thresholds = disabled
    • Enable Project's Policy Enforcement = disabled

Check below points

  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 4

  • Create a new/existing Project with (build no. 129) ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = disabled
    • Enable CxSAST Vulnerability Thresholds = disabled
    • Enable Project's Policy Enforcement = disabled

Check below points

  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 5

  • Create a new/existing Project with (build no. 129) ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = disabled
    • Enable CxSAST Vulnerability Thresholds = Enabled
    • Fail the build for new SAST vulnerabilities = disabled
    • Add critical, high , medium, low threshold
    • Enable Project's Policy Enforcement = disabled

Check below points

  • build will may fail/success with error messages like
    a. SAST critical severity results are above threshold. Results: 93. Threshold: 5
    b. SAST high severity results are above threshold. Results: 29. Threshold: 3
    c. SAST medium severity results are above threshold. Results: 179. Threshold: 2
    d. SAST low severity results are above threshold. Results: 213. Threshold: 1
  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 6

  • Create a new/existing Project with (build no. 129) ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = Disabled
    • Enable CxSAST Vulnerability Thresholds = Enabled
    • Fail the build for new SAST vulnerabilities = Enabled
    • Add critical, high , medium, low threshold
    • Enable Project's Policy Enforcement = disabled

Check below points

  • build will may fail/success with error messages like
    a. SAST critical severity results are above threshold. Results: 93. Threshold: 5
    b. SAST high severity results are above threshold. Results: 29. Threshold: 3
    c. SAST medium severity results are above threshold. Results: 179. Threshold: 2
    d. SAST low severity results are above threshold. Results: 213. Threshold: 1
  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

Case 7

  • Create a new/existing Project with (build no. 129) ->
    • Enable SAST scan - Enabled
    • Generate CxSAST PDF report - Enabled
    • Enable Dependency Scan = Disabled
    • Enable CxSAST Vulnerability Thresholds = Enabled
    • Fail the build for new SAST vulnerabilities = Disabled
    • Add critical, high , medium, low threshold
    • Enable Project's Policy Enforcement = Enabled

Check below points

  • build will may fail/success with error messages like
    a. Project policy status: violated
  • Critical severity results = 0 / any value(based on scanned project)
  • Open build -> Checkmarx -> Check critical vulnerabilities results and graph, click on Download PDF report and check Critical related count and vulnerability details.

@@ -500,6 +501,7 @@ CxSAST thresholds enabled: ${config.sastConfig.vulnerabilityThreshold}`);
if (config.sastConfig.vulnerabilityThreshold) {
this.log.info(`CxSAST fail build for new vulnerabilities enabled: ${config.sastConfig.failBuildForNewVulnerabilitiesEnabled}`);
this.log.info(`CxSAST fail build for the following severity or greater: ${config.sastConfig.failBuildForNewVulnerabilitiesSeverity}`);
this.log.info(`CxSAST critical threshold: ${formatOptionalNumber(config.sastConfig.criticalThreshold)}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the condition when SAST is 9.6 or below it should not log Critical Threshold in the logs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reading this we cannot check condition. As I discusses already with Fatima in UI CRITICAL dropdown and testbox will remain as it is for all SAST. Added information and warning message based on SAST version

Copy link

sonarqubecloud bot commented May 24, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
51.1% Duplication on New Code (required ≤ 5%)

See analysis details on SonarCloud

Copy link

@ThokalSameer ThokalSameer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@RahulPidde23 RahulPidde23 merged commit 8c6a8f4 into Q2_2024_Integration_Branch Jun 3, 2024
0 of 2 checks passed
@RahulPidde23 RahulPidde23 deleted the PLUG-1705 branch June 3, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants