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
49 changes: 49 additions & 0 deletions .github/workflows/security-audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Security Audit of JS and Python Libraries"

on:
push:
branches:
- develop
schedule:
- cron: '0 0 * * 1' # Hebdomadaire le lundi à minuit

permissions:
contents: read

jobs:
audit:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Setup Node.js"
uses: actions/setup-node@v6
with:
node-version: '24'

- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: "Install dependencies"
run: |
npm install --no-save --no-package-lock --ignore-scripts --no-audit --no-fund retire
python -m pip install --upgrade pip
python -m pip install -r install/dev-requirements.txt

- id: generate-report
name: "Run security scan"
run: |
export REPORT_DATE="$(date -u +%Y-%m-%d)"
export REPORT_BASENAME="security-report-${REPORT_DATE}.txt"
export REPORT_FILE="${GITHUB_WORKSPACE}/${REPORT_BASENAME}"
npm run scan
test -f "$REPORT_FILE"

- name: "Upload report as artifact"
uses: actions/upload-artifact@v4
with:
name: mviewerstudio-security-audit-report
path: ${{ steps.generate-report.outputs.report-file }}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
build:
context: .
dockerfile: docker/Dockerfile
pull_policy: build
image: mviewer/mviewerstudio:latest
# ports:
# - "8000:8000"
Expand Down Expand Up @@ -44,4 +45,4 @@ services:
- "./apps:/usr/share/nginx/html/apps:ro"
depends_on:
- mviewerstudio
- mviewer
- mviewer
3 changes: 2 additions & 1 deletion install/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ mypy
types-Werkzeug # mypy
types-Flask
sphinx<7.0.0
PyStemmer
PyStemmer
pip-audit
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"scripts": {
"pretty": "prettier --write \"./src/static/mviewerstudio.i18n.json\" \"./src/static/js/**/*.{js,json}\" \"./src/static/lib/mv.js\"",
"prettier-check": "prettier --check \"./src/static/mviewerstudio.i18n.json\" \"./src/static/js/**/*.{js,json}\" \"./src/static/lib/mv.js\""
"prettier-check": "prettier --check \"./src/static/mviewerstudio.i18n.json\" \"./src/static/js/**/*.{js,json}\" \"./src/static/lib/mv.js\"",
"scan": "node security-scripts/security-audit.js"
},
"repository": {
"type": "git",
Expand Down
Loading
Loading