This is an automated email from the ASF dual-hosted git repository.

deacon-mp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/caldera.git


The following commit(s) were added to refs/heads/master by this push:
     new fdfa7e65 build(deps): install debrief's requirements from the plugin 
(#3440)
fdfa7e65 is described below

commit fdfa7e6565f6104bc5b0f478a366ba24d0e59ab6
Author: Ricky Chen <[email protected]>
AuthorDate: Tue Dec 1 10:47:27 2026 -0500

    build(deps): install debrief's requirements from the plugin (#3440)
    
    * build(deps): bump reportlab to 4.5.1
    
    svglib 2.3.1, the first release that fixes CVE-2026-132275, needs reportlab 
4.4.3 or later. The debrief plugin installs svglib, so the core pin of 4.0.4 
could not coexist with the fixed version.
    
    The training plugin imports reportlab for its certificates, so the pin 
stays in core until that plugin declares its own requirements. The comment now 
names training.
    
    * build(deps): install debrief's requirements from the plugin
    
    Core pinned lxml and svglib for the debrief plugin, which already declares 
them in plugins/debrief/requirements.txt. Builder and emu install their own 
requirements the same way.
    
    - requirements.txt drops lxml, and requirements-debrief.txt is removed.
    - pip-audit checks plugins/debrief/requirements.txt, so the packages stay 
audited.
    - The Docker image installs the plugin's requirements except svglib, which 
is LGPL 3.0.
    - README points at the plugin's file.
    
    reportlab stays in core because the training plugin imports it. Training 
and fieldmanual are left for a later change.
    
    Refs #3439
    
    * build(docker): pin lxml for debrief and check the plugin's requirements
    
    SonarCloud flagged the new install line twice: a requirements file with 
version ranges is not locked, and the install could run setup scripts.
    
    After requirements.txt, lxml is the only package debrief still needs in the 
image. Install it by exact version with --only-binary. A second step dry-runs 
the plugin's requirements file, minus svglib, against what is installed and 
stops the build if the pin falls behind.
    
    * build(docker): trim comments and drop the requirements check
---
 Dockerfile               |  3 +++
 README.md                | 15 ++++++++-------
 requirements-debrief.txt |  5 -----
 requirements.txt         |  3 +--
 tox.ini                  |  2 +-
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8db50d41..ea2f34dd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -67,6 +67,9 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
 # Install pip requirements
 RUN pip3 install --break-system-packages --no-cache-dir -r requirements.txt
 
+# Install lxml for the debrief plugin. svglib is LGPL 3.0, so it is left out.
+RUN pip3 install --break-system-packages --no-cache-dir --only-binary :all: 
lxml==6.1.3
+
 # For offline atomic (disable it by default in slim image)
 # Disable atomic if this is not downloaded
 RUN if [ ! -d "/usr/src/app/plugins/atomic/data/atomic-red-team" ] && [ 
"$VARIANT" = "full" ]; then   \
diff --git a/README.md b/README.md
index 0c30ea9e..2c873eb7 100644
--- a/README.md
+++ b/README.md
@@ -77,7 +77,7 @@ Concise installation steps:
 git clone https://github.com/apache/caldera.git --recursive
 cd caldera
 pip3 install -r requirements.txt
-pip3 install -r requirements-debrief.txt  # optional: PDF reports in the 
debrief plugin
+pip3 install -r plugins/debrief/requirements.txt  # the debrief plugin, 
enabled by default
 python3 server.py --insecure --build
 ```
 
@@ -108,12 +108,13 @@ LDAP login is optional. To use it, also install the LDAP 
requirements, which are
 pip3 install -r requirements-ldap.txt
 ```
 
-The debrief plugin, which `conf/default.yml` enables, needs the `svglib` 
package to build PDF reports. It is kept in a separate file because it is 
licensed under the LGPL 3.0:
+Some plugins have their own `requirements.txt`. Install it for each one you 
enable. The debrief plugin is enabled by default and does not load without its 
requirements:
 ```Bash
-pip3 install -r requirements-debrief.txt
+pip3 install -r plugins/debrief/requirements.txt
 ```
+This installs `svglib`, which draws the graphs in debrief's PDF reports and is 
licensed under the LGPL 3.0.
 
-These two commands apply to an installation on the host. The Docker images do 
not include either set of packages. See [Docker 
Installation](#docker-installation) for how to add them to an image.
+These commands apply to an installation on the host. The Docker images include 
neither `ldap3` nor `svglib`. See [Docker Installation](#docker-installation) 
for how to add them to an image.
 
 Finally, start the server.
 ```Bash
@@ -155,13 +156,13 @@ docker stop <container ID>
 
 There are two variants available, *full* and *slim*. The *slim* variant 
doesn't include files necessary for the `emu` and `atomic` plugins, which will 
be downloaded on-demand if the plugins are ever enabled. The *full* variant is 
suitable for operation in environments without an internet connection. Slim 
images on GHCR are prefixed with "slim".
 
-The Docker images of version 5.4.0 and later install `requirements.txt` but 
not the optional `requirements-ldap.txt` and `requirements-debrief.txt`, which 
LDAP login and the PDF reports of the debrief plugin need. Installing those 
packages on the host does not add them to a container. To use these features 
with Docker, build your own image on top of a Caldera image and install the 
files you need. Both files are in the image's working directory, 
`/usr/src/app`. Save the following as `Dock [...]
+The Docker images of version 5.4.0 and later leave out two packages that are 
licensed under the LGPL 3.0: `ldap3`, which LDAP login needs, and `svglib`, 
which draws the graphs in the PDF reports of the debrief plugin. Without 
`svglib`, debrief still builds PDF reports, with a note in place of each graph. 
Installing those packages on the host does not add them to a container. To use 
these features with Docker, build your own image on top of a Caldera image and 
install the files you need.  [...]
 ```Dockerfile
 FROM ghcr.io/apache/caldera:latest
 # LDAP login
 RUN pip3 install --break-system-packages --no-cache-dir -r 
requirements-ldap.txt
-# PDF reports of the debrief plugin
-RUN pip3 install --break-system-packages --no-cache-dir -r 
requirements-debrief.txt
+# Graphs in the PDF reports of the debrief plugin
+RUN pip3 install --break-system-packages --no-cache-dir -r 
plugins/debrief/requirements.txt
 ```
 Then build and run it:
 ```sh
diff --git a/requirements-debrief.txt b/requirements-debrief.txt
deleted file mode 100644
index 658c8d0d..00000000
--- a/requirements-debrief.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Optional dependency for the debrief plugin, which needs it to build PDF
-# reports. It is not installed by requirements.txt because svglib is licensed
-# under the LGPL 3.0. Install it with:
-#   pip install -r requirements-debrief.txt
-svglib==1.5.1
diff --git a/requirements.txt b/requirements.txt
index 1b9ded4d..37c3f7b2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,9 +14,8 @@ myst-parser==2.0.0
 marshmallow==3.26.2
 dirhash==0.2.1
 marshmallow-enum==1.5.1
-reportlab==4.0.4  # debrief
+reportlab==4.5.1  # training
 rich==13.7.0
-lxml==6.1.0  # debrief
 Markdown==3.8.1  # training
 dnspython==2.9.2
 asyncssh==2.24.1
diff --git a/tox.ini b/tox.ini
index a2d6a143..53f2e47a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -73,7 +73,7 @@ skip_install = true
 commands =
     pip-audit -r requirements.txt
     pip-audit -r requirements-ldap.txt
-    pip-audit -r requirements-debrief.txt
+    pip-audit -r plugins/debrief/requirements.txt
     # GHSA-6w46-j5rx-g56g (pytest tmpdir handling, fixed in pytest 9.0.3):
     # pytest is a test-only tool and is not part of the release. The suite
     # still uses the event_loop fixture, so pytest-asyncio stays at 0.26.x,

Reply via email to