Skip to content

chore: set go version for the osv scanner - #4941

Merged
zirain merged 1 commit into
envoyproxy:mainfrom
zhaohuabing:osv-scanner-go-version
Dec 17, 2024
Merged

zirain merged 1 commit into
envoyproxy:mainfrom
zhaohuabing:osv-scanner-go-version

Conversation

@zhaohuabing

Copy link
Copy Markdown
Member

No description provided.

@zhaohuabing
zhaohuabing requested a review from a team as a code owner December 17, 2024 02:31
@zhaohuabing
zhaohuabing marked this pull request as draft December 17, 2024 02:31
@zhaohuabing zhaohuabing changed the title set go version for osv scanner chore: set go version for the osv scanner Dec 17, 2024
@codecov

codecov Bot commented Dec 17, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.27%. Comparing base (469de2f) to head (0425358).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4941      +/-   ##
==========================================
- Coverage   66.27%   66.27%   -0.01%     
==========================================
  Files         209      209              
  Lines       32035    32035              
==========================================
- Hits        21231    21230       -1     
- Misses       9541     9543       +2     
+ Partials     1263     1262       -1     

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

@zhaohuabing
zhaohuabing force-pushed the osv-scanner-go-version branch from 9c4348f to 0425358 Compare December 17, 2024 02:44
@zirain
zirain marked this pull request as ready for review December 17, 2024 02:53
@zirain
zirain merged commit a9f6cd2 into envoyproxy:main Dec 17, 2024
@shahar-h

shahar-h commented Dec 17, 2024 •

Copy link
Copy Markdown
Contributor

@zhaohuabing installing go before running osv-scanner-action won't work since osv-scanner runs inside a container with pre-installed go version. Anyway the workflow is broken now after this change:
image

I opened an issue in osv-scanner repo that suggests to either release github-action image once a new go version is available or allow running osv-scanner on machine so one can install its own go version before running the scan.

Before this PR the scan failed on golang.org/x/crypto vulnerability in tools/src/buf/go.mod. I wonder if we really need to perform a recursive scan or only scan root go.mod. WDYT?

@zhaohuabing

zhaohuabing commented Dec 18, 2024 •

Copy link
Copy Markdown
Member Author

I opened an google/osv-scanner#1453 in osv-scanner repo that suggests to either release github-action image once a new go version is available or allow running osv-scanner on machine so one can install its own go version before running the scan.

@shahar-h Thanks for digging into this! This PR has been merged too early - it was a draft, and I was exploring the solutions.

Before this PR the scan failed on golang.org/x/crypto vulnerability in tools/src/buf/go.mod. I wonder if we really need to perform a recursive scan or only scan root go.mod. WDYT?

I think we need a recursive scan to make sure all the dependencies's license are accurate and compliant.

OSV scanner is quite troblesome, it brings additional maintainnce efforts for nearly every dependent bot updates. Any idea to improve this ? @envoyproxy/gateway-maintainers

@zhaohuabing
zhaohuabing deleted the osv-scanner-go-version branch December 18, 2024 02:16
@shahar-h

Copy link
Copy Markdown
Contributor

I opened an google/osv-scanner#1453 in osv-scanner repo that suggests to either release github-action image once a new go version is available or allow running osv-scanner on machine so one can install its own go version before running the scan.

@shahar-h Thanks for digging into this! This PR has been merged too early - it was a draft, and I was exploring the solutions.

Before this PR the scan failed on golang.org/x/crypto vulnerability in tools/src/buf/go.mod. I wonder if we really need to perform a recursive scan or only scan root go.mod. WDYT?

I think we need a recursive scan to make sure all the dependencies's license are accurate and compliant.

OSV scanner is quite troblesome, it brings additional maintainnce efforts for nearly every dependent bot updates. Any idea to improve this ? @envoyproxy/gateway-maintainers

  • Recursive scan is only done for vulnerabilities scan. For license scan only root go.mod is scanned since we don't care about licenses of dev packages.
    I wonder if we also need recursive vulnerabilities scan. I added it back then to prevent supply chain attacks, but on the other the scan also fails because of CVEs like this one which is only relevant for packages that are compiled with the released binary, not for packages used in dev / CI/CD.
  • Regarding the maintenance effort - we can omit the version field in PackageOverrides sections with the risk of package relicensing on version upgrade.
    package relicensing can occur both on minor release(i.e. terraform) or major release(i.e. grafana).
  • Currently call analysis doesn't work so there are many false positives in vulnerability scan since we use a newer go version than the one installed in osv-scanner-action image. One of osv-scanner maintainers agreed that it's a good idea to support running osv-scanner on host, thus allowing the consumer to pre-install its desired go version. Once it's supported we will have no false positives which will make the maintenance easier.

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.

3 participants