Commit Graph
9 Commits
Author SHA1 Message Date
Andoni A. 876702fd22 feat(image): add --registry-list flag for image discovery
Add --registry-list flag that enumerates registry repositories and tags,
then prints a structured listing and exits without scanning. This helps
users discover available images before building --image-filter or
--tag-filter regexes.
2026-02-17 07:44:41 +01:00
Andoni A. 326def4a17 fix(image): handle Basic auth challenge and pre-encoded ECR credentials
- Detect Basic auth challenges (non-Bearer) in _ensure_auth()
- Decode base64-wrapped credentials from aws ecr get-authorization-token
- Add unit tests for credential resolution and Basic auth flow
2026-02-16 17:50:05 +01:00
Andoni A. aa284b8b24 test(image): add comprehensive registry scan mode unit tests
69 tests covering:
- Factory auto-detection (OCI, Docker Hub, ECR URL patterns)
- OCI adapter (auth flows, pagination, retry, error handling)
- Docker Hub adapter (namespace extraction, Hub API, token exchange)
- Argument validation (registry flags, Docker Hub namespace)
- Provider integration (enumeration, filtering, max-images, dedup)
2026-02-16 15:42:02 +01:00
Andoni A. ace36fe76e feat(image): add registry scan mode with OCI, Docker Hub, and ECR support
Add pluggable registry adapter pattern for enumerating and scanning all
container images in a private registry. Supports:
- Generic OCI registries (Harbor, GitLab, JFrog) via /v2/_catalog
- Docker Hub via Hub REST API with namespace-based enumeration
- AWS ECR via standard OCI endpoints with ECR auth token

New CLI flags: --registry, --image-filter, --tag-filter, --max-images,
--registry-insecure
2026-02-16 15:35:55 +01:00
Andoni A. 6b0a139361 Merge remote-tracking branch 'origin/master' into feat/PROWLER-939-stage-2-registry-auth
# Conflicts:
#	prowler/CHANGELOG.md
#	prowler/lib/check/models.py
#	prowler/providers/common/provider.py
#	prowler/providers/image/exceptions/exceptions.py
#	prowler/providers/image/image_provider.py
#	tests/providers/image/image_provider_test.py
2026-02-13 13:09:51 +01:00
Andoni A. 0589721505 fix(image): include missing merge changes from stage-1 and docs branches
The pre-commit hook stash/restore cycle during the first merge caused
some auto-merged changes to be excluded from the merge commits. This
commit includes the remaining changes: error code renumbering (9000→11000
range), input validation, image config scanners, and docs branch updates.
2026-02-12 22:38:11 +01:00
Andoni Alonso aa7490aab4 feat(image): add container image provider for CLI scanning (#9984) 2026-02-12 16:36:48 +01:00
Andoni A. f7adbc2dcf feat(image): add docker login and pull for private registry authentication
Trivy's remote source cannot authenticate against Docker Hub (and some
other registries) even after docker login. This adds a docker login +
docker pull flow before scanning so Trivy can access private images
from the local Docker daemon.

- Add _docker_login, _docker_pull, _docker_logout, cleanup methods
- Add _extract_registry to determine registry from image reference
- Wrap run() in try/finally to ensure cleanup on success or error
- Wire registry credentials from CLI args to ImageProvider
- Add ImageDockerLoginError and ImageDockerNotFoundError exceptions
2026-02-06 15:08:42 +01:00
Andoni A. 31d9a23225 feat(image): add container image provider for CLI scanning
Add a new Image provider that uses Trivy for container image vulnerability
and secret scanning, integrated into the Prowler CLI.

- ImageProvider class with Trivy integration for vuln/secret/misconfig scanning
- CLI support via `prowler image -I <image>` with severity filters, timeout,
  ignore-unfixed, and image-list-file options
- CheckReportImage model for image-specific findings
- Custom exceptions (9000-9005) with clear remediation messages
- Error handling for Trivy failures (non-zero exit, binary not found)
- Batch processing of findings with progress bar
- test_connection() for registry accessibility checks
- Comprehensive test coverage
2026-02-06 13:59:48 +01:00