Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/report-invalid-exposed-module' i…
Browse files Browse the repository at this point in the history
…nto report-invalid-exposed-module
  • Loading branch information
AttilaMihaly committed Dec 12, 2024
2 parents 7e914e5 + 7bdbe48 commit 52a6b1d
Show file tree
Hide file tree
Showing 14 changed files with 6,438 additions and 487 deletions.
71 changes: 54 additions & 17 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ name: Node.js CI
on:
push:
branches: [main]
pull_request:
pull_request_target:
branches: [main]

env:
SonatypeUrl: "https://finos.sonatype.app/platform/"
SonatypeAppId: "morphir-elm"
SonatypeScanTarget: "."
ExcludeDirectory: "**/docs/ **/.*'"

jobs:
# building project
build:
Expand Down Expand Up @@ -48,28 +55,58 @@ jobs:
- name: Running Test
run: npm test

# CVE scanning
cvescan:
name: CVE Scanning
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
###########################
## Sonatype SCA Scanning ##
###########################
- name: Sonatype Lifecycle SCA Scan
if: github.repository_owner == 'finos'
id: evaluate
uses: sonatype/actions/evaluate@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx --yes auditjs ossi --whitelist allow-list.json
iq-server-url: ${{ env.SonatypeUrl }}
username: ${{ secrets.SONATYPE_SCANNER_USERNAME }}
password: ${{ secrets.SONATYPE_SCANNER_PASSWORD }}
application-id: ${{ env.SonatypeAppId }}
stage: "build"
scan-targets: ${{ env.SonatypeScanTarget }}
module-exclude: ${{ env.ExcludeDirectory }}

- name: Save Sonatype SBOM
uses: sonatype/actions/fetch-sbom@v1
if: always() && steps.evaluate.outputs.scan-id
with:
iq-server-url: ${{ env.SonatypeUrl }}
username: ${{ secrets.SONATYPE_SCANNER_USERNAME }}
password: ${{ secrets.SONATYPE_SCANNER_PASSWORD }}
application-id: ${{ env.SonatypeAppId }}
scan-id: ${{ steps.evaluate.outputs.scan-id }}
sbom-standard: spdx
sbom-version: 2.3
artifact-name: ${{ env.SonatypeAppId }}-bom

# CVE scanning
# cvescan:
# name: CVE Scanning
# runs-on: ubuntu-latest
# needs: [build]
# strategy:
# matrix:
# node-version: [18.x]
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm ci
# - run: npx --yes auditjs ossi --whitelist allow-list.json

# Semgrep static code analysis
semgrep:
name: Semgrep
runs-on: ubuntu-latest
needs: [cvescan]
# needs: [cvescan]
needs: [build]
container:
# A Docker image with Semgrep installed. Don't change this.
image: returntocorp/semgrep
Expand Down
3 changes: 2 additions & 1 deletion allow-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{ "id": "sonatype-2012-0022", "reason": "ExpressJs has no intentions of fixing this `HTTP Splitting Attack`" },
{ "id": "CVE-2022-2596", "reason": "Typespec Compiler using node-fetch < 3.2.10" },
{ "id": "sonatype-2022-3677", "reason": "Node-fetch - Exposure of Sensitive Information to an Unauthorized Actor" },
{ "id": "sonatype-2021-0078", "reason": "After scanning the code we found that we are not using the impacted Express.js functions" }
{ "id": "sonatype-2021-0078", "reason": "After scanning the code we found that we are not using the impacted Express.js functions" },
{ "id": "CVE-2024-10491", "reason": "This CVE only impacts Express.js up to version 3.12.1 but the Sonatype database incorrectly stamps every version." }
]
}
Loading

0 comments on commit 52a6b1d

Please sign in to comment.