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

HackedRico pushed a commit to branch deps/debrief-plugin-requirements
in repository https://gitbox.apache.org/repos/asf/caldera.git

commit 8fa6ee7226444789cf20e4ff091e580c51072ce5
Author: HackedRico <[email protected]>
AuthorDate: Mon Nov 23 17:20:44 2026 -0500

    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
---
 Dockerfile               |  8 ++++++++
 README.md                | 15 ++++++++-------
 requirements-debrief.txt |  5 -----
 requirements.txt         |  1 -
 tox.ini                  |  4 +++-
 5 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8db50d41..ee4378bf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -67,6 +67,14 @@ 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 the requirements of the debrief plugin, which conf/default.yml 
enables.
+# svglib is left out: it is licensed under the LGPL 3.0, which an ASF 
convenience
+# binary must not include. Without it, debrief builds PDF reports with a note 
in
+# place of each graph.
+RUN grep -v '^svglib' plugins/debrief/requirements.txt > 
/tmp/debrief-requirements.txt && \
+pip3 install --break-system-packages --no-cache-dir -r 
/tmp/debrief-requirements.txt && \
+rm /tmp/debrief-requirements.txt
+
 # 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..5f9f479a 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:
+A plugin that needs Python packages of its own lists them in a 
`requirements.txt` file in its directory. Install that file for each such 
plugin you enable. `conf/default.yml` enables the debrief plugin, which does 
not load without its requirements:
 ```Bash
-pip3 install -r requirements-debrief.txt
+pip3 install -r plugins/debrief/requirements.txt
 ```
+One of them, `svglib`, 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 f64a9d63..37c3f7b2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,7 +16,6 @@ dirhash==0.2.1
 marshmallow-enum==1.5.1
 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..86abf643 100644
--- a/tox.ini
+++ b/tox.ini
@@ -73,7 +73,9 @@ skip_install = true
 commands =
     pip-audit -r requirements.txt
     pip-audit -r requirements-ldap.txt
-    pip-audit -r requirements-debrief.txt
+    # The debrief plugin declares its own requirements. conf/default.yml
+    # enables it, so they are audited here too.
+    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