Skip to content
Closed
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
39 changes: 26 additions & 13 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ permissions:
security-events: write

jobs:

security:
runs-on: ubuntu-latest

steps:

########################################
Expand All @@ -38,20 +36,24 @@ jobs:
pip install bandit pip-audit safety

########################################
# Python code scan
# Bandit
########################################

- name: Bandit scan
continue-on-error: true
run: |
bandit -c .github/security/bandit.yml -r . -f json -o bandit-report.json
bandit -r . -c .github/security/bandit.ini -f json -o bandit-report.json || true

########################################
# Python dependency scan
# pip-audit
########################################

- name: pip-audit dependencies
continue-on-error: true
run: |
pip-audit -r requirements.txt -f json -o pip-audit-report.json || true
if [ -f requirements.txt ]; then
pip-audit -r requirements.txt -f json -o pip-audit-report.json || true
fi

########################################
# Node setup
Expand All @@ -62,45 +64,54 @@ jobs:
with:
node-version: "20"

- name: Install JS dependencies
########################################
# npm install
########################################

- name: Install dependencies
continue-on-error: true
run: |
if [ -f package.json ]; then
npm install
fi

########################################
# NPM vulnerability scan
# npm audit
########################################

- name: NPM audit
continue-on-error: true
run: |
if [ -f package.json ]; then
npm audit --audit-level=high
npm audit --audit-level=high || true
fi

########################################
# ESLint security scan
# ESLint security
########################################

- name: ESLint security
- name: ESLint security scan
continue-on-error: true
run: |
if [ -f package.json ]; then
npm install eslint eslint-plugin-security
npx eslint . -c .github/security/eslint-security.json || true
fi

########################################
# Secrets scanning
# Secrets scan
########################################

- name: Gitleaks scan
continue-on-error: true
uses: gitleaks/gitleaks-action@v2

########################################
# Trivy vulnerability scan
# Trivy scan
########################################

- name: Trivy filesystem scan
continue-on-error: true
uses: aquasecurity/trivy-action@0.20.0
with:
scan-type: fs
Expand All @@ -112,12 +123,14 @@ jobs:
########################################

- name: Upload Bandit report
if: always()
uses: actions/upload-artifact@v4
with:
name: bandit-report
path: bandit-report.json

- name: Upload pip-audit report
if: always()
uses: actions/upload-artifact@v4
with:
name: pip-audit-report
Expand Down
Loading