Annotate_vdr: fix reading metadata.get("tools", {}).get("components", {}), create vdr file in report folder #1084
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker tests | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
ubuntu_version_tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras --all-packages --dev | |
npm install -g @cyclonedx/cdxgen | |
mkdir -p repotests | |
uv pip install -r contrib/requirements.txt | |
- name: Test container images | |
run: | | |
mkdir -p containertests_${{ matrix.os }}_python${{ matrix.python-version }} containertests_${{ matrix.os }}_python${{ matrix.python-version }}/slim containertests_${{ matrix.os }}_python${{ matrix.python-version }}/redmine | |
# uv run depscan --no-banner --src ghcr.io/owasp-dep-scan/dep-scan -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}_python${{ matrix.python-version }}/depscan -t docker | |
uv run depscan --no-banner --src shiftleft/scan-slim -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}_python${{ matrix.python-version }}/slim -t docker,license --no-vuln-table | |
uv run depscan --no-banner --src redmine@sha256:a5c5f8a64a0d9a436a0a6941bc3fb156be0c89996add834fe33b66ebeed2439e -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}_python${{ matrix.python-version }}/redmine -t docker --no-vuln-table | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: containertests_${{ matrix.os }}_python${{ matrix.python-version }} | |
path: containertests_${{ matrix.os }}_python${{ matrix.python-version }} | |
reachable_tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Trim CI agent | |
run: | | |
chmod +x contrib/free_disk_space.sh | |
./contrib/free_disk_space.sh | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras --all-packages --dev | |
npm install -g @cyclonedx/cdxgen | |
mkdir -p repotests | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'ngcloudsec/java-sec-code' | |
path: 'repotests/java-sec-code' | |
- name: Reachables tests | |
run: | | |
mkdir -p ${GITHUB_WORKSPACE}/rtests_ubuntu ${RUNNER_TEMP}/cdxgen-temp | |
cd ${GITHUB_WORKSPACE}/repotests/java-sec-code | |
mvn clean compile -DskipTests | |
cd ${GITHUB_WORKSPACE} | |
uv run depscan --no-banner --src ${GITHUB_WORKSPACE}/repotests/java-sec-code --reports-dir ${GITHUB_WORKSPACE}/rtests_ubuntu -t java --profile research --explain | |
env: | |
PYTHONUTF8: 1 | |
SCAN_DEBUG_MODE: "debug" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rtests_ubuntu | |
path: rtests_ubuntu | |
ubuntu_version_tests2: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Trim CI agent | |
run: | | |
chmod +x contrib/free_disk_space.sh | |
./contrib/free_disk_space.sh | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '24.x' | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras --all-packages --dev | |
npm install -g @cyclonedx/cdxgen | |
mkdir -p repotests | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'GoogleCloudPlatform/microservices-demo' | |
path: 'repotests/microservices-demo' | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'OWASP/NodeGoat' | |
path: 'repotests/NodeGoat' | |
- name: Test container images | |
run: | | |
mkdir -p containertests_${{ matrix.os }} /tmp/cdxgen-temp | |
uv pip install -r contrib/requirements.txt | |
cp contrib/csaf.toml repotests/microservices-demo/csaf.toml | |
cp contrib/csaf.toml repotests/NodeGoat/csaf.toml | |
uv run depscan --no-banner --bom ./test/data/bom-yaml-manifest.json -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }} --no-vuln-table | |
uv run depscan --no-banner -t docker --src ubuntu:latest -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }} --no-vuln-table | |
uv run depscan --csaf --no-banner -t go --bom-engine CdxgenGenerator --src ${GITHUB_WORKSPACE}/repotests/microservices-demo -o ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }} --reports-dir ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}/msd | |
uv run depscan --csaf --no-banner -t js --bom-engine CdxgenGenerator --src ${GITHUB_WORKSPACE}/repotests/NodeGoat --reports-dir ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}/ng-reports | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYTHONUTF8: 1 | |
SCAN_DEBUG_MODE: debug | |
CDXGEN_TEMP_DIR: /tmp/cdxgen-temp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: containertests_${{ matrix.os }} | |
path: containertests_${{ matrix.os }} | |
version_tests_mac_win: | |
needs: ubuntu_version_tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
python-version: [ '3.10', '3.11', '3.12', '3.13' ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Trim CI agent | |
run: | | |
chmod +x contrib/free_disk_space.sh | |
./contrib/free_disk_space.sh | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras --all-packages --dev | |
npm install -g @cyclonedx/cdxgen | |
uv pip install -r contrib/requirements.txt | |
- name: Get boms generated earlier | |
uses: actions/download-artifact@v4 | |
with: | |
name: containertests_ubuntu-latest_python3.11 | |
path: containertests_ubuntu-latest_python3.11 | |
- name: Test container images | |
run: | | |
mkdir -p containertests_${{ matrix.os }}_python${{ matrix.python-version }} | |
uv run depscan --no-banner --bom ${GITHUB_WORKSPACE}/containertests_ubuntu-latest_python3.11/slim/sbom-docker.cdx.json -o containertests_${{ matrix.os }}_python${{ matrix.python-version }} --no-vuln-table | |
uv run depscan --no-banner --bom ${GITHUB_WORKSPACE}/containertests_ubuntu-latest_python3.11/redmine/sbom-docker.cdx.json -o containertests_${{ matrix.os }}_python${{ matrix.python-version }} --no-vuln-table | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYTHONUTF8: 1 | |
SCAN_DEBUG_MODE: "debug" | |
CDXGEN_TEMP_DIR: ${{ runner.temp }}/cdxgen-temp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: containertests_${{ matrix.os }}_python${{ matrix.python-version }} | |
path: containertests_${{ matrix.os }}_python${{ matrix.python-version }} | |
version_tests2_mac_win: | |
needs: ubuntu_version_tests2 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
python-version: [ '3.12' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Trim CI agent | |
run: | | |
chmod +x contrib/free_disk_space.sh | |
./contrib/free_disk_space.sh | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras --all-packages --dev | |
npm install -g @cyclonedx/cdxgen | |
- name: Get boms generated earlier | |
uses: actions/download-artifact@v4 | |
with: | |
name: containertests_ubuntu-latest | |
path: containertests_ubuntu-latest | |
- name: Test container images | |
shell: bash | |
run: | | |
mkdir -p containertests_${{ matrix.os }} | |
mkdir -p containertests_ubuntu-latest/microservices | |
mkdir -p containertests_ubuntu-latest/NodeGoat | |
mv containertests_ubuntu-latest/msd/sbom-go.cdx.json containertests_ubuntu-latest/microservices/sbom-msd-go.cdx.json | |
mv containertests_ubuntu-latest/ng-reports/sbom-js.cdx.json containertests_ubuntu-latest/nodegoat/sbom-js.cdx.json | |
cp contrib/csaf.toml containertests_ubuntu-latest/microservices/csaf.toml | |
cp contrib/csaf.toml containertests_ubuntu-latest/nodegoat/csaf.toml | |
uv run depscan --no-banner --bom ${GITHUB_WORKSPACE}/containertests_ubuntu-latest/sbom-rocket-docker.cdx.json -o containertests_${{ matrix.os }}/reports --no-vuln-table | |
uv run depscan --csaf --no-banner --bom ${GITHUB_WORKSPACE}/containertests_ubuntu-latest/microservices/sbom-msd-go.cdx.json --reports-dir ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}/reports | |
uv run depscan --csaf --no-banner --bom ${GITHUB_WORKSPACE}/containertests_ubuntu-latest/nodegoat/sbom-js.cdx.json --reports-dir ${GITHUB_WORKSPACE}/containertests_${{ matrix.os }}/ng-reports | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYTHONUTF8: 1 | |
SCAN_DEBUG_MODE: "debug" | |
CDXGEN_TEMP_DIR: ${{ runner.temp }}/cdxgen-temp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: containertests_${{ matrix.os }} | |
path: containertests_${{ matrix.os }} |