Skip to content

Re-enable license scan using trivy CLI directly instead of trivy-action#849

Open
mendral-app[bot] wants to merge 3 commits intomainfrom
mendral/reenable-license-scan
Open

Re-enable license scan using trivy CLI directly instead of trivy-action#849
mendral-app[bot] wants to merge 3 commits intomainfrom
mendral/reenable-license-scan

Conversation

@mendral-app
Copy link
Contributor

@mendral-app mendral-app bot commented Mar 16, 2026

Summary

  • Re-enables license scanning in CI which was fully disabled as a workaround for aquasecurity/trivy-action not correctly applying ignore files during license scans
  • Replaces the commented-out trivy-action step with a direct trivy fs CLI invocation that reliably respects .trivyignore.yaml, ensuring the reviewed n8n package licenses (SEE LICENSE IN LICENSE.md) are properly suppressed
  • Installs Trivy via the official apt repository in the test job since the runner (ubuntu-22.04) doesn't have it pre-installed

What changed

In .github/workflows/make.yaml (test job):

  • Removed the commented-out aquasecurity/trivy-action block (lines 187-195)
  • Added an "Install Trivy" step using the official Trivy apt repository
  • Added a "Scan licenses" step running trivy fs . --scanners license --severity UNKNOWN,HIGH,CRITICAL --exit-code 1 --ignorefile .trivyignore.yaml

Why

The trivy-action GitHub Action wrapper has known issues with ignore file handling for license scanning. The direct CLI invocation correctly processes .trivyignore.yaml, which contains the approved exception for n8n packages with SEE LICENSE IN LICENSE.md licenses.

Without this fix, no license scanning was running in CI at all — any new dependency with a problematic license would go undetected.


Note

Created by Mendral. Tag @mendral-app with feedback or questions.


Summary by cubic

Re-enables CI license scanning by replacing aquasecurity/trivy-action with a direct trivy fs run that honors .trivyignore.yaml. Adds a Rego policy to allow CC-BY-SA-4.0 only for internal @probo/vendors, keeping failures for third‑party packages.

  • Bug Fixes
    • Install trivy from the official apt repo in the test job on ubuntu-22.04.
    • Run trivy fs with --scanners license, --severity UNKNOWN,HIGH,CRITICAL, --exit-code 1, --ignorefile .trivyignore.yaml, and --ignore-policy .trivy-license-policy.rego.

Written for commit 9c9fab3. Summary will update on new commits.

@mendral-app mendral-app bot requested a review from gearnode March 16, 2026 07:30
@mendral-app mendral-app bot marked this pull request as ready for review March 16, 2026 07:46
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".trivyignore.yaml">

<violation number="1" location=".trivyignore.yaml:10">
P2: This exception is broader than the comment suggests: it ignores all `CC-BY-SA-4.0` findings from `package-lock.json`, not just `@probo/vendors`. That weakens the re-enabled license scan by hiding future third-party packages with the same license.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/make.yaml">

<violation number="1" location=".github/workflows/make.yaml:201">
P1: This policy hook won't suppress the `@probo/vendors` finding because the Rego rule matches `CC-BY-SA-4.0`, while the lockfile license string is `CC BY-SA 4.0`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

mendral-app bot added 3 commits March 17, 2026 15:01
The aquasecurity/trivy-action wrapper has known issues applying ignore files
for license scans. Replace the commented-out trivy-action step with a direct
trivy fs CLI invocation, which reliably respects the .trivyignore.yaml file.

This installs trivy via the official apt repository and runs the license scan
with UNKNOWN,HIGH,CRITICAL severity, exit-code 1 for failures, and the
existing .trivyignore.yaml to suppress the reviewed n8n package licenses.
The re-enabled license scan correctly flagged @probo/vendors with a
CC-BY-SA-4.0 license. Since this is an internal package owned by the
same organization, the license is acceptable for our use case.
The .trivyignore.yaml format doesn't support package-level scoping — the
previous CC-BY-SA-4.0 exception applied to all packages in package-lock.json.

Replace the broad ignore rule with a Rego policy that only ignores
CC-BY-SA-4.0 for the @probo/vendors package, ensuring future third-party
packages with the same license are still flagged.
@SachaProbo SachaProbo force-pushed the mendral/reenable-license-scan branch from 30eb032 to 9c9fab3 Compare March 17, 2026 14:01
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.

1 participant