Skip to content

[Host] Validate and bound remote image references and names - #362

Merged
LarsLaskowski merged 23 commits into
mainfrom
claude/lucid-franklin-beqpkm
Oct 28, 2026
Merged

LarsLaskowski merged 23 commits into
mainfrom
claude/lucid-franklin-beqpkm

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

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 with Container '<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, ImageScanOrchestrator and RuntimeContainerScanOrchestrator; 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

  • I have added or updated Unit Tests for the change.
  • I have tested my changes.
  • I have run Format and Build from .squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file.
  • The Coverage gate in .squad/stack.md passes (line coverage on new or changed production code and overall).
  • I have updated the project documentation (README.md, ARCHITECTURE.md) to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • New dependencies, if any, were added the way Dependencies in .squad/stack.md prescribes.
  • The C# rules in csharp.instructions.md are followed.

⏭ Next Steps

claude added 23 commits October 28, 2026 05:52
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
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski marked this pull request as ready for review October 28, 2026 07:01
@LarsLaskowski
LarsLaskowski merged commit 2bee289 into main Oct 28, 2026
6 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/lucid-franklin-beqpkm branch October 28, 2026 16:09
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.

[BUG] Remote image references and names outside registry tag data can exceed stored column lengths

2 participants