Skip to content

Remove pip and ensurepip from the core and modules runtime images - #482

Open
RobertDWhite wants to merge 2 commits into
MISP:masterfrom
RobertDWhite:codex/modules-runtime-no-pip-20261026
Open

RobertDWhite wants to merge 2 commits into
MISP:masterfrom
RobertDWhite:codex/modules-runtime-no-pip-20261026

Conversation

@RobertDWhite

@RobertDWhite RobertDWhite commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The modules runtime retains pip's vendored dependencies after wheel installation. Updating application requirements does not update those separate copies. Remove pip after installation and remove ensurepip, including its bundled pip wheel; keep installation tooling in the build stage.

Validation: applied the same cleanup to the immutable v3.1.1 amd64 image in an isolated container with no network access, credentials, or persistent storage. Confirmed pip and ensurepip are absent, dropped to UID 1001, started misp-modules, listed all 252 modules, and verified HTML-to-Markdown conversion preserves text while removing script content. The disposable check exited successfully.

The upstream Docker build workflow passed, including the full and slim modules images. The workflow uses push:false and does not publish a deployable image. This remains a draft pending final-image scanning and broader module tests. Custom modules that install packages dynamically at runtime would need to install those dependencies during image construction instead. No application dependencies or base image are changed.

Per review, the same cleanup now also applies to the core image: pip and ensurepip are removed right after the wheel install in the final stage. Neither the core entrypoint/config scripts nor the MISP application invoke pip at runtime.

@RobertDWhite
RobertDWhite marked this pull request as ready for review October 26, 2026 15:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T16:02:25.962020Z 54d0b69 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ostefano
ostefano self-requested a review October 26, 2026 16:01

@ostefano ostefano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same thing should apply to 'core'

@RobertDWhite RobertDWhite changed the title Remove pip and ensurepip from the modules runtime image Remove pip and ensurepip from the core and modules runtime images Oct 26, 2026
@ostefano
ostefano self-requested a review October 27, 2026 13:53

@ostefano ostefano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, I believe also misp-guard would benefit from this (sorry, just forgot it in my previous message)

@ostefano ostefano added the enhancement New feature or request label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants