Skip to content
| Marketplace
Sign in
Azure DevOps>Azure Pipelines>Vulnerability Reports & Quality Gates
Vulnerability Reports & Quality Gates

Vulnerability Reports & Quality Gates

Abner Pitinga

|
1 install
| (0) | Free
Consolidate vulnerability scan results, generate security reports, inspect pipeline variables and enforce fix-aware quality gates.
Get it free

Vulnerability Reports & Quality Gates

Independent Azure Pipelines tasks for consolidating native vulnerability reports, inspecting pipeline variables, and enforcing a fix-aware severity policy. No scanner, Docker, PowerShell, Bash or external vulnerability API is required by these tasks. Trivy and Grype extensions are independent, optional report producers.

Version: 0.2.2 · Publisher: pitinga · License: MIT · Runtime: Node 24 (agent 4.265.1 or newer).

Quick start

Create native JSON reports using Trivy, Grype, or both. Use a fresh output directory, and do not enable scanner failure thresholds that would stop the pipeline before report consolidation. The callers are responsible for selecting corresponding reports; this extension does not verify that targets or image IDs match.

- task: VulnerabilityReports@0
  inputs:
    trivyReport: '$(Build.ArtifactStagingDirectory)/security-reports/trivy.json'
    grypeReport: '$(Build.ArtifactStagingDirectory)/security-reports/grype.json'
    outputDirectory: '$(Build.ArtifactStagingDirectory)/security-reports'
    showVulnerabilities: true

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)/security-reports'
    ArtifactName: security-reports

- task: VulnerabilityQualityGate@0
  inputs:
    failOn: 'HIGH'
    warningOn: 'UNKNOWN'

- task: VulnerabilityVariables@0
  condition: succeededOrFailed()

Publish artifacts before the gate so policy failures retain evidence. The Show task can run after a failed gate for diagnostics. Do not use succeededOrFailed() on a publication step intended to be blocked by a failure. For a subsequent image push, use a condition such as:

condition: and(succeeded(), eq(variables['VULNERABILITY_REPORT_COMPLETED'], 'true'), eq(variables['VULNERABILITY_GATE_FAILED'], 'false'))

VulnerabilityReports@0

Input Required Default Description
trivyReport At least one report Empty Path to native Trivy JSON schema 2.
grypeReport At least one report Empty Path to native Grype JSON.
outputDirectory No security-reports Output directory relative to the task's current working directory, or an absolute path.
showSummary No true Display consolidated counts and fix availability.
showVulnerabilities No false Display the complete consolidated vulnerability table.

Both report inputs may be used together, or either may be omitted. An explicitly supplied missing or invalid file is an error. Both omitted is an error. Native empty vulnerability lists are supported. All four outputs are generated regardless of the Show switches:

Output Contents
vulnerabilities.json SchemaVersion 4: consolidated findings, source evidence, aliases, locations and severity/fix counts.
vulnerabilities.md Complete standalone Markdown report.
vulnerabilities.html Standalone HTML report with severity colors and CVE/GHSA links.
vulnerabilities.csv Consolidated tabular export.

The report refuses to overwrite existing files. The native JSON files are never changed. Reported findings are deduplicated by normalized vulnerability ID, component identity, version, ecosystem, category and architecture; locations are aggregated. Explicit unambiguous CVE aliases are used; distinct CVEs are not merged. The highest scanner severity wins. NEGLIGIBLE maps to UNKNOWN. All distinct reported fixed versions are retained, without semver comparison or automatic upgrade selection. Package categories are heuristic. Source image identifiers are optional informational fields, not proof of a shared scan target. A reported fixed version is not a guarantee of availability or compatibility. An unreported fix does not prove that remediation is impossible.

The report task automatically sets 18 read-only pipeline variables and attaches a compact Markdown summary in Extensions and the complete JSON in Vulnerabilities using Azure logging commands. It marks itself SucceededWithIssues whenever any findings exist, even when a later Quality Gate permits publication. Zero findings succeeds. Operational failures fail without emitting a completion marker. It does not evaluate the gate or publish artifacts to storage; use a separate artifact task. The final script log line identifies the Vulnerabilities tab and the summary in Extensions.

VulnerabilityQualityGate@0

Input Default Description
failOn NONE Fail if a finding meets or exceeds the threshold and that same finding has a reported fixed version.
warningOn UNKNOWN Warn if any finding meets or exceeds the threshold.

Accepted values: NONE, CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN. NONE disables its configured threshold; UNKNOWN includes all findings. Findings at or above the failure threshold with no reported fix generate warnings even if the warning threshold is NONE or stricter. Warning counts are the union of explicit and additional warnings, without double counting. Failure takes precedence. The gate validates the report variables before calculating policy and sets four read-only gate variables. It emits a failed exit status for a blocked policy or an operational error; warnings complete with SucceededWithIssues.

