diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..9e8c2052a
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,36 @@
+name: SonarQube
+on:
+ push:
+ branches:
+ - dev
+ pull_request:
+ types: [opened, synchronize, reopened]
+jobs:
+ build:
+ name: Build and analyze
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: 17
+ distribution: 'zulu' # Alternative distribution options are available.
+ - name: Cache SonarQube packages
+ uses: actions/cache@v4
+ with:
+ path: ~/.sonar/cache
+ key: ${{ runner.os }}-sonar
+ restore-keys: ${{ runner.os }}-sonar
+ - name: Cache Maven packages
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Build and analyze
+ env:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=mtech-software-solutions_SecurityShepherd
\ No newline at end of file
diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml
deleted file mode 100644
index 90221bf26..000000000
--- a/.github/workflows/dependency-check.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: Dependency-Check
-
-on:
- schedule:
- # runs on the default branch every 2 weeks
- - cron: '0 0 1,15 * *'
- push:
- branches: [master, dev]
- paths:
- - 'pom.xml'
- pull_request:
-
-jobs:
- dependency-check:
- runs-on: ubuntu-latest
- name: dependency-check
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Build Maven with Docker Profile
- run: mvn clean install -Pdocker -DskipTests -B
- - name: Dependency-Check Run
- env:
- # actions/setup-java changes JAVA_HOME so it needs to be reset to match the dependency-check docker image
- JAVA_HOME: /opt/jdk
- uses: dependency-check/Dependency-Check_Action@main
- id: dependency-check
- with:
- project: 'OWASP Security Shepherd'
- path: '.'
- format: 'HTML'
- args: >
- --format JSON
- --prettyPrint
- - name: Publish Dependency-Check Results
- uses: actions/upload-artifact@master
- with:
- name: dependency_check_report
- path: ${{github.workspace}}/reports
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 559c499e1..000000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,121 +0,0 @@
-name: Release to Dockerhub
-on:
- push:
- branches: [master, dev]
- paths-ignore:
- - '**.md'
- - '.github/'
- - '.gitignore'
- - '.sonarcloud.properties'
- - 'provisioning'
- - 'CONTRIBUTING.md'
- - 'LICENSE'
- - 'README.md'
- - 'Vagrantfile'
-
-jobs:
- build:
- if: github.event_name != 'pull_request' && github.repository == 'OWASP/SecurityShepherd'
- name: build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v3.6.0
- with:
- distribution: 'zulu'
- java-version: '8'
- - name: Build Maven with Docker Profile and Generate SBOM
- run: mvn clean install -Pdocker -DskipTests -B -DexcludeTestProject=true cyclonedx:makeBom
- - name: Upload WAR File
- uses: actions/upload-artifact@v3
- with:
- name: security_shepherd_war
- path: target/*.war
- - name: Docker Compose Build
- run: docker-compose build
- - name: Generate Tomcat Docker Image SBOM
- uses: anchore/sbom-action@v0
- id: tomcat
- with:
- format: cyclonedx-json
- image: owasp/security-shepherd
- output-file: ${{ github.workspace }}/target/owasp-security-shepherd-tomcat.cyclonedx.json
- - name: Generate MariaDB Docker Image SBOM
- uses: anchore/sbom-action@v0
- id: mariadb
- with:
- format: cyclonedx-json
- image: owasp/security-shepherd_mariadb
- output-file: ${{ github.workspace }}/target/owasp-security-shepherd-mariadb.cyclonedx.json
- - name: Generate MongoDB Docker Image SBOM
- uses: anchore/sbom-action@v0
- id: mongodb
- with:
- format: cyclonedx-json
- image: owasp/security-shepherd_mongo
- output-file: ${{ github.workspace }}/target/owasp-security-shepherd-mongodb.cyclonedx.json
- - name: Upload SBOMs
- uses: actions/upload-artifact@v3
- with:
- name: security_shepherd_sboms
- path: |
- target/*.json
- target/*.xml
- - name: Cache Maven packages
- uses: actions/cache@v3
- with:
- key: maven-output-${{ hashFiles('target/**') }}
- path: |
- target/
- docker/mariadb/target
- docker/mongo/target
-
- release-security-shepherd:
- needs: build
- if: github.event_name != 'pull_request' && github.repository == 'OWASP/SecurityShepherd'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Extract metadata (tags, labels) for Docker
- id: meta
- uses: docker/metadata-action@v4.1.1
- with:
- images: owasp/security-shepherd
-
- - name: Restore Cached Maven packages
- uses: actions/cache@v3
- with:
- key: maven-output-${{ hashFiles('target/**') }}
- path: |
- target/
- docker/mariadb/target
- docker/mongo/target
-
- # Dump the environment variables from the dotenv file so they can be used to build the tomcat server
- - name: Set environment variables
- uses: c-py/action-dotenv-to-setenv@80f488cda311f44d43e687a4e94f54a050b7822a # v4
- with:
- env-file: .env
-
- - name: Build and push Tomcat
- uses: docker/build-push-action@v3.2.0
- with:
- context: .
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- build-args: |
- TOMCAT_DOCKER_VERSION
- TLS_KEYSTORE_FILE
- TLS_KEYSTORE_PASS
- ALIAS
- HTTPS_PORT
\ No newline at end of file
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index 08bc43eba..000000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,105 +0,0 @@
-name: Build and Test
-on:
- push:
- branches: [master, dev]
- paths-ignore:
- - '**.md'
- - '.github/ISSUE_TEMPLATE'
- - '.gitignore'
- - 'provisioning'
- - '.sonarcloud.properties'
- - 'LICENSE'
- - 'Vagrantfile'
- pull_request:
- branches: [master, dev]
- paths-ignore:
- - '**.md'
- - '.github/ISSUE_TEMPLATE'
- - '.gitignore'
- - 'provisioning'
- - '.sonarcloud.properties'
- - 'LICENSE'
- - 'Vagrantfile'
-
-jobs:
- lint-java:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a #v3.6.0
- with:
- args: "--set-exit-if-changed"
-
- build:
- needs: lint-java
- name: build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Build Maven with Docker Profile
- run: mvn clean install -Pdocker -DskipTests -B
- - name: Docker Compose Build
- run: docker-compose build
-
- unit-tests:
- needs: [lint-java, build]
- runs-on: ubuntu-latest
- services:
- mysql:
- image: mysql:5.7
- env:
- MYSQL_ROOT_PASSWORD: password
- MYSQL_DATABASE: core
- ports:
- - '8888:3306'
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Start MYSQL Server
- run: sudo /etc/init.d/mysql start
- - name: Modify MySQL Connection Variables
- run: |
- sed -i "s/'@'localhost'/'@'%'/g" ${GITHUB_WORKSPACE}/src/main/resources/database/moduleSchemas.sql
- sed -i 's/TEST_MYSQL_PORT=3306/TEST_MYSQL_PORT=8888/g' ${GITHUB_WORKSPACE}/.env
- - name: Run Unit Tests
- run: mvn test -B -e -X
-
- integration-tests:
- needs: [lint-java, build]
- runs-on: ubuntu-latest
- services:
- mysql:
- image: mysql:5.7
- env:
- MYSQL_ROOT_PASSWORD: password
- MYSQL_DATABASE: core
- ports:
- - '8888:3306'
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Start MYSQL Server
- run: sudo /etc/init.d/mysql start
- - name: Modify MySQL Connection Variables
- run: |
- sed -i "s/'@'localhost'/'@'%'/g" ${GITHUB_WORKSPACE}/src/main/resources/database/moduleSchemas.sql
- sed -i 's/TEST_MYSQL_PORT=3306/TEST_MYSQL_PORT=8888/g' ${GITHUB_WORKSPACE}/.env
- - name: Prepare Intergration Tests
- run: |
- sudo apt-get -y install libargon2-0
- mvn -Pdocker validate
- - name: Run Intergration Tests
- run: |
- mvn verify -DskipUTs=true -DmongoDocker -B
diff --git a/pom.xml b/pom.xml
index d9052ee3e..b170442a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,9 +10,11 @@
UTF-8
- false
+ true
${skipTests}
${skipTests}
+ mtech-software-solutions
+ https://sonarcloud.io
diff --git a/src/main/webapp/css/theResponsiveCss.css b/src/main/webapp/css/theResponsiveCss.css
index 06c0655b3..397dcced3 100644
--- a/src/main/webapp/css/theResponsiveCss.css
+++ b/src/main/webapp/css/theResponsiveCss.css
@@ -53,6 +53,20 @@
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
+ }
+ .sidebarWrapperAlwaysOpen {
+ width: 200px;
+ background: #AEACAC;
+ border-top: 3px solid #A878EF;
+ border-right: 3px solid #A878EF;
+ position: absolute;
+ height: 100%;
+ border-radius: 2px;
+ text-decoration: none;
+ vertical-align: top;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 10px;
}
.sidebarWrapperAlwaysOpen #sidebar {
display: block;
@@ -87,4 +101,5 @@
float: left;
width: 90%;
}
-}
\ No newline at end of file
+
+}