Commit Graph
7736 Commits
Author SHA1 Message Date
Andoni A. acbfdfa4b2 fix(image): address PR review items for image provider
- Remove dead docker login/pull/logout code and exceptions
- Fix finding metadata: empty RelatedUrl, Categories per finding type
- Replace SystemExit(0) with _listing_only flag in registry listing
- Use dynamic prowler_version in User-Agent header
- Normalize image UID by stripping protocol prefix on save
- Skip compliance and attack surface tasks for Image and IaC providers
- Add tests for scan_per_image and IMAGE scan path
2026-02-18 12:24:35 +01:00
Andoni A. 7bd13cdf39 fix(image): set custom User-Agent to avoid Cloudflare bot blocking
Cloudflare bot management on Docker Hub blocks the default
python-requests User-Agent from container IPs, returning HTTP 500.
Add a Prowler/1.0 User-Agent header to all registry requests and
include truncated response body in 5xx retry logs for diagnostics.
2026-02-18 11:08:33 +01:00
Andoni A. 34cbacc105 feat(image): add IMAGE scan path with per-image progress
- Add scan_per_image() generator to ImageProvider for per-image yields
- Replace single-shot IMAGE execution in Scan.scan() with per-image progress
- Extend checks_loader bypass to include IMAGE provider
2026-02-18 10:19:12 +01:00
Andoni A. 12f1a4f3bb fix(image): add 5xx retry and better diagnostics for Docker Hub auth
- Add server error retry with exponential backoff in _request_with_retry
- Include truncated response body in Docker Hub login errors
- Add debug logging for login attempts
2026-02-18 10:16:41 +01:00
Andoni A. 923ee82830 chore(api): bump Trivy to 0.69.1 2026-02-18 09:42:18 +01:00
Andoni A. a5e5217e60 fix(image): use Trivy native auth instead of docker login/pull
- Pass TRIVY_USERNAME/TRIVY_PASSWORD env vars for registry auth
- Remove docker login, docker pull, and docker logout dependencies
- Eliminates need for Docker binary inside the worker container
2026-02-18 09:24:43 +01:00
Andoni A. 707b3b484e chore(api): update poetry.lock for image provider SDK branch 2026-02-18 08:59:45 +01:00
Andoni A. 348808b37f feat(image): add image provider scan support to Scan class and API layer
- Add image provider handling in Scan class alongside IaC (skip check loading, run Trivy directly)
- Add image provider API models, serializers, and connection check logic
- Point API SDK dependency to this feature branch
- Add test notebook for image provider API workflow
2026-02-18 08:59:13 +01:00
Andoni A. 15557b9f6c test(image): add tests for SSRF, credential redaction, empty tokens, and DockerHub enumeration
- SSRF: reject file/ftp schemes, private/loopback/link-local IPs, accept public URLs
- Credential redaction: __getstate__ redacts password/token, properties still work
- Empty token guards: OCI bearer, DockerHub JWT, DockerHub registry token
- Narrow except: invalid UTF-8 base64 falls through correctly
- Fix namespace test to expect ImageRegistryCatalogError instead of AuthError
- Add registry_list_images=False to all Namespace objects missing it
- Add DockerHub enumeration integration test verifying repo:tag format
2026-02-17 11:40:31 +01:00
Andoni A. a692351f93 fix(image): harden registry adapter layer against SSRF, credential leaks, and edge cases
- Add SSRF protection for bearer token realm URLs (reject private/loopback IPs, non-http(s) schemes)
- Protect credentials from serialization via __getstate__ redaction and private attrs with properties
- Change missing DockerHub namespace exception from AuthError to CatalogError
- Add empty-token guards in OCI bearer flow and DockerHub JWT/registry token endpoints
- Narrow except Exception to except (ValueError, UnicodeDecodeError) in base64 decode
2026-02-17 11:25:38 +01:00
Andoni A. ed97fcd059 fix(image): add None guard, top-level import, and 401-retry to registry adapters
Add early return in _resolve_basic_credentials when password is None
to prevent TypeError on base64.b64decode. Move DockerHubAdapter import
from local scope to top-level in image_provider.py per PEP 8. Add
one-time 401 retry with token refresh in _authed_request to handle
per-repository-scoped bearer tokens on strict OCI registries.
2026-02-17 10:59:49 +01:00
Andoni A. b9060bebb0 style(image): apply black formatting to image provider files 2026-02-17 10:33:48 +01:00
Andoni A. e8ab331dff refactor(image): remove dead code from registry adapter layer
Remove unused detect_registry_type() function and _ECR_PATTERN constant
from factory.py, along with their corresponding tests. Move requests
import behind TYPE_CHECKING guard in oci_adapter.py and
dockerhub_adapter.py since it is only used for type annotations.
2026-02-17 10:17:46 +01:00
Andoni A. d9e451489d fix(image): harden registry adapter layer
- Fix shared dict mutation in ImageBaseException (thread-safety)
- Handle unexpected status codes in OCI adapter auth flow
- Force TLS verification for Docker Hub endpoints
- Add credential-safe __repr__ to RegistryAdapter
- Rename _next_page_url override to _next_tag_page_url in DockerHubAdapter
- Distinguish rate-limit from connection errors in retry logic
- Add type hints to all public adapter methods
- Remove unused imports in test files (flake8)
2026-02-17 10:01:35 +01:00
Andoni A. b00c76acf2 test(image): update mock patch targets after base class refactor
Update test patches from adapter-level to base-level module paths since
requests and time are now imported in base.py. Consolidate separate
requests.post/requests.get patches into requests.request since all HTTP
calls now go through _request_with_retry.
2026-02-17 09:41:57 +01:00
Andoni A. 46e55a3351 test(image): add --registry-list validation tests and factory comment
- Add test_registry_list_without_registry_fails: validates that
  --registry-list without --registry returns an error
