Skip to content

Commit 56a3805

Browse files
committed
fix: move security package to fresh installation
1 parent deb8f0c commit 56a3805

6 files changed

Lines changed: 690 additions & 32 deletions

File tree

.github/workflows/security-scan.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,12 @@ jobs:
2121
with:
2222
python-version: "3.10"
2323

24-
- name: Install dependencies
24+
- name: Install tox
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install tox
28-
29-
- name: Get package name and latest release version
30-
id: get_info
31-
run: |
32-
PACKAGE_NAME=$(grep -E '^name = ' pyproject.toml | head -1 | sed 's/name = "\(.*\)"/\1/')
33-
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
34-
echo "Package name: $PACKAGE_NAME"
35-
36-
LATEST_VERSION=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name' | sed 's/^v//')
37-
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
38-
echo "Latest version: $LATEST_VERSION"
27+
python -m pip install uv
28+
uv tool install tox --with tox-uv
3929
4030
- name: Run security scan with tox
41-
env:
42-
PACKAGE_NAME: ${{ steps.get_info.outputs.package_name }}
43-
PACKAGE_VERSION: ${{ steps.get_info.outputs.version }}
4431
run: tox -e security
45-
timeout-minutes: 10
32+
timeout-minutes: 2

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ jobs:
2929
3030
- name: Run tox
3131
run: tox
32+
timeout-minutes: 2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,6 @@ cython_debug/
206206
marimo/_static/
207207
marimo/_lsp/
208208
__marimo__/
209+
210+
# mloda-plugin-template
211+
security-reports/

docs/github-workflows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This project uses three GitHub Actions workflows to automate testing, security s
2222
- Scheduled: Every Monday at 9:00 AM UTC
2323
- Manual dispatch (can be triggered from any branch)
2424

25-
**Purpose:** Performs CVE vulnerability scanning on the latest published release using pip-audit via tox. The workflow fetches the latest release version from GitHub and scans it for known vulnerabilities.
25+
**Purpose:** Performs CVE vulnerability scanning on the local package using pip-audit via tox. The workflow builds the package and scans its dependencies for known vulnerabilities.
2626

2727
**Requirements:** None. Uses only the default `GITHUB_TOKEN` with read permissions.
2828

tox.ini

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,21 @@ commands =
1313
bandit -c pyproject.toml -r -q .
1414

1515
[testenv:security]
16-
# CVE scanning environment - downloads specific version of published package
17-
skip_install = False
18-
usedevelop = False
16+
# CVE scanning environment - builds and scans the local package
17+
usedevelop = true
18+
extras = dev
1919
deps =
2020
pip-audit
21-
allowlist_externals = sh, rm, mkdir
22-
setenv =
23-
PACKAGE_NAME = {env:PACKAGE_NAME:placeholder-my-plugin}
24-
PACKAGE_VERSION = {env:PACKAGE_VERSION:0.2.2}
21+
allowlist_externals = sh, mkdir
2522
commands =
2623
mkdir -p security-reports
2724

28-
sh -c "pip uninstall -y {env:PACKAGE_NAME} || true"
29-
30-
sh -c "pip install {env:PACKAGE_NAME}=={env:PACKAGE_VERSION}"
31-
3225
sh -c "pip list"
3326

34-
# Run CVE scan
35-
sh -c "pip-audit --desc --format=json --output=security-reports/pip-audit-version.json || pip-audit --desc"
27+
# Run CVE scan on installed dependencies
28+
sh -c "pip-audit --desc --format=json --output=security-reports/pip-audit.json || pip-audit --desc"
3629

3730
# Display summary
3831
sh -c "echo '=== CVE Scan Summary ==='"
3932
sh -c "echo 'Tool: pip-audit (Apache 2.0 licensed)'"
40-
sh -c "echo 'Report: security-reports/pip-audit-version.json'"
33+
sh -c "echo 'Report: security-reports/pip-audit.json'"

0 commit comments

Comments
 (0)