Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1805397
Adding more tests and refactoring code in order to improve the overal…
sydseter Jan 20, 2026
39fcbb2
Get rid of warnings
sydseter Jan 20, 2026
ca273ec
Remove script
sydseter Jan 20, 2026
9793bbf
Fix linux build issue
sydseter Jan 20, 2026
bf077c3
Try to resolve path depending on os
sydseter Jan 20, 2026
2e4d7e1
Adding capec scripts
sydseter Jan 21, 2026
7409bb2
Fix convert test
sydseter Jan 21, 2026
509c618
Fix style issues
sydseter Jan 21, 2026
f5e6b74
Fix test and formating
sydseter Jan 21, 2026
2aa8400
Fix code style issues
sydseter Jan 22, 2026
062b036
Fix build issues
sydseter Jan 22, 2026
69e3d65
Resolve merge issues
sydseter Jan 22, 2026
6fa8fa4
Resolve merge issues
sydseter Jan 22, 2026
46c04b6
Update lock file
sydseter Jan 22, 2026
e814e1f
Fix coding style issues
sydseter Jan 22, 2026
d768c12
Fix possible type juggling issues
sydseter Jan 22, 2026
60f003a
Fix style isues for dockerfile
sydseter Jan 22, 2026
286fcbb
Fix more coding style issues
sydseter Jan 22, 2026
712c252
Fix coding issues
sydseter Jan 22, 2026
ebd678b
Fix coding style issues
sydseter Jan 22, 2026
94adcac
Try to fix clusterfuck
sydseter Jan 22, 2026
0b9c86a
Fix test issues after code style improvements
sydseter Jan 22, 2026
5a2d087
Fix formating
sydseter Jan 22, 2026
6952670
Fix coding style issues
sydseter Jan 22, 2026
58a2825
Try different package
sydseter Jan 22, 2026
3e1085f
Update deps
sydseter Jan 22, 2026
6ca87b6
Install the clusterfuck dependencies in two runs
sydseter Jan 22, 2026
c9a901e
Abort clusterfuck linting fixes
sydseter Jan 22, 2026
dd74ecd
Ensure build breaks if the coverage is too low
sydseter Jan 22, 2026
020188f
Add vitest.config
sydseter Jan 22, 2026
f5ada75
Correctly update deps
sydseter Jan 22, 2026
ce8af4d
Try to go back to the previous know good state
sydseter Jan 22, 2026
ad0fd36
Fix the fuzzer
sydseter Jan 22, 2026
4817ee1
Upgrade to python 3.12 and fix the fuzzers
sydseter Jan 22, 2026
bf645e6
Ensure pipenv is installe
sydseter Jan 22, 2026
9cf2794
Ensure lf is correct
sydseter Jan 22, 2026
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
23 changes: 16 additions & 7 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
FROM gcr.io/oss-fuzz-base/base-builder-python:v1@sha256:c0021e88f13312e7706c49e6348fe442b641ff46d032d9846131a60b68dea50d
RUN apt-get update && apt-get install -y make autoconf automake libtool curl gcc libc-dev software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa -y
FROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04@sha256:79f6e0ac4506a75757099bfea8cfd52d1bb0e2f92ca21c64755151b655ce23e1
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
curl \
gcc \
libc-dev \
libtool \
make \
libxml2-dev \
libxslt-dev \
python3-dev \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort these package names alphanumerically. [radarlint-iac:docker:S7018]

python3-venv \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Atheris only supports python 3.11 https://github.com/google/atheris/blob/master/README.md#installation-instructions
RUN apt upgrade -y && apt-get install -y python3.10 python3.10-dev python3.10-distutils libxml2-dev libxslt-dev
RUN apt-get install -y python3-pip
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
RUN python3.10 -m pip install --upgrade wheel setuptools setuptools_scm PyInstaller==6.13.0
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check [hadolint:DL4006]

RUN python3 -m pip install --upgrade wheel setuptools setuptools_scm PyInstaller==6.18.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 3 issues:

1. Avoid use of cache directory with pip. Use pip install --no-cache-dir [hadolint:DL3042]


2. Pin versions in pip. Instead of pip install use pip install == or pip install --requirement [hadolint:DL3013]


3. Sort these package names alphanumerically. [radarlint-iac:docker:S7018]

COPY . $SRC/cornucopia
WORKDIR $SRC/cornucopia
COPY .clusterfuzzlite/build.sh $SRC/
8 changes: 4 additions & 4 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash -eu

# build project
python3.10 -m pip install -r requirements.txt
python3.10 -m pip install -r install_cornucopia_deps.txt
python3 -m pip install -r requirements.txt
python3 -m pip install -r install_cornucopia_deps.txt

# Build fuzzers into $OUT. These could be detected in other ways.
for fuzzer in $(find "$SRC/cornucopia/tests/scripts" -name '*_fuzzer.py'); do
fuzzer_basename=$(basename -s .py "$fuzzer")
fuzzer_package=${fuzzer_basename}.pkg

python3.10 -m PyInstaller --distpath "$OUT" --onefile --exclude IPython --paths "$SRC"/cornucopia:"$SRC"/cornucopia/scripts:"$SRC"/cornucopia/tests/test-files --hidden-import scripts --collect-submodules scripts --name "$fuzzer_package" "$fuzzer"
python3 -m PyInstaller --distpath "$OUT" --onefile --exclude IPython --paths "$SRC"/cornucopia:"$SRC"/cornucopia/scripts:"$SRC"/cornucopia/tests/test-files --hidden-import scripts --collect-submodules scripts --name "$fuzzer_package" "$fuzzer"