Example: with failOn: HIGH, four HIGH findings without fixes do not block, even if a LOW finding has a fix. A single HIGH finding with a reported fix blocks. A CRITICAL finding without a reported fix is warned, not automatically blocked, by this policy. Use organizational risk controls if that is unacceptable.

VulnerabilityVariables@0

Renamed from ShowVulnerabilityVariables@0 in 0.1.1; update the YAML task name. The task GUID, inputs and variable contract are unchanged.

Input Default Description
validate false If true, require a complete consistent report variable contract and validate all four gate variables when any are present.

Displays only known, defined, nonempty VULNERABILITY_ variables. Before the gate, displays 18 report variables; after the gate, displays up to 22. Partial or missing values are allowed by default. With validate: true, missing or inconsistent required counters fail the task; the entire gate block is optional. This task never sets variables, changes policy, or generates reports.

Pipeline variable contract

All values are strings; boolean values use lowercase true and false. One report task and one gate per job are supported by this fixed, read-only variable namespace. Multiple independent targets need separate jobs. All 22 variables are emitted in both forms: unqualified read-only job variables (existing syntax) and read-only task outputs (isOutput=true). Give each producing step a YAML name to reference its outputs. No task inputs or failure policy change. No legacy SECURITY_ aliases are emitted.

Variable Producer Meaning
VULNERABILITY_CRITICAL_COUNT Reports Critical findings
VULNERABILITY_HIGH_COUNT Reports High findings
VULNERABILITY_MEDIUM_COUNT Reports Medium findings
VULNERABILITY_LOW_COUNT Reports Low findings
VULNERABILITY_UNKNOWN_COUNT Reports Unknown findings
VULNERABILITY_TOTAL_COUNT Reports Total findings
VULNERABILITY_CRITICAL_FIXABLE_COUNT Reports Critical findings with a reported fix
VULNERABILITY_HIGH_FIXABLE_COUNT Reports High findings with a reported fix
VULNERABILITY_MEDIUM_FIXABLE_COUNT Reports Medium findings with a reported fix
VULNERABILITY_LOW_FIXABLE_COUNT Reports Low findings with a reported fix
VULNERABILITY_UNKNOWN_FIXABLE_COUNT Reports Unknown findings with a reported fix
VULNERABILITY_SYSTEM_PACKAGE_COUNT Reports System package findings
VULNERABILITY_OTHER_COMPONENT_COUNT Reports Other component findings
VULNERABILITY_FIXABLE_COUNT Reports Findings with a reported fixed version
VULNERABILITY_UNFIXABLE_COUNT Reports Findings without a reported fixed version
VULNERABILITY_FOUND Reports Whether total is nonzero
VULNERABILITY_MAX_SEVERITY Reports Highest severity, or NONE
VULNERABILITY_REPORT_COMPLETED Reports True only after successful output generation; published last
VULNERABILITY_GATE_FAIL_ON Gate Configured failure threshold
VULNERABILITY_GATE_WARN_ON Gate Configured warning threshold
VULNERABILITY_GATE_FAILED Gate Whether the fix-aware failure threshold was met
VULNERABILITY_GATE_WARNED Gate Whether the warning policy was met

FIXABLE and UNFIXABLE describe scanner-reported fix availability, not an assurance of actual remediation or lack thereof. Counters are validated before evaluating the gate. The report JSON retains the existing SchemaVersion 4 field names (HasFix, WithFix, WithoutFix) for compatibility with report readers; the new naming applies to pipeline variables.

Use output variables across jobs and stages

Name the producing steps, for example name: vulnerabilityReports and name: securityGate. Existing same-job references such as $(VULNERABILITY_GATE_FAILED) continue to work. Named outputs in the same job use $(securityGate.VULNERABILITY_GATE_FAILED).

For a dependent approval job in the same stage:

# In the producer job (buildApp), after successful report consolidation:
- task: VulnerabilityQualityGate@0
  name: securityGate
  inputs:
    failOn: CRITICAL
    warningOn: UNKNOWN
  continueOnError: true
# At job scope, in the same stage:
- job: VulnerabilityApprovalGate
  dependsOn: buildApp
  condition: and(succeeded(), eq(dependencies.buildApp.outputs['securityGate.VULNERABILITY_GATE_FAILED'], 'true'))
  pool: server
  timeoutInMinutes: 10
  steps:
  - task: ManualValidation@1
    timeoutInMinutes: 5
    inputs:
      notifyUsers: ''
      instructions: Review the Vulnerabilities tab before approving.
      onTimeout: reject