- Add test_registry_list_with_registry_passes: validates the happy path
- Add clarifying comment in factory.py about ECR using OCI adapter
2026-02-17 09:39:52 +01:00
Andoni A. 103f71c215 fix(image): use correct singular/plural in registry listing output
Handle "1 repository" vs "2 repositories" and "1 image" vs "2 images"
in _print_registry_listing output.
2026-02-17 09:39:29 +01:00
Andoni A. 310a32e391 refactor(image): deduplicate retry logic into registry adapter base class
- Move _request_with_retry, _next_page_url, _MAX_RETRIES, _BACKOFF_BASE
  from OciRegistryAdapter and DockerHubAdapter into RegistryAdapter base
- Add context_label parameter to _request_with_retry for contextual
  error/warning messages (defaults to self.registry_url)
- Route _hub_login and _get_registry_token through retry logic
- Change 404 exception in _check_hub_response from ImageRegistryAuthError
  to ImageRegistryCatalogError (missing namespace is not an auth failure)
- Remove redundant time, requests imports from leaf adapters
2026-02-17 09:39:15 +01:00
Andoni Alonso 402b33516b Merge branch 'master' into feat/PROWLER-939-stage-2-registry-auth 2026-02-17 09:17:03 +01:00
Andoni A. 5e2ed6a37c docs(image): remove redundant version badges from subsections
All features ship in 5.19.0 with the provider; subsection badges are
unnecessary since the top-level Prowler CLI badge already covers it.
2026-02-17 09:10:06 +01:00
Andoni A. 8ef231faae docs(image): update docs and changelog for public Docker Hub support
- Add note about public namespace scanning without credentials to docs
- Update changelog entry to mention public Docker Hub support
2026-02-17 09:06:38 +01:00
Andoni A. 304fa25f25 feat(image): support public Docker Hub registry scan without credentials
- Use public /v2/repositories/{ns}/ endpoint when unauthenticated
- Fall back to namespace API when JWT is available for private repos
- Add test for unauthenticated public namespace listing
2026-02-17 08:43:01 +01:00
Andoni A. ffeaeb760e docs(image): document registry scan mode and --registry-list flag
Add Registry Scan Mode section covering --registry, --image-filter,
--tag-filter, --max-images, --registry-insecure, and the new
--registry-list flag for image discovery.
2026-02-17 08:02:41 +01:00
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
Prowler Botandprowler-bot df8a7220ff feat(oraclecloud): Update commercial regions (#10082)
Co-authored-by: prowler-bot <179230569+prowler-bot@users.noreply.github.com>
2026-02-16 14:23:28 +01:00
Daniel Barranquero a106cdf4c9 fix: oci regions actions labels (#10083) 2026-02-16 14:23:17 +01:00
Daniel Barranquero a86f0b95bc fix(oci): update regions script to handle raw credentials (#10081) 2026-02-16 14:03:27 +01:00
Josema Camacho bb34f6cc3d refactor(api): remove graph_database and is_graph_database_deleted from AttackPathsScan (#10077) 2026-02-16 12:46:49 +01:00
Daniel Barranquero be516f1dfc feat(openstack): Add 7 New Compute Security Checks (#9944) 2026-02-16 11:46:48 +01:00
90e317d39f fix(kms): detect public access for any KMS action, not just kms:* (#10071)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jfagoagas <16007882+jfagoagas@users.noreply.github.com>
Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
2026-02-16 10:12:29 +01:00
Pedro MartínandHugo Pereira Brito 21bdbacdfb chore(readme): update and add skill (#10067)
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-02-16 09:31:21 +01:00
75ee07c6e1 chore(gcp): enhance metadata for logging service (#9648)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-02-13 16:37:07 +01:00
ddc5d879e0 chore(gcp): enhance metadata for kms service (#9647)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-02-13 16:32:26 +01:00
006c2dc754 chore(gcp): enhance metadata for iam service (#9646)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-02-13 16:24:52 +01:00
Rubén De la Torre VicoandHugoPBrito 4981d3fc38 chore(gcp): enhance metadata for gke service (#9645)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 16:14:14 +01:00
cceaf1ea54 chore(gcp): enhance metadata for gcr service (#9644)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-02-13 15:55:00 +01:00
Rubén De la Torre VicoandHugoPBrito b436da27c8 chore(gcp): enhance metadata for dns service (#9643)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 15:47:30 +01:00
Rubén De la Torre VicoandHugoPBrito 82be83c668 chore(gcp): enhance metadata for dataproc service (#9642)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 14:57:33 +01:00
Andoni Alonso 4f18bfc33c feat(iam): add ECS Exec privilege escalation detection (ECS-006) (#10066) 2026-02-13 14:45:33 +01:00
Rubén De la Torre VicoandHugoPBrito 941f9b7e0b chore(gcp): enhance metadata for compute service (#9641)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 14:29:38 +01:00
9da0b0c0b1 feat(github): add organization domain verification check (#10033)
Co-authored-by: Kush321 <kushp2018@gmail.com>
Co-authored-by: Andoni A. <14891798+andoniaf@users.noreply.github.com>
2026-02-13 13:41:17 +01:00
Rubén De la Torre VicoandHugoPBrito 8c1da0732d chore(gcp): enhance metadata for cloudsql service (#9639)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 13:35:34 +01:00
Andoni A. 3a2960fd09 Merge remote-tracking branch 'origin/master' into feat/PROWLER-939-stage-2-registry-auth 2026-02-13 13:31:17 +01:00
Josema Camacho 02b58d8a31 fix(api): mark attack paths scan as failed when celery task fails (#10065) 2026-02-13 13:20:38 +01:00
Rubén De la Torre VicoandHugoPBrito 3defbcd386 chore(gcp): enhance metadata for cloudstorage service (#9640)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
2026-02-13 13:17:58 +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
Josema Camacho ceb4691c36 build(deps): bump cryptography to 44.0.3 and py-ocsf-models to 0.8.1 (#10059) 2026-02-13 12:36:38 +01:00