aquasecurity / trivy-vscode-extension

A VS Code Extension for Trivy
https://marketplace.visualstudio.com/items?itemName=AquaSecurityOfficial.trivy-vulnerability-scanner
Apache License 2.0
109 stars 18 forks source link

Trivy extension for VSCode throws a scan error, says to check logs, but logs are empty #22

Open pcgeek86 opened 2 years ago

pcgeek86 commented 2 years ago

Environment

Description

When I run the Trivy Scan command from the Visual Studio Code Command Palette, VSCode throws an error saying "Failed to run Trivy scan, error: 1 check logs for details."

Expected Result

Trivy scan completes successfully against the currently open VSCode workspace. If scan fails, logs should be written to the VSCode Trivy Scan output section (see below screenshot).

Actual Result

Trivy extension throws an error message, saying scan failed, and to check logs VSCode debug logs for Trivy extension are empty.

image

Sumit016 commented 2 years ago

Same Error/Issue I am also facing, Please Help. How to configure or download Trivy for Windows. image

owenrumney commented 2 years ago

Unfortunately Trivy doesn't support Windows at the moment - https://github.com/aquasecurity/trivy/pull/1469 is tracking reintroducing this

jercle commented 2 years ago

@owenrumney I'm getting this on Mac too Version: 1.66.2 (Universal) Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:20.994Z (2 wks ago) Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Darwin arm64 21.2.0

owenrumney commented 2 years ago

Hey @jERCle - if you go to the settings for Trivy, can you confirm that the Trivy binary path is correct?

If Trivy is already on your PATH it will pick it up, otherwise you will likely need to put the full path here -

image

The extension doesn't install Trivy, you need to already have it. https://aquasecurity.github.io/trivy/v0.18.3/installation/

jercle commented 2 years ago

@owenrumney Can confirm:

image

And have already been using it through terminal. I installed through homebrew, and tested with that explicit path /opt/homebrew/bin/trivy and still failed. Only error is in the exthost.log file:

image

I am currently going through the extension code, so will have a bit more of a play and get back to you - although have to leave the office so will continue shortly

owenrumney commented 2 years ago

Could you check the output of Trivy Scan in the Output Tab

image

jercle commented 2 years ago

@owenrumney Running Trivy Scan from command pallette

image

This is also after I disabled all other extensions

However, after testing again the run button in Trivy explorer worked

image
ctaggartgla commented 2 years ago

I'm also seeing the same behaviour as jercle.

Running win 10, with wsl2. VSCode started from wsl terminal with code .

Project does contain a dockerfile and "trivy image [image name]" from wsl terminal produces data.

The extension also works fine, finding issue in dockerfile and pom

Anything else I can provide to help troubleshoot this?

andrew-shevchyk commented 1 year ago

Same for me: image

ProductName:        macOS
ProductVersion:     13.4
BuildVersion:       22F66

VS Code version: 1.78.2

thuwon commented 4 months ago

Though I couldnt fix the error, what helped was