Giter VIP home page Giter VIP logo

trivy-plugin-sonarqube's People

Contributors

umax avatar usachevgeophy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

za kahennig ctsyeh

trivy-plugin-sonarqube's Issues

External ssues not being uploaded to sonarqube

Hi

I know it´s not related to the plugin but i would like to know if you had sucess uploading the reports to sonarqube.

I dont have erros but external issues are being ignored by the scanner.

./trivy image -f json -o results.json nexus-12:8443/maven3-trivy-scanner:qual
./trivy sonarqube results.json > sonarqube.json
./trivy sonarqube sonarqube.json -- filePath=Dockerfile > sonarqube.json

sonar-scanner -Dsonar.login= -Dsonar.password= -Dsonar.projectKey=otrs-ticket-admin-web-qual -Dsonar.projectKey=otrs-ticket-admin-web-qual -Dsonar.sources=. 
	-Dsonar.externalIssuesReportPaths=C:\Users\Herman.Maleiane\Downloads\sonar-scanner-4.8.0.2856-windows\bin\sonarqube.json

Imported 0 issues in 0 files
INFO: External issues ignored for 1 unknown files, including: Dockerfile
INFO: Sensor Import external issues report (done) | time=74ms

{
  "issues": [
    {
      "engineId": "Trivy",
      "ruleId": "CVE-2011-3374",
      "type": "VULNERABILITY",
      "severity": "MINOR",
      "primaryLocation": {
        "message": "It was found that apt-key in apt, all versions, do not correctly validate gpg keys with the master keyring, leading to a potential man-in-the-middle attack.",
        "filePath": "Dockerfile"
      }
    },
    {
      "engineId": "Trivy",
      "ruleId": "CVE-2019-18276",
      "type": "VULNERABILITY",
      "severity": "MINOR",
      "primaryLocation": {
        "message": "An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support \"saved UID\" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use \"enable -f\" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.",
        "filePath": "Dockerfile"
      }
    }

The problem is in the attribute filepath
Thanks in advance

SonarQube warning - External issues were imported with a deprecated format

Trivy version 0.49.1
SonarQube version 10.4

After converting trivy filesystem report and running sonar-scanner - it gives Warning that report format is deprecated.

INFO: Sensor Import external issues report
WARN: External issues were imported with a deprecated format which will be removed soon. Please switch to the newest format to fully benefit from Clean Code: https://docs.sonarsource.com/sonarqube/10.4/analyzing-source-code/importing-external-issues/generic-issue-import-format/
INFO: Imported 5 issues in 1 file
INFO: Sensor Import external issues report (done) | time=29ms

Installing and running the plugin on a Jenkins Windows node

I successfully use this on my Linux nodes but have problems on the windows ones. I get the following error when I try to use it.

 plugin error: exit: fork/exec C:\Windows\system32\config\systemprofile\.trivy\plugins\sonarqube\sonarqube.py: %1 is not a valid Win32 application.
09:32:18  At D:\Jenkins_data\workspace\bkslb\sonar-test@tmp\durable-375653e6\powershellWrapper.ps1:3 char:1
09:32:18  + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
09:32:18  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
09:32:18      + CategoryInfo          : NotSpecified: (Error: plugin e...32 application.:String) [], RemoteException
09:32:18      + FullyQualifiedErrorId : NativeCommandError
09:32:18   
09:32:18  Usage:
09:32:18    trivy sonarqube [flags]
...

Python is installed and is in the PATH environment variable. I'm severly limited when it comes to windows :-) The only thing I can imagine is the shebang

#!/usr/bin/env python3

It looks very 'Linuxy'

Happy for any help I can get

/Thomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.