security: pin Docker base images by digest + add .dockerignore (PER-8633)#50
Open
Shivanshu-07 wants to merge 1 commit into
Open
security: pin Docker base images by digest + add .dockerignore (PER-8633)#50Shivanshu-07 wants to merge 1 commit into
Shivanshu-07 wants to merge 1 commit into
Conversation
…633) Breaks the C-001 supply-chain chain (unpinned BASE_IMAGE -> build-time RCE -> exfiltration of committed RSA test keys and source tree). - .buildkite/pipeline.yml: pin all three test base images (ruby 2.6/2.7/3.0 -alpine) to immutable @sha256 digests, so the trusted CI path cannot have a mutable tag swapped for a malicious image. - Makefile: digest-pin the default BASE_IMAGE for local `make build`. - Add .dockerignore to keep .git/.github/.buildkite and env files out of the build context (spec/ is intentionally kept — `make test` runs rspec inside the container and needs the SSL fixtures there). Follow-ups noted on the ticket (out of scope here, higher risk / ops): commit Gemfile.lock + `bundle install --frozen`, and rotate the committed test RSA keys / confirm trusted-ca.crt is absent from any prod/staging trust store. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Impact analysis + automated reviewImpact — no existing functionality breaks. Docker base images are digest-pinned to the same Ruby patch versions (verified against Docker Hub), and the new
|
pranavz28
approved these changes
Jun 26, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaks the High-severity supply-chain chain PER-8633 (C-001, combined CVSS 9.1): an unpinned
BASE_IMAGElets an attacker who can influence the pipeline substitute a malicious image, gaining build-time RCE;ADD . /app/srcthen copies the committed RSA test keys and full source into an attacker-controlled layer for exfiltration.Changes
.buildkite/pipeline.yml— pinned all three test base images (ruby:2.6/2.7/3.0-alpine) to immutable@sha256digests. The legitimate CI path can no longer have a mutable tag swapped for a tampered image. (Multi-version testing preserved.)Makefile— digest-pinned the defaultBASE_IMAGEused by localmake build..dockerignore(new) — keeps.git/,.github/,.buildkite/and env files out of the build context.spec/is intentionally kept in the context:make testrunsbundle exec rspecinside the container, so the SSL fixtures underspec/support/ssl/must be present. Excluding it would silently break the test suite.Out of scope (flagged on the ticket as follow-ups)
Gemfile.lock+ runbundle install --frozenfor reproducible resolution (touches dependency resolution; better as its own change).spec/support/ssl/*.key) and confirmtrusted-ca.crtis not present in any prod/staging trust store — an ops action, not a code change.Verification
pipeline.ymlparses cleanly; digests resolved live from Docker Hub registry for eachruby:*-alpinetag.Closes PER-8633 (chain entry pinned; data-exfil follow-ups flagged).
🤖 Generated with Claude Code