Skip to content

Run API and ETL in maintained non-root containers - #3161

Merged
shizn merged 2 commits into
mainfrom
codex/ossinsight-container-hardening
Nov 5, 2026
Merged

shizn merged 2 commits into
mainfrom
codex/ossinsight-container-hardening

Conversation

@shizn

@shizn shizn commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

The API and ETL Dockerfiles used unsupported Node 18/Ruby 2.7 bases and root runtimes. The API build also referenced an obsolete per-package lockfile, while ETL startup installed gems and automatically performed database maintenance.

Use digest-pinned Node 24.22.2 and Ruby 3.4.12 images with non-root users, root-owned application/configuration files, separate build stages, and healthchecks. Build the API from the current workspace with frozen dependencies and disabled lifecycle scripts; explicitly compile only SQLite. Exclude environment files, private keys and encrypted Rails credentials from image contexts.

Upgrade ETL to Rails 8.1.4.1 and mysql2 0.5.7, replacing the obsolete TiDB adapter with the standard MySQL adapter. Refresh and checksum the Ruby lockfile, remove the incompatible development annotation hook, and use Selenium's driver manager. Support the image's MariaDB client with certificate/hostname verification. ETL startup now only runs ingestion; schema/seed maintenance remains explicit. A progress heartbeat covers completed polls and deliberate rate-limit waits.

Validation completed locally:

  • 566 API security tests across 39 suites; 15 Ruby tests / 82 assertions; workflow validation.
  • Ruby advisory database audit: no known vulnerabilities in the resolved bundle.
  • Both production images build and run without root or writable application files.
  • Real TiDB 8.5.4: verified TLS, six rejection checks for incorrect hostname/CA and plaintext connections, SQL import, Rails event ingestion, repeated-poll deduplication, schema dumping and heartbeat.
  • Full API container startup, seven HTTP security checks, native SQLite 3.52.0, configured healthcheck and graceful SIGTERM shutdown.

Linux amd64 CI 41948659251 passed both verification jobs, including the added image/TiDB checks. Final Trivy 0.76.1 scans report zero fixable high/critical vulnerabilities in either runtime image; the API runtime removes unused npm/Yarn bundles. Production cutover of the customized ETL worker is still pending; it requires preserving its capture/deduplication code and durable paths, a rollback copy, and a single active poller. See ops/container-security/README.md for build, runtime and rollout instructions.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ossinsight-docs Ready Ready Preview Nov 5, 2026 1:28am UTC
ossinsight-web Ready Ready Preview Nov 5, 2026 1:28am UTC

Request Review

@shizn
shizn marked this pull request as ready for review November 5, 2026 01:36
@shizn
shizn merged commit 263303c into main Nov 5, 2026
5 checks passed
@shizn
shizn deleted the codex/ossinsight-container-hardening branch November 5, 2026 01:36

This branch was successfully deployed

2 active deployments
Preview – ossinsight-web — cca1a542 Deployed Nov 5, 2026 by vercel[bot]
Preview – ossinsight-docs — cca1a542 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant