-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: [DevOps] Update OWASP Workflow #190
Changes from all commits
b703d6f
db35a0f
8548be5
8269988
9fba96a
fececde
67b7002
0f2004a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,14 @@ name: "Fosstars (Security)" | |
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" # every day at midnight | ||
- cron: '42 03 * * MON-FRI' # 03:42 on weekdays, a somewhat random time to avoid producing load spikes on the GH actions infrastructure | ||
|
||
env: | ||
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C | ||
JAVA_VERSION: 17 | ||
CVE_CACHE_KEY: cve-db | ||
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data | ||
CVE_CACHE_REF: refs/heads/main | ||
|
||
jobs: | ||
create_fosstars_report: | ||
|
@@ -22,29 +25,47 @@ jobs: | |
distribution: "temurin" | ||
java-version: ${{ env.JAVA_VERSION }} | ||
cache: 'maven' | ||
|
||
- name: Restore CVE Database | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
fail-on-cache-miss: true | ||
# fail-on-cache-miss: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how to feel about this change. Question:
Otherwise LGTM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a temporary change, needed because the cache needs to be initially created on |
||
|
||
- 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" | ||
- name: "Fosstars Rating" | ||
uses: SAP/fosstars-rating-core-action@v1.14.0 | ||
with: | ||
report-branch: fosstars-report | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "CVE Scan" | ||
env: | ||
NVD_API_KEY: ${{ secrets.NVD_API_KEY }} | ||
run: | | ||
mvn -T1 --no-transfer-progress dependency-check:check | ||
|
||
- name: Delete Old CVE Cache | ||
run: | | ||
CACHE_IDS=$(gh cache list --key "${{ env.CVE_CACHE_KEY }}" --ref "${{ env.CVE_CACHE_REF }}" --json id | jq -r '.[] | .id') | ||
for CACHE_ID in $CACHE_IDS; do | ||
echo "Deleting cache with ID: $CACHE_ID" | ||
gh cache delete "${CACHE_ID}" | ||
done | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Updated CVE Cache | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
|
||
- name: "Slack Notification" | ||
if: failure() | ||
uses: slackapi/slack-github-action@v1.27.0 | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from separate workflow to this workflow, because we only need the DB in this job, and unifying them is more reliable