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

add vulnerability scanning github action #11096

Merged
merged 19 commits into from
Nov 3, 2023
Merged

Conversation

trevorwhitney
Copy link
Collaborator

@trevorwhitney trevorwhitney commented Oct 31, 2023

What this PR does / why we need it:

Adds a GitHub action that will run snyk and trivy scans against PRs and publish the results as a comment on the PR.

Examples of what the comments will look like can be seen on this PR. It will only add a single comment for each scanner in the future, this one has multiples because of some of the iterations it went though.

@trevorwhitney trevorwhitney requested a review from a team as a code owner October 31, 2023 16:51
Copy link
Contributor

github-actions bot commented Oct 31, 2023

Trivy scan found the following vulernbilities:

@trevorwhitney trevorwhitney marked this pull request as draft October 31, 2023 16:59
Copy link
Contributor

github-actions bot commented Oct 31, 2023

Snyk scan found the following vulnerabilities:

  • high - [CVE-2022-21698] Allocation of Resources Without Limits or Throttling in go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0. Fixed in ["0.44.0"]
  • high - [CVE-2023-45142] Allocation of Resources Without Limits or Throttling in go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0. Fixed in ["0.44.0"]
  • high - [CVE-2022-21698] Allocation of Resources Without Limits or Throttling in go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0. Fixed in ["0.44.0"]
  • high - [CVE-2023-45142] Allocation of Resources Without Limits or Throttling in go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0. Fixed in ["0.44.0"]

Copy link
Contributor

github-actions bot commented Oct 31, 2023

Trivy scan found the following vulnerabilities:

@trevorwhitney trevorwhitney marked this pull request as ready for review October 31, 2023 21:30
Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

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

LGTM. thanks @trevorwhitney. Just one non-blocking clarification.

SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test
args: --severity-threshold=high --json-file-output=snyk.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: rationale behind high value here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thought was to reduce noise by only showing high and above. I need to add that to the trivy action as well. would you prefer we make it medium? remove completely?

@pull-request-size pull-request-size bot added size/L and removed size/M labels Nov 3, 2023
@pull-request-size pull-request-size bot added size/M and removed size/L labels Nov 3, 2023
@trevorwhitney trevorwhitney enabled auto-merge (squash) November 3, 2023 17:55
@trevorwhitney trevorwhitney merged commit 060600c into main Nov 3, 2023
7 checks passed
@trevorwhitney trevorwhitney deleted the vuln-scan-gh-actions branch November 3, 2023 18:03
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Adds a GitHub action that will run `snyk` and `trivy` scans against PRs
and comment on the PR if a high or critical vulnerability is found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants