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 trivy scanning to PR reports #10758

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

dereknola
Copy link
Contributor

@dereknola dereknola commented Aug 27, 2024

Proposed Changes

Once this is merged, it allows user to comment /trivy on a PR to trigger a build of K3s and a trivy report
image

The report is run on an internal GHA
image

And eventually, the comment edited and replaced with the report
image

Types of Changes

CI

Verification

Verified on dereknola#25

Testing

N/A

Linked Issues

User-Facing Change


Further Comments

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.43%. Comparing base (85e02e1) to head (99424dd).

❗ There is a different number of reports uploaded between BASE (85e02e1) and HEAD (99424dd). Click for more details.

HEAD has 13 uploads less than BASE
Flag BASE (85e02e1) HEAD (99424dd)
unittests 1 0
inttests 10 0
e2etests 7 5
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10758       +/-   ##
===========================================
- Coverage   49.59%   36.43%   -13.16%     
===========================================
  Files         178      161       -17     
  Lines       14753    14262      -491     
===========================================
- Hits         7317     5197     -2120     
- Misses       6091     8036     +1945     
+ Partials     1345     1029      -316     
Flag Coverage Δ
e2etests 36.43% <ø> (-9.42%) ⬇️
inttests ?
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Derek Nola <derek.nola@suse.com>
run: |
echo '```' | cat - trivy-report.txt > temp && mv temp trivy-report.txt
echo '```' >> trivy-report.txt
gh issue comment ${{ github.event.issue.number }} --edit-last -F trivy-report.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

just out of curiosity - does this edit the last comment by the current user, or the last comment on the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It edits the last comment made by the user on that issue, in this case the user is the "github-actions bot"

@harsimranmaan
Copy link
Contributor

Does this cover the entire airgap bundle or just the binary? There are generally more findings in the packaged images than k3s itself

@brandond
Copy link
Contributor

Just binaries built by or included in this repo. Basically anything in the rancher/k3s image. Scanning the mirrored images is handled elsewhere.

@dereknola dereknola merged commit fa6940d into k3s-io:master Aug 30, 2024
2 checks passed
@dereknola dereknola deleted the trivy_scan branch August 30, 2024 16:25
brandond pushed a commit to brandond/k3s that referenced this pull request Sep 5, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Sep 5, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Sep 5, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Sep 5, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Sep 6, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Sep 6, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Sep 6, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Sep 6, 2024
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit fa6940d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
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.

4 participants