Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ workflows:
branches:
only:
- develop
- pm-2539

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Trivy Scanner

permissions:
contents: read
security-events: write
on:
push:
branches:
- main
- dev
pull_request:
jobs:
trivy-scan:
name: Use Trivy
runs-on: ubuntu-24.04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Consider using a stable version of the runner, such as ubuntu-latest, instead of ubuntu-24.04 to ensure compatibility and support. This can help avoid potential issues with specific versions that may not be maintained.

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Trivy scanner in repo mode
uses: aquasecurity/trivy-action@0.33.1
with:
scan-type: "fs"
ignore-unfixed: true
format: "sarif"
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH,UNKNOWN"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The severity level UNKNOWN is not a standard severity level in Trivy. Consider removing it to avoid potential misconfigurations or errors in the scan results.

scanners: vuln,secret,misconfig,license
github-pat: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"
3 changes: 2 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ module.exports = {

HASHING_KEYS: {
USERFLOW: process.env.USERFLOW_PRIVATE_KEY
}
},
MEMBER_SERVICE_PRISMA_TIMEOUT: process.env.MEMBER_SERVICE_PRISMA_TIMEOUT ? parseInt(process.env.MEMBER_SERVICE_PRISMA_TIMEOUT, 10) : 10000,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Using parseInt without a radix can lead to unexpected behavior if the environment variable is not a valid number. Ensure that process.env.MEMBER_SERVICE_PRISMA_TIMEOUT is always a valid integer string or handle potential NaN values appropriately.

}
4 changes: 4 additions & 0 deletions src/common/prisma.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ const {
Prisma
} = require('../../prisma/generated/client')
const { PrismaClient: SkillsPrismaClient } = require('../../prisma/generated/skills-client')
const config = require('config')

const clientOptions = {
transactionOptions: {
timeout: config.MEMBER_SERVICE_PRISMA_TIMEOUT,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Ensure that config.MEMBER_SERVICE_PRISMA_TIMEOUT is properly validated and set to a sensible default to avoid potential issues with transaction timeouts.

},
log: [
{ level: 'query', emit: 'event' },
{ level: 'info', emit: 'event' },
Expand Down
Loading
Loading