echo "#!/bin/sh
# LLVMFuzzerTestOneInput for fuzzer detection.
Expand All @@ -18,4 +18,4 @@ this_dir=\$(dirname \"\$0\")
ASAN_OPTIONS=\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\$this_dir/llvm-symbolizer:detect_leaks=0 \
\$this_dir/$fuzzer_package \$@" > "$OUT"/"$fuzzer_basename"
chmod +x "$OUT/$fuzzer_basename"
done
done
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
* text=auto
output/*.docx filter=lfs diff=lfs merge=lfs -text
output/*.idml filter=lfs diff=lfs merge=lfs -text
resources/fonts/Atkinson-Hyperlegible-Font-Print-and-Web-2020-0514.zip filter=lfs diff=lfs merge=lfs -text
resources/fonts/fivo_sans.zip filter=lfs diff=lfs merge=lfs -text
*.py text eol=lf
*.ts text eol=lf
*.json text eol=lf
*.yaml text eol=lf
*.lock text eol=lf
*.txt text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.ini text eol=lf
*.json text eol=lf
*.config text eol=lf
*.eex text eol=lf
*.ex text eol=lf
*.exs text eol=lf
*.css text eol=lf
*.scss text eol=lf
*.toml text eol=lf
*.gitignore text eol=lf
Dockerfile text eol=lf
9 changes: 4 additions & 5 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: Build and Test the Cornucopia Website
on:
pull_request:
paths:
- 'cornucopia.owasp.org/**'
- '.github/workflows/build-website.yml'
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -45,4 +43,5 @@
run: |
pnpm install # Install dependencies
npm run build # Build production version
pnpm audit --prod
pnpm audit --prod
pnpm run coverage
3 changes: 2 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
- name: Get Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pipenv' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt --require-hashes
pip install pipenv
pipenv install --ignore-pipfile --dev
# Run the tests
- name: Run unit tests
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
- name: Get Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pipenv' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt --require-hashes
pip install pipenv
pipenv install --ignore-pipfile --dev
# Run the tests
- name: Run unit tests
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/run-tests-for-patches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ jobs:
hardening:
name: Harden runner
uses: ./.github/workflows/hardening.yaml
call-run-tests:
call-run-converter-tests:
name: Build and run Converter Tests
needs: hardening
uses: ./.github/workflows/run-tests.yaml
uses: ./.github/workflows/run-tests.yaml
call-run-website-tests:
name: Build and run Website Tests
needs: hardening
uses: ./.github/workflows/build-website.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could not read reusable workflow file for "./.github/workflows/build-website.yaml": open /home/runner/work/cornucopia/.github/workflows/build-website.yaml: no such file or directory [actionlint:workflow-call]

call-run-build-copi-tests:
name: Build and run COPI Tests
needs: hardening
uses: ./.github/workflows/copi-build.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could not read reusable workflow file for "./.github/workflows/copi-build.yaml": open /home/runner/work/cornucopia/.github/workflows/copi-build.yaml: no such file or directory [actionlint:workflow-call]

3 changes: 2 additions & 1 deletion .github/workflows/run-tests-generate-output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ jobs:
- name: Get Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pipenv' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt --require-hashes
pip install pipenv
pipenv install -d
- name: Generate new output files
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ jobs:
- name: Get Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pipenv' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt --require-hashes
pip install pipenv
pipenv install --ignore-pipfile --dev
# Run the tests
- name: Run unit tests
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:alpine3.20@sha256:40a4559d3d6b2117b1fbe426f17d55b9100fa40609733a1d0c3f39e2151d4b33 AS pipenv
FROM python:3.12.12-alpine3.22@sha256:d82291d418d5c47f267708393e40599ae836f2260b0519dd38670e9d281657f5 AS pipenv
RUN apk add --no-cache shadow
# UID of current user who runs the build
ARG user_id
Expand Down Expand Up @@ -26,6 +26,7 @@ RUN apk add --no-cache \
make
COPY --chown=builder:union requirements.txt ./
RUN pip install -r requirements.txt --require-hashes
RUN pip install pipenv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 3 issues:

1. Avoid use of cache directory with pip. Use pip install --no-cache-dir [hadolint:DL3042]


2. Pin versions in pip. Instead of pip install use pip install == or pip install --requirement [hadolint:DL3013]


3. Multiple consecutive RUN instructions. Consider consolidation. [hadolint:DL3059]

USER builder
# Install Python dependencies so they are cached
ARG workdir
Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ charset-normalizer = "==3.4.4"
python-docx = "==1.1.0"
PyYAML = "==6.0.1"
pyqrcode = "==1.2.1"
types-PyYAML = "==6.0.12.12"
docx2pdf = "==0.1.8"
lxml = "==6.0.1"
defusedxml = "==0.7.1"
Expand All @@ -35,6 +34,7 @@ pathvalidate = "==3.3.1"
security = "==1.3.1"
colorama = "*"
mypy = "*"
types-pyyaml = "==6.0.12.20250915"

[requires]
python_version = "3.11"
python_version = "3.12"
Loading
Loading