Skip to content

fix(security): trim vulnerable apt packages from ingestion Docker images - #30024

Merged
ulixius9 merged 3 commits into
mainfrom
ingestion-vulnerability-investigation
Jul 20, 2026
Merged

ulixius9 merged 3 commits into
mainfrom
ingestion-vulnerability-investigation

Conversation

@akashverma0786

@akashverma0786 akashverma0786 commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes 136 of 146 high/critical Snyk findings in the ingestion Docker images (~93%) with only apt-list edits — no application-code changes.

  • Drop alien, default-jdk, and vim (CI variants) — none are invoked by ingestion code.
  • Swap operator image base python:3.10-bookworm → python:3.11-slim-bookworm (strips ImageMagick, Mercurial, OpenEXR, and hundreds of low-severity findings). Adds a bootstrap step for curl/ca-certificates/gnupg since the slim base omits them.
  • Extend the --only-upgrade list with curl, libcurl4, libcurl3-gnutls, libmariadb3, wget, so Debian security patches are pulled automatically.
  • Replace default-jdk with default-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-upgrade will pick them up the moment Debian ships them.

Test plan

  • docker build -f ingestion/Dockerfile . succeeds
  • docker build -f ingestion/operators/docker/Dockerfile . succeeds on the new slim base
  • Ingestion smoke test: pyhive, impyla, and pyspark.SparkSession.builder.getOrCreate() all import and run inside the built images
  • IBM iAccess .deb still installs after dropping alien
  • Re-run Snyk against both rebuilt images and confirm the 136-finding delta

Greptile Summary

This PR reduces vulnerable apt packages in the ingestion Docker images. The main changes are:

  • Removes unused packages from ingestion and CI images.
  • Replaces the full JDK with a headless JRE.
  • Moves operator images to the slim Python Bookworm base.
  • Adds bootstrap apt tooling for the slim operator images.
  • Extends the security-only upgrade list for vulnerable packages.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
ingestion/Dockerfile Removes unused apt packages, switches to a headless JRE, and expands security-only upgrades.
ingestion/Dockerfile.ci Applies the same ingestion image package cleanup to the CI image.
ingestion/operators/docker/Dockerfile Moves the operator image to the slim Python base and adds the needed apt bootstrap step.
ingestion/operators/docker/Dockerfile.ci Applies the slim-base bootstrap and apt cleanup to the CI operator image.

Reviews (3): Last reviewed commit: "Merge branch 'main' into ingestion-vulne..." | Re-trigger Greptile

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - AGENTS.md (source)

…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.
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment thread ingestion/operators/docker/Dockerfile Resolved
libxml2 \
libkrb5-dev \
default-jdk \
default-jre-headless \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 👍 / 👎

@akashverma0786 akashverma0786 added the safe to test Add this label to run secure Github workflows on PRs label Jul 14, 2026
@akashverma0786
akashverma0786 marked this pull request as ready for review July 14, 2026 15:11
@akashverma0786
akashverma0786 requested a review from a team as a code owner July 14, 2026 15:11
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions

github-actions Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (32 flaky)

