Skip to content

Maven plugin parsing SARIF files created by CodeQL used for SonarQube issueReporter.

License

Notifications You must be signed in to change notification settings

baloise-incubator/codeql2sonar-maven-plugin

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date
Feb 20, 2025
Feb 20, 2025
Mar 14, 2021
Jan 27, 2024
Jun 6, 2021
Mar 14, 2021
Mar 14, 2021
Feb 20, 2025
Mar 4, 2025

Repository files navigation

CI CodeQL Quality Gate Status

codeql2sonar-maven-plugin

It is a Maven Plugin parsing SARIF files which were created by conducted CodeQL scan. The parsed result is provided to Sonarqube via SonarIssueReporter thus issue are displayed on Sonar's project dashboard.

Prerequisit

In order to use this plugin properly, your JAVA project needs to be configured in Sonar already and connected using org.sonarsource.scanner.maven:sonar-maven-plugin

How to use

add the following plugin to your pom.xml

<plugin>
  <groupId>com.baloise.open</groupId>
  <artifactId>codeql2sonar-maven-plugin</artifactId>
  <version>0.1.7</version>
</plugin>

Run to execute mvn codeql2sonar:SonarIssueReporter

How to configure

Mandatory properties

  • codeql2sonar.sarif.inputfile: specifies the SARIF file created by CodeQL scan

Optional properties

  • codeql2sonar.sarif.outputfile: location where to write the parsed result.
    Default: target/sonar/codeql2sonar.json
  • codeql2sonar.sarif.ignoreTests: if set to true, resources containing '/test/' in artifact location are not reported to Sonar.
    Default: false
  • codeql2sonar.sarif.path.excludes: Array of artifact locations to be excluded from result. Regex-patterns can be used here according to pattern .*<codeql2sonar.sarif.path.excludes.value>.* while patterns are compiled case-insensitive.
    Example:
    <codeql2sonar.sarif.path.excludes>
      <param>value1</param>
      <param>value2</param>
    </codeql2sonar.sarif.path.excludes>
    When using on command line with -Dcodeql2sonar.sarif.path.exclude= the paths can be separated by comma, e.g.
    -Dcodeql2sonar.sarif.path.excludes=path/subdir1,path/subdir2/