scanner-cli | A project security/vulnerability/risk scanning tool | Security Testing library
kandi X-RAY | scanner-cli Summary
kandi X-RAY | scanner-cli Summary
A project security/vulnerability/risk scanning tool
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of scanner-cli
scanner-cli Key Features
scanner-cli Examples and Code Snippets
Community Discussions
Trending Discussions on scanner-cli
QUESTION
We already have plugins installed for the bitbucket server and sonarqube in Jenkins and We ran the sonar using this command in the Jenkinsfile
I also followed this community topic:
...ANSWER
Answered 2021-Apr-17 at 06:32It's hard to provide an answer that addresses your specific issues, as you haven't provided much information. However, I can give you some background on how this is typically done.
Concerning what you've provided, you cite a document about decorating pull requests, which has a lot of information. It's not clear at all which error you are referring to.
The way you use SonarQube and Jenkins to block the merging of pull requests if SonarQube has "errors", is with the Quality Gate, and the configuration of the BitBucket repository.
You define the SonarQube quality gate with rules for when the scan is to be defined as "failing". For instance, you can define a minimum percentage of unit test code coverage, or the maximum number of vulnerabilities, or other issue types.
In Jenkins, you need to use the "withSonarQubeEnv()" and "waitForQualityGate()" pipeline steps. The former specifies the name of the SonarQube instance to use, which extracts the SonarQube credentials and url from the Jenkins configuration (you should define them in the Jenkins configuration, not in the build job, as you have done). The latter waits for SonarQube to produce the quality gate analysis, which is performed in a background job in SonarQube. When the background job completes, it will call the "Webhook", the url of which has to be configured in SonarQube, to point to Jenkins (often something like "http://{jenkinshost}:{jenkinsport}/jenkins/sonarqube-webhook"). In the Jenkins pipeline script, you check the return value from "waitForQualityGate()", and if the "status" property of that object is not equal to "OK", then the quality gate failed, and your script should call "error" to fail the build.
QUESTION
I am having SonarQube Community Edition (v7.9.5) server running with sonar-cxx community plugin v1.3.3
Now for a test C++ project, I have generated cppcheck (v2.3) analysis report and ran sonar-scanner (https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip) as follows.
...ANSWER
Answered 2021-Feb-16 at 05:45The issue cause is found after doing some more digging.
Issue cause: The default quality profile corresponding to the C++ (Community) had their all rules disabled by default, and there was no option to enable them as well.
Fix: Created a new quality profile extending the default one, then enabled rules for that, and finally made it as the default quality profile for C++ (Community) solves the issue.
Update (16-Feb-'21): Got a clarification from sonar-cxx team that this is intentional as well, and the same is documented in https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Manage-Quality-Profiles
Since the cxx plugin contains a large number of sensors with over 4000 rules, all rules are initially deactivated in the default profile Sonar way for the programming language CXX. Enabling all rules would have a negative impact on the analysis performance and mostly only a subset is needed.
Therefore, after installation, no sensor issues are displayed. To display issues, the corresponding rules must first be enabled in the Quality Profile being used by the project.
QUESTION
I have a two projects in GitLab and I am trying to integrate SonarQube with my GitLab projects.
Project 1I have added the 'sonar-scanner.properties' file to Project1 and it's as follows:
sonar-scanner.properties
...ANSWER
Answered 2021-Feb-15 at 07:24I found the solution to this, myself.
Required to add
"- cd /build/rmesi/test-repo ; sonar-scanner"
in the script section in the job of the 'sonarscanner.gitlab-ci.yml' file.
That way, the runner maps directly to desired directory and execute the 'sonar-scanner' command there.
QUESTION
I'm trying to use sonarsource/sonar-scanner-cli
as a kubernetes container, so I do this in a yaml:
ANSWER
Answered 2021-Jan-25 at 09:51Here's how one can modify container commands without building another image.
- Pull the image
QUESTION
I am running a sonarQube analysis inside my gitlab runner, with the following config:
Sonarqube version: Version 7.9.1 (build 27448)
Gitlab-ci.yml:
...ANSWER
Answered 2020-Dec-08 at 10:15For anyone finding this later, I found the solution.
According to https://docs.sonarqube.org/7.9/analysis/scan/sonarscanner/ only sonar-scanner version 4.0 is compatible.
The docker image with version 4.1 (https://hub.docker.com/layers/sonarsource/sonar-scanner-cli) works fine though.
QUESTION
I install sonar-scanner via docker on my mac
(https://hub.docker.com/r/sonarsource/sonar-scanner-cli) and I getting the error "You must define the following mandatory properties for 'Unknown': sonar.projectKey".
I have done the following:
1: add a sonar-scanner.properties file in the root of JS project
...ANSWER
Answered 2020-Nov-03 at 02:03\$ docker pull sonarqube:7.9.4-community
\$ docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:7.9.4-community
- Log in to http://localhost:9000 (login=admin, password=admin)
- (make sure - sonarqube server is running at localhost:9000)
\$ docker pull newtmitch/sonar-scanner:4-alpine
- Goto your root directory of the Project
- \$ docker run -it -v $(pwd):/usr/src --link sonarqube:7.9.4-community newtmitch/sonar-scanner:4-alpine
-D sonar.host.url=http://sonarqube:9000
-D sonar.scm.provider=git
-D sonar.projectBaseDir=./src
-D sonar.sources=.
-D sonar.projectName='Test-Project' - (NOTE: Above I assume that your source code is inside- src folder, if not please change accordingly)
- Go to http://localhost:9000 You will now see a new project - "Test-Project" which has completely analyzed the source code that you ran from your root directory.
- Documentation click
\$ npm i -D sonarqube-scanner
In package.json add a new script:
"sonar": "node sonar-project.js"
add a file in your root-directory: sonar-project.js
Copy following code in sonar-project.js:
QUESTION
I'm creating my docker image based on CentOS. I want to have it install SonarScanner, a build-wrapper and the GNU ARM Embedded Toolchain in order to analyze C files. I wrote a Dockerfile in order to run those tasks.
After installing the required tools, I use the curl command to download the different archives. I don't encounter any problems downloading and extracting Sonar scanner and the Build Wrapper, but when I try to download the GNU ARM toolchain, my file system can't find it and therefore can't extract the archive. I find it weird since I'm using the exact same command as I did for the first two. I also tried using wget, with the same results. Here is my Dockerfile :
...ANSWER
Answered 2020-Jul-27 at 14:38Your last URL contains special chars which are interpreted by the shell. The downloaded URL is bogus, and you don't notice because curl is set to run silently. The resulting file is corrupt. Solution : quote (or escape) your URL.
bzip2 is also missing in your image : you want to add it to your yum install
command.
With these changes, your Dockerfile builds successfully:
QUESTION
I'm getting an error called "Please provide compiled classes of your project with sonar.java.binaries property" when executing the sonar-scanner command. I have referred most of the currently available solutions within Stack overflow, git hub etc. However, none of these solutions have worked out successfully.
Additional Details:
Java Version : 13.0.2 SonarQube Version : sonarqube-8.2.0.32929 Sonar Scanner Version : sonar-scanner-cli-4.2.0.1873-windows
The sonar-scanner conf file properties are mentioned bellow.
...ANSWER
Answered 2020-Mar-04 at 14:29You probably need to do what the error message suggest: add a property
QUESTION
I'm creating a Sonarqube environment with Docker, but when I run the scanner, an error occurred.
I run the scanner directly into the container :
...ANSWER
Answered 2020-Feb-19 at 09:34Solved my problem. In dockerfile :
QUESTION
I'm trying to build sonarqube via jenkins pipeline script, during the build i am getting error unable to reach localhost 9000.
...ANSWER
Answered 2019-Dec-30 at 16:06Since your Jenkins is running the build in a docker container as mentioned in the comments, the solution is to use the IP address or a local DNS name to access sonarqube from within the build script, since localhost does not resolve to the host machine inside a docker container.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scanner-cli
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page