Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65270

Assessment not marking stage as failed and failing pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None

      In a declarative pipeline I have a stage which submits 2 container images for assessment. If the threshold rule for vulnerabilities is met the pipeline is marked as failed. however, the step and stage still show as successful. The stage does not fail and the pipeline continues. When an assessment fails, both the step and stage should be marked as failed. The pipeline should stop and also marked as failed. Currently this does not happen.

      Here is the stage:

      stage('Assess') {
      	steps {
      		echo '=========== ^^^^^^^^^^^^ Assessing images...'
      		script {
      			assessContainerImage failOnPluginError: true,
      				imageId: "${env.imageIdApi}",
      				thresholdRules: [totalVulnerabilities(action: 'Fail', threshold: '1')],
      				nameRules: []
      			assessContainerImage failOnPluginError: true,
      				imageId: "${env.imageIdUi}",
      				thresholdRules: [totalVulnerabilities(action: 'Fail', threshold: '1')],
      				nameRules: []
      		}
      	}
      }
      

      And the resulting pipeline run:

            rapid7 Rapid7 User
            jwhitby Jonathan Whitby
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: