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

Use trivy rootfs scan for both local and remote #168

Merged
merged 64 commits into from
Aug 20, 2024
Merged

Conversation

partkyle
Copy link
Contributor

@partkyle partkyle commented Aug 13, 2024

This adds support for both the local package and remote registry scanner to use trivy rootfs to scan the entire filesystem of a container.

The local version will extract a zarf package and use the images/index.json file to find the available containers, extract each layer into a directory, and then perform trivy rootfs

The remote version will write the remote image to a local directory using github.com/google/go-containerregistry/pkg/v1/layout, and then modify it to behave exactly the same as the local package so we can use the same process for scanning the remote images.

We also now only scan for 1 platform: amd64. Previously the results of amd64 and arm64 were concatenated together, giving double results in most cases.

This resolves the following issues:

There is an adr attached for more implementation details.

Copy link

github-actions bot commented Aug 13, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
gomod/oras.land/oras-go/v2 2.5.0 🟢 7.1
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 94 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 9
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Packaging⚠️ -1packaging workflow not detected
Security-Policy🟢 9security policy file detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Fuzzing⚠️ 0project is not fuzzed
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 10SAST tool is run on all commits

Scanned Manifest Files

go.mod
  • oras.land/oras-go/v2@2.5.0
  • github.com/docker/distribution@2.8.3+incompatible
  • github.com/vbatts/tar-split@0.11.5

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 67.27749% with 125 lines in your changes missing coverage. Please review.

Project coverage is 63.78%. Comparing base (f9af02c) to head (79ef5a7).
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/scan/rootfs.go 62.90% 28 Missing and 18 partials ⚠️
pkg/scan/remote_scanner.go 68.59% 28 Missing and 10 partials ⚠️
pkg/scan/sbom.go 59.45% 15 Missing and 15 partials ⚠️
pkg/scan/local_scan.go 56.00% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   63.66%   63.78%   +0.12%     
==========================================
  Files          23       26       +3     
  Lines        1387     1541     +154     
==========================================
+ Hits          883      983     +100     
- Misses        316      356      +40     
- Partials      188      202      +14     

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

Copy link
Member

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

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

Thank you!

cmd/store/e2e_test.go Show resolved Hide resolved
docs/adrs/0001-rootfs-scanning.md Outdated Show resolved Hide resolved
pkg/scan/rootfs.go Show resolved Hide resolved
@partkyle partkyle merged commit fb5d309 into main Aug 20, 2024
11 of 13 checks passed
@partkyle partkyle deleted the partkyle/rootfs-scan branch August 20, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants