Skip to content

Commit

Permalink
Add NVD API key
Browse files Browse the repository at this point in the history
  • Loading branch information
turing85 authored and dependabot[bot] committed Mar 8, 2024
1 parent 9c89760 commit fedd271
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/actions/owasp-scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
description: Whether artifacts (Maven state, compiled classes and JARs) should be downloaded
default: 'true'
required: false
nvd-api-key:
description: The API key for the NVD database, used by the dependency-check scan plugin
required: true

runs:
using: composite
Expand Down Expand Up @@ -49,6 +52,7 @@ runs:
mvn \
--batch-mode \
--define ci-owasp \
--define nvdApiKey=${{ inputs.nvd-api-key }} \
package \
dependency-check:aggregate
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/populate-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Populate Cache
description: |
An action to populate the maven cache.
inputs:
nvd-api-key:
description: The API key for the NVD database, used by the dependency-check scan plugin
required: true

runs:
using: composite

Expand All @@ -26,6 +31,7 @@ runs:
run: |
mvn \
--batch-mode \
--define nvdApiKey=${{ inputs.nvd-api-key }} \
go-offline:resolve-dependencies \
dependency-check:update-only
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ jobs:

- name: Populate Cache
uses: ./.github/actions/populate-cache
with:
nvd-api-key: ${{ secrets.NVD_API_KEY }}

build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -354,4 +356,6 @@ jobs:
uses: actions/checkout@v4

- name: OWASP Scan
uses: ./.github/actions/owasp-scan
uses: ./.github/actions/owasp-scan
with:
nvd-api-key: ${{ secrets.NVD_API_KEY }}
5 changes: 4 additions & 1 deletion .github/workflows/nightly-cve-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

- name: Populate Cache
uses: ./.github/actions/populate-cache
with:
nvd-api-key: ${{ secrets.NVD_API_KEY }}

owasp:
runs-on: ubuntu-latest
Expand All @@ -33,4 +35,5 @@ jobs:
- name: OWASP Scan
uses: ./.github/actions/owasp-scan
with:
download-artifacts: false
download-artifacts: false
nvd-api-key: ${{ secrets.NVD_API_KEY }}

0 comments on commit fedd271

Please sign in to comment.