Skip to content

Commit

Permalink
Merge pull request #2 from matusso/sonarcloud-integration
Browse files Browse the repository at this point in the history
Sonarcloud integration
  • Loading branch information
matusso authored Dec 7, 2024
2 parents 5596977 + 700236d commit f607821
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/metasploit-framework_sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: SonarCloud Scan - Metasploit Framework

on:
push:
branches:
- sonarcloud-integration
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud-metasploit:
name: Scan Metasploit Framework
runs-on: ubuntu-latest

steps:
- name: Checkout Metasploit Framework Repository
uses: actions/checkout@v4
with:
repository: rapid7/metasploit-framework
path: metasploit-framework # Optional: Clone into a specific directory
ref: '6.4.38'

- name: Install libpcap
run: sudo apt update && sudo apt install -y libpcap-dev

# Set up Ruby environment
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.5' # Adjust to required version
bundler-cache: true

# Install Ruby dependencies
- name: Install Ruby dependencies
run: |
cd metasploit-framework
bundle install --path vendor/bundle
# SonarCloud Scan for Metasploit Framework
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v4
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=matusso
-Dsonar.projectKey=docker-builds:metasploit-framework
-Dsonar.verbose=true
-Dsonar.projectName=metasploit-framework
-Dsonar.languages=ruby
-Dsonar.sources=metasploit-framework
-Dsonar.exclusions=**/*.java,**/*.c,**/*.cpp,**/*.h,**/*.mm,**/*.m
-Dsonar.c.file.suffixes=-
-Dsonar.cpp.file.suffixes=-
-Dsonar.objc.file.suffixes=-
60 changes: 60 additions & 0 deletions .github/workflows/mvt-project_sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: SonarCloud Scan - mvt-project

on:
push:
branches:
- sonarcloud-integration
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud-mvt:
name: Scan mvt-project
runs-on: ubuntu-latest

steps:
# Checkout the RouterSploit repository
- name: Checkout mvt-project Repository
uses: actions/checkout@v4
with:
repository: mvt-project/mvt
path: mvt # Optional: Clone into a specific directory
ref: 'v2.5.4'

# Set up Python 3.13
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

# Install Python dependencies
- name: Install Python dependencies
run: |
cd mvt
sudo apt update && sudo apt install -y \
build-essential \
git \
autoconf \
automake \
libtool-bin \
pkg-config \
libcurl4-openssl-dev \
libusb-1.0-0-dev \
libssl-dev \
udev \
&& sudo rm -rf /var/lib/apt/lists/*
# SonarCloud Scan for RouterSploit
- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v4
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=matusso
-Dsonar.projectKey=docker-builds:mvt-project
-Dsonar.verbose=true
-Dsonar.python.version=3.13
-Dsonar.projectName=mvt-project
-Dsonar.sources=mvt
50 changes: 50 additions & 0 deletions .github/workflows/routersploit_sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: SonarCloud Scan - RouterSploit

on:
push:
branches:
- sonarcloud-integration
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud-routersploit:
name: Scan RouterSploit
runs-on: ubuntu-latest

steps:
# Checkout the RouterSploit repository
- name: Checkout RouterSploit Repository
uses: actions/checkout@v4
with:
repository: threat9/routersploit
path: routersploit # Optional: Clone into a specific directory
ref: 'v3.4.6'

# Set up Python 3.13
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

# Install Python dependencies
- name: Install Python dependencies
run: |
cd routersploit
python -m pip install --upgrade pip
pip install -r requirements.txt
# SonarCloud Scan for RouterSploit
- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v4
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=matusso
-Dsonar.projectKey=docker-builds:routersploit
-Dsonar.verbose=true
-Dsonar.python.version=3.13
-Dsonar.projectName=routersploit
-Dsonar.sources=routersploit
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "matusso",
"projectKey": "matusso_docker-builds"
}
}

0 comments on commit f607821

Please sign in to comment.