Skip to content

Commit

Permalink
Added Github action for dependency security scan
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Jan 15, 2023
1 parent 30d3515 commit 8125f3e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Security Scan
on:
push:
branches:
- 'develop'
- 'release-**'

env:
BUILD_OPTS: ""
MAVEN_OPTS: "-Xmx4096m"

jobs:
# Documentation: https://jeremylong.github.io/DependencyCheck/dependency-check-maven/index.html
owasp-dependency-check:
name: Owasp Dependency Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # Checks out a copy of the repository on the ubuntu-latest machine
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
cache: 'maven'
- uses: actions/cache@v3 # Cache local Maven repository to reuse dependencies
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -B ${BUILD_OPTS} -DskipTests -Psecurity-scan verify
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2400,8 +2400,8 @@
<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled> <!-- This disables the .NET Assembly Analyzer -->
<!-- The following is commented because we have a lot of CVEs. Check Kapua Issue https://github.com/eclipse/kapua/issues/3691 -->
<!-- <failBuildOnCVSS>9.0</failBuildOnCVSS> --><!-- Fails if there is any score above 9 -->
<format>ALL</format> <!-- Defines output file formats. ALL will produce .csv, .html, .json, .sarif, .xml-->
<outputDirectory>target/security-scan/</outputDirectory>
<format>ALL</format> <!-- Defines output file formats. ALL will produce .csv, .html, .json, .sarif, .xml -->
<outputDirectory>target/security-scan/</outputDirectory> <!-- Group all reports under the same directory -->
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 8125f3e

Please sign in to comment.