Repository navigation
[Host] Validate and bound remote image references and names - #362
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33ASKvABvYfZMteizUKR
|
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.



Pull Request
📖 Description
Remote base-image label references, Docker Engine container image references and Docker Hub repository names reached length-limited PostgreSQL columns unchecked, so one oversized value failed the final save of a whole scan or discovery run. They are now checked against Docker's reference grammar (registry ≤ 200, repository ≤ 255, tag ≤ 128, invalid digest becomes none), and display names (container name, Compose labels, discovered image name, relationship source reference) are cut to their column length, while container IDs over 200 characters are skipped. The grammar also rejects
.and..path segments, which keeps remote references from steering registry and Docker Hub request paths. A base-image label the parser rejects no longer fails the whole observed-image scan, and an invalid runtime container reference ends the run partial withContainer '<name>' could not be processed: invalid image reference. Decision record 0014 is extended and the affected area documents are updated; a U+0000 in remote strings was already handled by #359.🎫 Issues
Closes #355
💬 Reviewer Notes
Security area change (registry/Docker Hub calls, Docker Engine access, logging of external data); the dot-segment guard is
RegistryReferenceValidator.IsValidRepository. Manual registration keeps its old parsing and is covered by the follow-up #360. The existing tests whose inputs the new grammar rejects were adapted to still prove control-character replacement.📑 Test Plan
New unit tests per acceptance criterion in the validator, label reader,
CutToLength, both registry clients, the Docker Hub discovery,DockerInstanceClient,ImageScanOrchestratorandRuntimeContainerScanOrchestrator; no reproduction against a live PostgreSQL, because the test databases do not enforce column lengths. Local run: 877 + 21 tests pass, new/changed code 100 % covered, overall 87.9 %.✅ Checklist
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (line coverage on new or changed production code and overall).README.md,ARCHITECTURE.md) to reflect my changes..squad/stack.mdprescribes.csharp.instructions.mdare followed.⏭ Next Steps
.and..repository segments #360 Registry request paths pass.and..repository segments