Skip to content

Commit

Permalink
Added OWASP Dependency check (#82)
Browse files Browse the repository at this point in the history
* Added OWASP Dependency check

* Moved suppression file

* Moved OWASP Dependency check to Fosstars workflow

* Added Slack notification

* Added Build SDK step
  • Loading branch information
CharlesDuboisSAP authored Oct 7, 2024
1 parent d2e6321 commit 11ecf97
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
#TODO: Blackduck and security rating steps
42 changes: 39 additions & 3 deletions .github/workflows/fosstars-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,51 @@ name: "Fosstars (Security)"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *" # every day at midnight

env:
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
JAVA_VERSION: 17

jobs:
create_fosstars_report:
runs-on: ubuntu-latest
name: "Security rating"
steps:
- uses: actions/checkout@v4
- uses: SAP/[email protected]
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Setup java"
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
cache: 'maven'

- name: "Build SDK"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
mvn $MVN_ARGS
- name: "OWASP Dependency check"
run: mvn org.owasp:dependency-check-maven:10.0.4:check -DnvdApiKey=$NVD_API_KEY -DfailBuildOnCVSS=7 -DskipProvidedScope=true -DsuppressionFile=.pipeline/dependency-check-suppression.xml
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}

- name: "Fosstars rating"
uses: SAP/[email protected]
with:
report-branch: fosstars-report
token: ${{ secrets.GITHUB_TOKEN }}

- name: "Slack Notification"
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
"text": "⚠️ OWASP Dependency check failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-java/actions/runs/${{ github.run_id }}|here>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
7 changes: 7 additions & 0 deletions .pipeline/dependency-check-suppression.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[This is a JS dependency.]]></notes>
<cve>CVE-2021-41251</cve>
</suppress>
</suppressions>
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<checkstyle.version>10.18.2</checkstyle.version>
<system-stubs.version>2.1.3</system-stubs.version>
<surefire.version>3.5.1</surefire.version>
<system-stubs.version>2.1.3</system-stubs.version>
<springframework.version>6.1.13</springframework.version>
<mockito.version>5.14.1</mockito.version>
<!-- Quality assurance -->
Expand Down

0 comments on commit 11ecf97

Please sign in to comment.