Configure the appropriate approvers and notifications for your organization. A policy violation publishes all four gate outputs before the task exits with failure. The native Azure Pipelines continueOnError: true option allows the dependent approval job to run. With this policy, a CRITICAL finding without a reported fix warns but does not require approval. With failOn: NONE, the gate cannot trigger policy approval. Technical failures may also be tolerated by continueOnError; they do not publish a valid gate decision. Do not treat an absent output as approval. Downstream release jobs should require a valid report completion output, a gate decision equal to false or a gate decision equal to true with successful manual approval, and successful prerequisite jobs. See output variable documentation.

For a job in a downstream stage, declare the stage dependency and map the output using a runtime expression, for example:

variables:
  gateFailed: $[ stageDependencies.Build.buildApp.outputs['securityGate.VULNERABILITY_GATE_FAILED'] ]
  reportCompleted: $[ stageDependencies.Build.buildApp.outputs['vulnerabilityReports.VULNERABILITY_REPORT_COMPLETED'] ]

For stage-level conditions use dependencies.Build.outputs['buildApp.securityGate.VULNERABILITY_GATE_FAILED']. Output variables are available to dependent jobs and stages; declare dependencies explicitly.

The tasks emit the scoped output before the unqualified read-only variable. This order avoids the agent's read-only name check on the second command. Do not declare these names as manifest outputVariables, because the agent would then scope both commands and remove the existing unqualified variables.

Development and packaging

Use Node 24. Runtime tasks have no third-party npm dependencies; TypeScript and tfx-cli are development tools. The source ZIP includes compiled task JavaScript. Install development dependencies from the reviewed lockfile, then build and test:

npm ci --ignore-scripts
npm run verify:lock
npm run test:coverage
npm run verify:manifest
npm audit --audit-level=low
npm run package:vsix
python3 tools/verify-vsix.py

CI uses Node 24 on Linux, Windows and macOS and installs the committed lockfile with npm ci. It checks dependency registry URLs and integrity metadata, audits dependencies, runs tests, validates the packaged VSIX, and generates a SHA-256 checksum. GitHub Releases are created only after all required jobs pass for an explicitly authorized release commit or a matching version tag. The CI workflow does not publish to Marketplace. Coverage uses Node's built-in test runner on Linux with canonical compiled modules and independent LCOV validation; all task modules and entry points must meet 100% line, branch and function coverage.

The console presentation uses white horizontal rules, bold white totals, severity icons/colors, and no green for findings. NO_COLOR disables ANSI sequences. Actual rendering is agent/viewer-dependent.

See VALIDATION.md for executed checks and outstanding validation. Install the extension from the Visual Studio Marketplace.

Regression test matrix

The automated suite generates native Trivy and Grype JSON reports from synthetic data, covering three input combinations (Trivy only, Grype only, both), five vulnerability profiles, and all four combinations of the console display switches. The 60 task-level cases verify the four reports, per-finding identity and fix versions, severity totals, pipeline variables, attachment commands, warning results and unchanged inputs. Additional tests cover distinct ecosystems, installed versions and architectures, duplicate records and locations, local execution and invalid second inputs. The original policy suite evaluates 216 threshold combinations.

Optional private regression: extract your own native trivy.json, grype.json and previously verified vulnerabilities.json into a directory outside the repository. Set the VULNERABILITY_TEST_FIXTURES environment variable to that directory, then run npm test. The private test checks per-finding equivalence, single-scanner counts and six mutations (reverse order, duplicate records, no reported fixes, all fixes reported, unknown severity and empty reports). Without the variable, this test is skipped in public CI. Never commit actual organization reports or target identifiers.

Coverage methodology and regression gates

npm test executes the real, independently packaged tasks without interception on all three CI operating systems. npm run test:coverage reruns the suite under Node 24's native V8 test coverage. A test-only preload maps byte-identical packaged CommonJS modules to their canonical build/*.js paths. The runner first checks every compiled module against every packaged copy and proves the mapping works; it then requires exactly one coverage row per compiled source module and includes each task entry point. This preserves coverage from child process integration tests without counting each copy as a separate module. This is compiled-JavaScript coverage, not TypeScript source-map coverage. The coverage run fails below 100% lines, branches or functions overall or in any individual measured module or entry point. Normal packaging and runtime resolution are unchanged. CI retains the human-readable output, LCOV and a machine-readable JSON summary with exact covered/total counts. The coverage verifier rejects duplicate, missing or unexpected measured files and independently enforces the per-file and aggregate floors using LCOV counts. These metrics describe executed compiled code, not proof of correctness. No new npm dependencies are required.

The extended test suite includes cross-scanner package ecosystem normalization, aliases and evidence, invalid input structures, every required counter, inconsistent gate flags, 3,600 independently evaluated deterministic policy cases, CSV cell validation, log injection/escaping, output collision/rollback, CLI defaults, ANSI rendering, and a 2,500-finding duplicate-input stress fixture. Only synthetic data is committed; private fixtures remain optional.

Report generation coverage

src/reports.ts (measured as the canonical build/reports.js) has an enforced 100% minimum for lines, branches and functions. tests/reports.test.cjs verifies nullable display values, all four write-failure positions, rollback cleanup failure preserving the original error, a competing writer after preflight, and byte-for-byte saved output in both standalone and Azure attachment modes. The null/undefined cases deliberately exercise the defensive renderer boundary; normal consolidation supplies strings. The ordinary uninstrumented integration tests and existing coverage floors remain mandatory.

Complete coverage target

tests/coverage-edges.test.cjs adds local execution without TF_BUILD, TTY/NO_COLOR combinations, architecture tie-breaking, the full 25-pair severity matrix in both input orders, and explicit empty output directory handling. The internal highest-severity calculation uses a reducer starting at UNKNOWN, equivalent for normalized findings, rather than a redundant unreachable fallback after searching for a normalized severity. No public task contract changes. CI enforces 100% line, branch and function coverage per measured file and in aggregate; no exclusions or ignore annotations were added.

Marketplace Trusted Publishing (manual)

The publish-public.yml workflow uses Node 24 and requests a short-lived Marketplace credential through GitHub OIDC. It is restricted to main and the marketplace-production GitHub environment. No PAT or repository secret is required.

Mode Purpose
publish-oidc (default) Submit the explicitly approved GitHub Release VSIX to Marketplace
oidc-probe Verify the OIDC exchange without looking up or publishing any extension

Publisher policy:

Field Value
Publisher pitinga
Policy name Vulnerability Reports & Quality Gates
Repository owner pitinga
Repository azure-pipelines-tasks-vulnerability-reports
Workflow publish-public.yml
Environment marketplace-production

The real OIDC probe succeeded in workflow run 47262800960. Restrict the GitHub environment deployments to main.

Publication is manual only. The release approval record .github/marketplace-release.json pins the approved version, its exact source commit, successful CI run and VSIX SHA-256. The workflow installs and audits the locked TFX CLI, checks GitHub release/tag/CI provenance, downloads the original VSIX and checksum, checks the archive and all three task manifests, and rechecks the digest before using the short-lived credential. No rebuild or PAT fallback is permitted. A future release requires an updated, reviewed approval record.

The initial extension does not need to exist in Marketplace before publication; TFX handles initial creation. The workflow uses the PAT transport selector only for the federated temporary credential. Raw CLI output is suppressed; submission must return confirmed JSON success. A failed or ambiguous submission is not retried automatically. Check Marketplace before retrying. Submission acceptance does not imply Microsoft security verification or public availability. The GitHub Release is unchanged.

Normal CI includes mocked publication tests and read-only verification of the approved release. The real write operation is only exercised when an authorized user manually selects publish-oidc.

Report presentation

The Markdown report uses separate vulnerability summary, component/remediation and detailed findings sections, bold totals and a final methodology section. The Azure DevOps attachment uses portable Markdown rather than embedded HTML/CSS; the standalone HTML report provides explicit cell padding, borders, alternating rows, accessible table headings and responsive layout. No fix reported means neither supplied scanner reported a fixed version; it is a display label in the logs, Markdown and HTML, not a claim that a fix does not exist. JSON and CSV retain their machine-readable values and the quality gate contract is unchanged.

Complementary security extensions

Generate native JSON vulnerability reports with either scanner below, or use both for independent scanning and consolidated reporting.

Extension Purpose Links
Trivy - Installer & Scanner Scan container images and other supported targets with Trivy. Marketplace · GitHub
Grype - Installer & Scanner Scan vulnerabilities with Grype and install Syft for SBOM workflows. Marketplace · GitHub

Reports from the standalone Trivy and Grype CLIs are also supported. All three extensions can be installed independently.

Explore more extensions by pitinga

Extension Purpose Links
Azure Repos Git - Tasks Automate Azure Repos Git operations in Azure Pipelines. Marketplace · GitHub
Database Migration Tasks for Flyway OSS Install, execute and audit Flyway OSS migrations. Marketplace · GitHub

Complete extension catalog · View all Marketplace extensions · GitHub projects

Vulnerabilities tab

The extension adds a build-results tab for runs containing VulnerabilityReports@0. The task attaches its existing SchemaVersion 4 JSON to the run and adds a compact Extensions summary with the target, severity totals, component totals and directions to the full Vulnerabilities tab. The four exported report files remain complete. No extra YAML inputs, PAT, external service or artifact task is required. The new vso.build scope permits read-only build access and may require administrator approval when updating. Multiple report attachments are selectable independently; totals are not merged across jobs. The viewer validates counts, uses safe text rendering, offers search, filters, sortable columns and pagination. Older runs without JSON attachments keep their Markdown report. The tab loads automatically; Retry is available only on report-loading errors. Pagination above and below the table stays synchronized. See docs/TAB-VALIDATION.md for the validation record and known limitations.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft