Repository navigation
fix: SECURITY FIX! Add Trivy vulnerability scanner and mitigate security issues #10949
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| name: trivy | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| # The branches below must be a subset of the branches above | ||
| branches: [ "main" ] | ||
| schedule: | ||
| - cron: '18 12 * * 4' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build an image from Dockerfile | ||
| run: | | ||
| docker build -t docker.io/my-organization/my-app:${{ github.sha }} . | ||
|
|
||
| - name: Run Trivy vulnerability scanner | ||
| uses: aquasecurity/trivy-action@0.33.1 | ||
| with: | ||
| image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}' | ||
| format: 'sarif' | ||
| output: 'trivy-results.sarif' | ||
| severity: 'CRITICAL,HIGH' | ||
|
|
||
| - name: Upload Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: 'trivy-results.sarif' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,15 @@ | ||
| # v0.8.2-rc1 | ||
|
|
||
| # Base node image | ||
| FROM node:20-alpine AS node | ||
| FROM node:22-alpine AS node | ||
|
|
||
| # Install jemalloc | ||
| RUN apk add --no-cache jemalloc | ||
| RUN apk add --no-cache python3 py3-pip uv | ||
|
|
||
| # Upgrade npm to fix CVE-2025-64756 (glob command injection) | ||
| RUN npm install -g npm@latest | ||
|
Collaborator
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 an acceptable command, as this could silently change how packages work |
||
|
|
||
| # Set environment variable to use jemalloc | ||
| ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,11 @@ | |
| # v0.8.2-rc1 | ||
|
|
||
| # Base for all builds | ||
| FROM node:20-alpine AS base-min | ||
| FROM node:22-alpine AS base-min | ||
| # Install jemalloc | ||
| RUN apk add --no-cache jemalloc | ||
| # Upgrade npm to fix CVE-2025-64756 (glob command injection) | ||
| RUN npm install -g npm@latest | ||
|
Collaborator
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 an acceptable command, as this could silently change how packages work |
||
| # Set environment variable to use jemalloc | ||
| ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2 | ||
| WORKDIR /app | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,7 +148,8 @@ | |
| "micromark-extension-math": { | ||
| "katex": "^0.16.21" | ||
| } | ||
| } | ||
| }, | ||
| "body-parser": "^2.2.1" | ||
|
Collaborator
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 necessary, already addressed |
||
| }, | ||
| "nodemonConfig": { | ||
| "ignore": [ | ||
|
|
||
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.
node v22 has issues with some of our dependencies, we would need to test in a separate PR