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

Reject pull requests that change imported licenses #3996

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

cbandy
Copy link
Member

@cbandy cbandy commented Sep 17, 2024

We import dependencies that use a handful of open-source licenses. We want to be intentional about any change to these licenses, so this automation flags pull requests that do so.

Go modules are immutable, so checking during pull requests and pushes should suffice.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Testing enhancement
  • Other

Other Information:

Issue: PGO-1556

trivy.yaml Outdated Show resolved Hide resolved
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@cbandy cbandy force-pushed the dependencies branch 2 times, most recently from c7e4383 to a19c89a Compare September 18, 2024 02:45
We import dependencies that use a handful of open-source licenses.
We want to be intentional about any change to these licenses, so this
automation flags pull requests that do so.

Go modules are immutable, so checking during pull requests and pushes
should suffice.

Issue: PGO-1556
@cbandy
Copy link
Member Author

cbandy commented Sep 18, 2024

Here's what it looks like when a license is not in the configured list: https://github.com/CrunchyData/postgres-operator/actions/runs/10914660621/job/30293145553?pr=3996

#
# https://aquasecurity.github.io/trivy/latest/docs/scanner/license/
license:
ignored:
Copy link
Contributor

Choose a reason for hiding this comment

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

So right now we're telling Trivy to ignore these licenses; if another license shows up that's not in this list, we'll get an alert because the job is configured with --exit-code=1: any license at any level -- Forbidden, Restricted, Unencumbered, et al. -- will alert if it is not ignored, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Every license that Trivy recognizes has a severity, and this job alerts on all severities.

We'll also be alerted if Trivy can't detect the license. Those get a severity of UNKNOWN.

@cbandy cbandy merged commit 1b1b92b into CrunchyData:master Sep 18, 2024
14 checks passed
@cbandy cbandy deleted the dependencies branch September 18, 2024 20:00
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.

2 participants