Skip to content

CI: improve the OSV scanner to reduce the maintenance burden #4945

Closed

Description

@zhaohuabing
  • 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 [GitHub Action] Call analysis doesn't work for go projects with go version > 1.22.8 google/osv-scanner#1453 (comment) 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.

originally posted by @shahar-h on #4941 (comment)

Activity

  1. added
    area/ci
    help wanted
    and removed on Dec 18, 2024
  2. zhaohuabing commented on Dec 18, 2024

    @zhaohuabing
    MemberAuthor

    @shahar-h Let's continue the discussion here.

  3. shahar-h commented on Dec 24, 2024

    @shahar-h
    Contributor
  4. shahar-h commented on Aug 12, 2025

    @shahar-h
    Contributor

    The issue in deps.dev has been resolved. The current license violation state:

    Image

    All of the violations(except github.com/go-sql-driver/mysql which has CNCF exception) are related to tool dependencies(github.com/golangci/golangci-lint/v2 and github.com/norwoodj/helm-docs).
    The problem is that osv-scanner can't tell if a given indirect dependency is related to a tool.
    I suggest to create a separate go.mod for tools - e.g. tools/go.mod. Then we can run the tools with go tool -modfile=tools/go.mod.
    This approach will also help to avoid cases like (2) here.
    @zhaohuabing WDYT?

  5. shahar-h commented on Aug 12, 2025

    @shahar-h
    Contributor
  6. zirain commented on Aug 12, 2025

    @zirain
    Member

    sounds good

  7. added this to the v1.6.0 Milestone milestone on Aug 12, 2025
  8. shahar-h commented on Aug 20, 2025

    @shahar-h
    Contributor

    See #6824.
    Will open a followup PR to cleanup osv-scanner license scan config, add exclusions if needed and make it blocking again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cihelp wanted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions