Skip to content

[infra] Docker reproducibility & hardening: pin base images, secure Neo4j, fix .dockerignore #90

Description

@rahulkatiyar19955

Severity

Medium

Summary

Container build/runtime hardening gaps reduce reproducibility and weaken the local security posture: base images are unpinned, the Neo4j default password is committed in compose with Bolt bound to all interfaces, and .dockerignore omits heavy/sensitive paths that several images pull into their build context.

Findings

  • Base images unpinned across all Dockerfiles and compose — every Dockerfile uses FROM python:3.11-slim and docker-compose.yml:27 uses neo4j:5-community, none pinned by digest. Combined with lockfile-less installs (tracked separately), image contents float across rebuilds; a python:3.11-slim re-tag can change OS libraries that the vendored DuckDB / grafted libprotobuf.so.23 in backend/Dockerfile:16-40 depends on. fix: pin base images by digest (FROM python:3.11-slim@sha256:..., neo4j:5-community@sha256:...) and bump them deliberately.
  • Default Neo4j password committed; Bolt published on all interfaces; gatekeeperAssess:falsedocker-compose.yml:34,58,149 default NEO4J_AUTH/NEO4J_PASSWORD to neo4j/datapilot-local in three services, and docker-compose.yml:30-31 publishes 7474/7687 on 0.0.0.0, so a default-password DB is reachable from the LAN. electron-builder.yml:29 sets gatekeeperAssess: false. Not a committed secret, but weak for a port-exposed database on a local-first app. fix: generate a random per-install Neo4j password in the main process and bind published ports to 127.0.0.1 only.
  • .dockerignore omits heavy/secret paths — .dockerignore excludes node_modules/, out/, .env*, backend/.venv/ but not release/, sample_bags/, *.mcap/*.db3/*.bag, docs/, mock_design/, or .pytest_cache/. Several worker images build with context: . (repo root, per docker-publish.yml:62-86), so the build context can balloon and may sweep in bulky/sensitive files. fix: add release/, sample_bags/, *.mcap, *.db3, *.bag, docs/, mock_design/, and .pytest_cache/ to .dockerignore.

Project-rule reference

AGENT.md ## Security & Privacy Guardrails (line 306), ### Databases (line 164), ### Secrets (line 169); local-first privacy requirement (line 308).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraBuild, CI, tests, packaging, DockersecuritySecurity or privacy issueseverity:mediumRobustness / maintainabilitytech-debtMaintainability, dead code, duplication, types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions