Skip to content

Add SHA256 digest support for Docker images#1

Merged
christian-andersson merged 1 commit intomainfrom
feature/docker-digest-security
Jan 26, 2026
Merged

Add SHA256 digest support for Docker images#1
christian-andersson merged 1 commit intomainfrom
feature/docker-digest-security

Conversation

@christian-andersson
Copy link
Member

Summary

  • Add SHA256 digest and secure reference fields to Docker lookups
  • Include security warnings explaining that Docker tags are NOT immutable
  • Document digest-pinned references for supply chain security

Docker tags can be moved to point to different images at any time, creating a supply chain attack vector. This PR adds digest support so users can pin to immutable references like nginx@sha256:1948e0c46....

Example Output

{
  "packageName": "nginx",
  "registry": "docker",
  "latestStable": "1.27.3",
  "digest": "sha256:1948e0c46da16a3565a844aa65ab848e1546f85cf47e47d044a567906a3a497f",
  "secureReference": "nginx@sha256:1948e0c46da16a3565a844aa65ab848e1546f85cf47e47d044a567906a3a497f",
  "securityNotes": [
    "WARNING: Docker tags are NOT immutable...",
    "Using the digest-pinned reference provides protection against tag tampering.",
    ...
  ]
}

Test plan

  • Run deno test --allow-net - all tests pass
  • Test lookup_version for Docker images returns digest
  • Test list_versions for Docker images returns digest per version
  • Verify README documentation is accurate

🤖 Generated with Claude Code

Docker tags are NOT immutable - they can be moved to point to different
images at any time. This creates a supply chain attack vector.

Changes:
- Add digest, secureReference, and securityNotes fields to VersionInfo
- Add digest field to VersionDetail for list_versions output
- Update Docker client to return SHA256 digests from Docker Hub API
- Include security warnings explaining tag mutability risks
- Document digest-pinned references in README security section

The secureReference field provides ready-to-use digest-pinned format:
  nginx@sha256:1948e0c46da16a3565a844aa65ab848e1546f85cf47e47d044a567906a3a497f

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@christian-andersson christian-andersson merged commit 49d1625 into main Jan 26, 2026
1 check failed
@christian-andersson christian-andersson deleted the feature/docker-digest-security branch January 26, 2026 11:52
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