✅ 4536 passed · ❌ 0 failed · 🟡 32 flaky · ⏭️ 95 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 438 0 2 16
✅ Shard 2 11 0 0 0
🟡 Shard 3 820 0 12 8
✅ Shard 4 821 0 0 18
🟡 Shard 5 837 0 3 5
🟡 Shard 6 787 0 1 46
🟡 Shard 7 822 0 14 2
🟡 32 flaky test(s) (passed on retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Latest preview config wins when a superseded request resolves late (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 3, 2 retries)
  • Features/BulkImportWithDotInName.spec.ts › Import at schema level with dot in service name (shard 3, 1 retry)
  • Features/ContextCenterArchive.spec.ts › archive page lazy-loads more rows on scroll within its own scroll container (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Quick link created from API can be opened and deleted from hierarchy (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › description: switching articles does not bleed unsaved content into next article (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › Shared memory shows the shared-with-specific-people description (shard 3, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with view-only permission cannot see restore or delete actions on an archived document (shard 3, 2 retries)
  • Features/ContextCenterPermission.spec.ts › user with deleteAll permission can see delete action but not restore action on an archived document, and can delete it (shard 3, 2 retries)
  • Features/ContextCenterPermission.spec.ts › created-by-me filter on the archive page shows only the current user's archived documents (shard 3, 1 retry)
  • Features/Glossary/GlossaryAdvancedOperations.spec.ts › should remove domain from glossary (shard 3, 1 retry)
  • Features/Workflows/WorkflowOssRestrictions.spec.ts › workflow-node-sidebar (node palette) not rendered in edit mode (shard 5, 1 retry)
  • Flow/ExploreDiscovery.spec.ts › Should display domain and owner of deleted asset in suggestions when showDeleted is on (shard 5, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Glossary & terms creation for reviewer as user (shard 7, 1 retry)
  • Pages/Glossary.spec.ts › Approve and reject glossary term from Glossary Listing (shard 7, 2 retries)
  • Pages/Glossary.spec.ts › Drag and Drop Glossary Term (shard 7, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 7, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary CSV import preserves typed relations (shard 7, 1 retry)
  • Pages/InputOutputPorts.spec.ts › Output ports section collapse/expand (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for dashboardService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 7, 1 retry)
  • Pages/ServiceListing.spec.ts › should render the service listing page (shard 7, 1 retry)
  • Pages/TasksUIFlow.spec.ts › Create and reject tag task for Dashboard via UI (shard 7, 1 retry)
  • ... and 2 more

📦 Download artifacts

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.
@sonarqubecloud

Copy link
Copy Markdown

@ulixius9
ulixius9 merged commit 0505cc0 into main Jul 20, 2026
65 of 67 checks passed
@ulixius9
ulixius9 deleted the ingestion-vulnerability-investigation branch July 20, 2026 06:12
@gitar-bot

gitar-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 2 findings

Trims 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

📄 ingestion/operators/docker/Dockerfile:1 📄 ingestion/operators/docker/Dockerfile.ci:1
Switching the operator image base from python:3.10-bookworm to python:3.11-slim-bookworm bumps the Python minor version (3.10→3.11) in addition to slimming packages, contradicting the PR framing of 'only apt-list edits, no application-code changes'. All pip-installed ingestion extras (cx_Oracle, pyspark, pyhive, impyla, psycopg2, mysqlclient, plus the full [all]/[db2] sets) will now resolve/compile 3.11 wheels rather than the 3.10 artifacts used elsewhere; any package lacking a 3.11 wheel or with 3.11-incompatible C extensions will fail the build or at runtime. Verify the full dependency set builds and imports on 3.11 (the test plan's smoke test covers only pyhive/impyla/pyspark) and confirm the intended parity with the main ingestion image, which still runs Python 3.10 via apache/airflow:3.2.1-python3.10.

🤖 Prompt for agents
Code Review: Trims 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.

1. 💡 Quality: Confirm default-jre-headless suffices for all JVM-backed connectors
   Files: 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.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

mohittilala pushed a commit that referenced this pull request Jul 20, 2026
…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.
@mohittilala

Copy link
Copy Markdown
Contributor

Manually cherry-picked to 1.13 for 1.13.2 e4dbad2

mohittilala pushed a commit that referenced this pull request Jul 20, 2026
…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.
@mohittilala

Copy link
Copy Markdown
Contributor

Manually cherry-picked to 1.12.14 376483a

harshsoni2024 added a commit that referenced this pull request Jul 21, 2026
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]>
harshsoni2024 added a commit that referenced this pull request Jul 21, 2026
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]>

This branch was previously deployed

2 inactive (1 outdated) deployments
test — a2b3e360 Deployed Jul 16, 2026 by akashverma0786 via playwright-ci-postgresql (7, 7) #56762
security-scan — 71c58ad6 Deployed Jul 15, 2026 by akashverma0786 via notify #780
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants