Repository navigation
fix(security): trim vulnerable apt packages from ingestion Docker images - #30024
Conversation
…tches in ingestion images Removes vulnerable packages that ingestion code never invokes (alien, vim in .ci), swaps default-jdk for default-jre-headless (drops the CUPS/libtiff/GTK chain that comes with the full JRE), and switches the operator image to python:3.11-slim-bookworm to strip the pre-installed ImageMagick/Mercurial trees. Extends --only-upgrade to pull the already-published Debian fixes for curl, libcurl*, libmariadb3, and wget.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| libxml2 \ | ||
| libkrb5-dev \ | ||
| default-jdk \ | ||
| default-jre-headless \ |
There was a problem hiding this comment.
💡 Quality: Confirm default-jre-headless suffices for all JVM-backed connectors
Replacing default-jdk with default-jre-headless removes javac and JDK-only tooling; PySpark itself only needs a JRE, but any code path that compiles Java at runtime or relies on JDK tools (some Hadoop/Spark or JDBC-adjacent flows) would break. The test plan only exercises SparkSession.builder.getOrCreate(); confirm no ingestion connector requires the full JDK before merging, otherwise the failure will only surface at connector runtime rather than build time.
Was this helpful? React with 👍 / 👎
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
🟡 Playwright Results — all passed (32 flaky)✅ 4536 passed · ❌ 0 failed · 🟡 32 flaky · ⏭️ 95 skipped
🟡 32 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…slim base Reverts operator base from python:3.11-slim-bookworm to python:3.10-slim-bookworm. The slim variant is the piece that eliminates the ImageMagick/Mercurial/OpenEXR chain — Python 3.10 vs 3.11 makes no difference to that surface. Keeping 3.10 preserves parity with the main ingestion image (apache/airflow:3.2.1-python3.10) and avoids resolving a different set of cp311 wheels for the full [all]/[db2] extras than what is exercised elsewhere.
|
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsTrims unused apt packages and migrates operator images to Python 3.11 slim, resolving 93% of high-critical vulnerabilities. Confirm that headless JRE is sufficient for all JVM-backed connector runtime requirements. 💡 Quality: Confirm default-jre-headless suffices for all JVM-backed connectors📄 ingestion/operators/docker/Dockerfile:34 📄 ingestion/operators/docker/Dockerfile.ci:33 📄 ingestion/Dockerfile:31 📄 ingestion/Dockerfile.ci:30 Replacing default-jdk with default-jre-headless removes javac and JDK-only tooling; PySpark itself only needs a JRE, but any code path that compiles Java at runtime or relies on JDK tools (some Hadoop/Spark or JDBC-adjacent flows) would break. The test plan only exercises SparkSession.builder.getOrCreate(); confirm no ingestion connector requires the full JDK before merging, otherwise the failure will only surface at connector runtime rather than build time. ✅ 1 resolved✅ Edge Case: Operator base bump 3.10→3.11 is more than an apt-list edit
🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
…ges (#30024) * fix(security): remove unused apt packages and pull Debian security patches in ingestion images Removes vulnerable packages that ingestion code never invokes (alien, vim in .ci), swaps default-jdk for default-jre-headless (drops the CUPS/libtiff/GTK chain that comes with the full JRE), and switches the operator image to python:3.11-slim-bookworm to strip the pre-installed ImageMagick/Mercurial trees. Extends --only-upgrade to pull the already-published Debian fixes for curl, libcurl*, libmariadb3, and wget. * fix(security): keep operator image on Python 3.10 while switching to slim base Reverts operator base from python:3.11-slim-bookworm to python:3.10-slim-bookworm. The slim variant is the piece that eliminates the ImageMagick/Mercurial/OpenEXR chain — Python 3.10 vs 3.11 makes no difference to that surface. Keeping 3.10 preserves parity with the main ingestion image (apache/airflow:3.2.1-python3.10) and avoids resolving a different set of cp311 wheels for the full [all]/[db2] extras than what is exercised elsewhere.
|
Manually cherry-picked to 1.13 for 1.13.2 e4dbad2 |
…ges (#30024) * fix(security): remove unused apt packages and pull Debian security patches in ingestion images Removes vulnerable packages that ingestion code never invokes (alien, vim in .ci), swaps default-jdk for default-jre-headless (drops the CUPS/libtiff/GTK chain that comes with the full JRE), and switches the operator image to python:3.11-slim-bookworm to strip the pre-installed ImageMagick/Mercurial trees. Extends --only-upgrade to pull the already-published Debian fixes for curl, libcurl*, libmariadb3, and wget. * fix(security): keep operator image on Python 3.10 while switching to slim base Reverts operator base from python:3.11-slim-bookworm to python:3.10-slim-bookworm. The slim variant is the piece that eliminates the ImageMagick/Mercurial/OpenEXR chain — Python 3.10 vs 3.11 makes no difference to that surface. Keeping 3.10 preserves parity with the main ingestion image (apache/airflow:3.2.1-python3.10) and avoids resolving a different set of cp311 wheels for the full [all]/[db2] extras than what is exercised elsewhere.
|
Manually cherry-picked to 1.12.14 376483a |
The apt block upgrades libmariadb3 to the deb12u1 security build in the same run that installs default-libmysqlclient-dev. On bookworm that dev metapackage pulls libmariadb-dev, which exact-pins libmariadb3, so the upgrade evicts libmariadb-dev / default-libmysqlclient-dev and the following autoremove --purge sweeps the transitively-installed pkg-config and mariadb .pc files. Building mysqlclient 2.2.x from source (pulled transitively via .[all]) then fails with "pkg-config: not found / Can not find valid pkg-config name." Add pkg-config explicitly to the install list and upgrade libmariadb-dev / default-libmysqlclient-dev alongside libmariadb3 so the dev packages and their .pc files survive the purge. libmariadb3 still lands at 1:10.11.18-0+deb12u1, preserving the security intent of #30024. Mirrors the same fix already applied to the *.ci variants of these Dockerfiles. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The apt block upgrades libmariadb3 to the deb12u1 security build in the same run that installs default-libmysqlclient-dev. On bookworm that dev metapackage pulls libmariadb-dev, which exact-pins libmariadb3, so the upgrade evicts libmariadb-dev / default-libmysqlclient-dev and the following autoremove --purge sweeps the transitively-installed pkg-config and mariadb .pc files. Building mysqlclient 2.2.x from source (pulled transitively via .[all]) then fails with "pkg-config: not found / Can not find valid pkg-config name." Add pkg-config explicitly to the install list and upgrade libmariadb-dev / default-libmysqlclient-dev alongside libmariadb3 so the dev packages and their .pc files survive the purge. libmariadb3 still lands at 1:10.11.18-0+deb12u1, preserving the security intent of #30024. Mirrors the same fix already applied to the *.ci variants of these Dockerfiles. Co-Authored-By: Claude Opus 4.8 <[email protected]>



Summary
Closes 136 of 146 high/critical Snyk findings in the ingestion Docker images (~93%) with only apt-list edits — no application-code changes.
alien,default-jdk, andvim(CI variants) — none are invoked by ingestion code.python:3.10-bookworm→python:3.11-slim-bookworm(strips ImageMagick, Mercurial, OpenEXR, and hundreds of low-severity findings). Adds a bootstrap step forcurl/ca-certificates/gnupgsince the slim base omits them.--only-upgradelist withcurl,libcurl4,libcurl3-gnutls,libmariadb3,wget, so Debian security patches are pulled automatically.default-jdkwithdefault-jre-headless— same JVM, no javac, no GTK/CUPS/libtiff.Remaining 10 findings (
expat,wget,zlib× 2 per image, plus 2 deferred mlflow) have no upstream fix today;--only-upgradewill pick them up the moment Debian ships them.Test plan
docker build -f ingestion/Dockerfile .succeedsdocker build -f ingestion/operators/docker/Dockerfile .succeeds on the new slim basepyhive,impyla, andpyspark.SparkSession.builder.getOrCreate()all import and run inside the built images.debstill installs after droppingalienGreptile Summary
This PR reduces vulnerable apt packages in the ingestion Docker images. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into ingestion-vulne..." | Re-trigger Greptile
Context used (3)