Skip to content

Integrate Trivy into workflows#285

Merged
nipunayf merged 7 commits intoballerina-platform:mainfrom
nipunayf:add-trivy
Sep 6, 2025
Merged

Integrate Trivy into workflows#285
nipunayf merged 7 commits intoballerina-platform:mainfrom
nipunayf:add-trivy

Conversation

@nipunayf
Copy link
Contributor

@nipunayf nipunayf commented Sep 6, 2025

Purpose

This PR introduces the Trivy scanner for two scenarios in the CI/CD pipeline:

  1. Runs daily to detect all vulnerabilities.
  2. Runs before release and fails if any high or critical vulnerabilities are found.

Since we create a single uber JAR and do not have each dependent JAR in the file system, traditional file scanning is not feasible (like we did in other repos). Instead, we use cyclonedxBom to generate the SBOM and run Trivy against it.

Fixes wso2/product-ballerina-integrator#506

Copilot AI review requested due to automatic review settings September 6, 2025 15:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates Trivy vulnerability scanning into the CI/CD pipeline to enhance security by detecting vulnerabilities in dependencies. The implementation includes both daily scheduled scans for comprehensive vulnerability detection and pre-release scans that fail on high/critical vulnerabilities.

  • Adds CycloneDX BOM plugin for generating SBOMs since traditional file scanning isn't feasible with uber JARs
  • Creates a dedicated Trivy workflow for daily vulnerability scanning
  • Integrates Trivy scanning into the release workflow with severity filtering

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
gradle.properties Adds CycloneDX BOM plugin version for SBOM generation
.github/workflows/trivy.yml New workflow for daily Trivy vulnerability scanning
.github/workflows/publish-release.yml Integrates Trivy scanning into release process with high/critical severity filtering

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nipunayf nipunayf changed the title Integrate Trivy into Workflows Integrate Trivy into workflows Sep 6, 2025
@nipunayf nipunayf merged commit ed7e956 into ballerina-platform:main Sep 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Trivy scanner to the ballerina-language-server repository

3 participants