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

[BUG] Latest govulncheck breaks action #33

Closed
srebhan opened this issue Mar 28, 2023 · 10 comments · Fixed by #34
Closed

[BUG] Latest govulncheck breaks action #33

srebhan opened this issue Mar 28, 2023 · 10 comments · Fixed by #34
Assignees
Labels
bug Something isn't working

Comments

@srebhan
Copy link

srebhan commented Mar 28, 2023

Using the latest govulncheck (v0.0.0-20230325131008-9550759f8614) breaks the action (Templum/[email protected]) as the output JSON format changed for govulncheck (likely in this commit).

Config:

name: govulncheck
on:
  push:
    branches:
      - master
  schedule:
    # Trigger every day at 16:00 UTC
    - cron: '0 16 * * *'
jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Scan for Vulnerabilities in Code
        uses: Templum/[email protected]
        with:
          go-version: '1.20'
          vulncheck-version: latest
          package: ./...

Logs:

2023-03-27T12:14:33.7129890Z 12:14PM INF GoEnvironment Details: GOPRIVATE= Go-Arch=amd64 Go-Os=linux Go-Version=go1.20.2
2023-03-27T12:14:33.7130490Z 12:14PM INF Running govulncheck for package ./... in dir /github/workspace
2023-03-27T12:16:01.8559000Z 12:16PM ERR parsing govulncheck output yielded error error="invalid character '{' after top-level value"
2023-03-27T12:16:01.8562263Z 12:16PM ERR Scanning yielded error error="scan failed to produce proper report"
2023-03-27T12:16:10.1737233Z Error: Process completed with exit code 2.

You can find the full output here.

Details:

The output format of govulncheck seemingly changed between golang.org/x/vuln/cmd/govulncheck@fd6b8605e1743f75db7cd8db18cc54c169edef6e (known good) and the current version, likely due to the commit above. Before the output was

{
        "Vulns": null
}

while the output of the latest version looks like this

{
  "preamble": {
    "go_version": "go1.20.2",
    "tool_version": "[email protected]",
    "db": "https://vuln.go.dev",
    "db_last_modified": "2023-03-27T17:34:34Z",
    "query_kind": "Source",
    "callstack_mode": "Compact"
  }
}
{
  "progress": "Scanning your code and 1929 packages across 415 dependent modules for known vulnerabilities..."
}
@Templum
Copy link
Owner

Templum commented Mar 28, 2023

@srebhan as govulncheck is still experimental such behaviours can be expected, that why in the last release of this action I tried to address this issue by updating the default value of this action to the last known working version.

Hence I suggest you avoid leveraging vulncheck-version: latest for the moment, not specifying it will leverage the default value.

@Templum
Copy link
Owner

Templum commented Mar 28, 2023

I will look into the latest changes and see how I can adjust the action so it works with the latest version. Thanks for looking into the upstream commits, that's very helpful. Until then I hope the various hints I left on the readme and the release should inform people about that risk. But given vulncheck-version is an optional parameter, I would not expect someone explicitly setting it.

Screenshot 2023-03-28 at 14 17 31

Screenshot 2023-03-28 at 14 17 22

@Templum
Copy link
Owner

Templum commented Mar 28, 2023

I will revisit the wording and make sure to make it clearer which version is working (removing latest) and further explaining that vulncheck-version should only be used if you want a specific version.

@srebhan
Copy link
Author

srebhan commented Mar 28, 2023

@Templum I noticed that we should use a defined version and did so. However, I wanted to let you know about the breakage with my findings... :-)

@Templum
Copy link
Owner

Templum commented Mar 28, 2023

@srebhan sorry seems like I understood that wrong :) Thanks for raising my awareness

@Templum
Copy link
Owner

Templum commented Apr 1, 2023

@srebhan would you be willing to give #34 a shot and see if there is any unforeseen issue? My smoke test & integration test are passing

@Templum
Copy link
Owner

Templum commented Apr 11, 2023

Will be included in the next release

@srebhan
Copy link
Author

srebhan commented Apr 14, 2023

Will try first week of May due to busy time and holidays. :-)

@Templum
Copy link
Owner

Templum commented Apr 25, 2023

@srebhan I release the change with v0.10.1, please let me know if you encounter any issues,

@srebhan
Copy link
Author

srebhan commented May 9, 2023

@Templum I can confirm this works for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants