OWASP / OWASP/SecurityShepherd

Create Code Analysis with SonarCloud

Open
#500 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.5k
Forks
515
Avg merge
3h 46m
Merged PRs (30d)
1

Description

SonarCloud is available for free here: https://github.com/apps/sonarcloud

Someone with access to the OWASP org needs to configure it for us.

Once it's configured we need to;

  1. Create a user authentication token for the account on SonarCloud.
    2. Encrypt this token travis encrypt abcdef0123456789 --pro
  2. Before pushing get the OWASP organisation key for SonarCloud
  3. Create a sonar-project.properties file with the following lines;
sonar-project.properties
# must be unique in a given SonarQube instance
sonar.projectKey=<owaspSecurityShepherd or whatever it is>

Edit the .travis-ci.yaml and add a stage analysis

- stage: analysis
      name: "Code Analysis"
      services: 
        - mysql
        - docker
      language: java
      addons: 
        sonarcloud:
          organization: "owasp (or whatever)"
          token:
              secure: "base64 key"
      script: "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=ismisepaul_SecurityShepherd -Pdocker -DmongoDocker -B"
    

see here https://github.com/ismisepaul/SecurityShepherd/blob/dev/.travis.yml

Example of current code analysis https://sonarcloud.io/dashboard?id=ismisepaul_SecurityShepherd

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing .travis-ci.yaml and the linked example, then verify the OWASP organization key and SonarCloud access requirements. Create sonar-project.properties and configure the analysis stage with the encrypted token; done means Travis can run the SonarCloud analysis without exposing credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd, devops, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.