Skip to content

Commit c9ffc53

Browse files
committed
2 parents 7b213b5 + 86fa330 commit c9ffc53

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

.github/workflows/security.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
jobs:
1111
bandit:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
security-events: write # needed for SARIF upload
1316
steps:
1417
- uses: actions/checkout@v4
1518

@@ -20,27 +23,30 @@ jobs:
2023
- name: Install Bandit
2124
run: python -m pip install --upgrade pip bandit
2225

23-
# 1) Generate a full report (never fails the job) so you can review details
24-
- name: Bandit full report (non-blocking)
26+
# Full report for triage (non-blocking), goes to the Security tab
27+
- name: Bandit SARIF (non-blocking)
2528
run: |
2629
bandit -r . \
2730
-x tests,venv,.venv,build,dist,__pycache__,.github \
28-
-s B101,B404 \
29-
-f txt -o bandit.txt || true
31+
-f sarif -o bandit.sarif || true
3032
31-
# 2) Gate on HIGH severity + HIGH confidence only (job fails if any)
32-
- name: Bandit gate (HIGH/HIGH only)
33+
- name: Upload SARIF to code scanning
34+
if: always()
35+
uses: github/codeql-action/upload-sarif@v3
36+
with:
37+
sarif_file: bandit.sarif
38+
category: bandit
39+
40+
# Gate 1: fail on ANY High severity (even if confidence is low)
41+
- name: Bandit gate — HIGH severity (any confidence)
3342
run: |
3443
bandit -q -r . \
3544
-x tests,venv,.venv,build,dist,__pycache__,.github \
36-
-s B101,B404 \
37-
--severity-level high --confidence-level high
45+
--severity-level high --confidence-level low
3846
39-
- name: Upload Bandit report
40-
if: always()
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: bandit-report
44-
path: bandit.txt
45-
if-no-files-found: warn
46-
retention-days: 7
47+
# Gate 2: fail on Medium/High with HIGH confidence
48+
- name: Bandit gate — MEDIUM+ with HIGH confidence
49+
run: |
50+
bandit -q -r . \
51+
-x tests,venv,.venv,build,dist,__pycache__,.github \
52+
--severity-level medium --confidence-level high

ONBOARDING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Welcome to the project! Here’s how to get your development environment set up
66

77
Before you begin, make sure you have the following installed on your system:
88

9-
* **Python 3.9+**
9+
* **Python 3.11+**
1010
* **Git**
1111
* **ffmpeg** & **ffprobe**
1212
* **mp3gain** (optional, but recommended)
@@ -78,4 +78,5 @@ This project uses standard tools to maintain code quality.
7878
pre-commit install
7979
```
8080

81-
That's it! You're ready to start developing.
81+
82+
That's it! You're ready to start developing.

help_window.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@ def _tool_info(cmd: str, version_args: list[str]) -> list[str]:
3939
return out
4040
out.append(f"{cmd}: {path}")
4141
try:
42-
import subprocess
42+
import subprocess # nosec B404: importing subprocess is intentional; we use shell=False
4343

4444
p = subprocess.run(
4545
[path, *version_args],
4646
capture_output=True,
4747
text=True,
4848
check=False,
49-
timeout=3, # It's also good practice to include a timeout
5049
)
5150

5251
first = (

0 commit comments

Comments
 (0)