Compare commits

...

5 Commits

Author SHA1 Message Date
Andoni A.
dcebd2bdf7 Revert "fix(sdk): simplify inline comment"
This reverts commit 09c71d62af.
2026-04-16 11:22:54 +02:00
Andoni A.
09c71d62af fix(sdk): simplify inline comment 2026-04-16 11:22:05 +02:00
Andoni A.
70a0b705b6 docs(sdk): fix UNRELEASED version to 5.25.0 2026-04-16 11:05:33 +02:00
Andoni A.
04a2ebac6f docs(sdk): add changelog entry for Cloudflare connection test fix 2026-04-16 10:56:24 +02:00
Andoni A.
2a387bf4a9 fix(sdk): allow account-scoped tokens in Cloudflare connection test
- Let 9109 error from user.get() fall through to accounts.list() fallback
2026-04-16 10:30:26 +02:00
2 changed files with 12 additions and 7 deletions

View File

@@ -2,6 +2,14 @@
All notable changes to the **Prowler SDK** are documented in this file.
## [5.25.0] (Prowler UNRELEASED)
### 🐞 Fixed
- Cloudflare account-scoped API tokens failing connection test in the App with `CloudflareUserTokenRequiredError` [(#10723)](https://github.com/prowler-cloud/prowler/pull/10723)
---
## [5.24.0] (Prowler v5.24.0)
### 🚀 Added

View File

@@ -332,19 +332,16 @@ class CloudflareProvider(Provider):
return
except PermissionDeniedError as error:
error_str = str(error)
# Check for user-level authentication required (code 9109)
if "9109" in error_str:
logger.error(f"CloudflareUserTokenRequiredError: {error}")
raise CloudflareUserTokenRequiredError(
file=os.path.basename(__file__),
)
# Check for invalid API key or email (code 9103) - comes as 403
if "9103" in error_str or "Unknown X-Auth-Key" in error_str:
logger.error(f"CloudflareInvalidAPIKeyError: {error}")
raise CloudflareInvalidAPIKeyError(
file=os.path.basename(__file__),
)
# For other permission errors, try accounts.list() as fallback
# For permission errors (including 9109 account-scoped tokens),
# try accounts.list() as fallback before failing.
# Error 9109 means the token is account-scoped, not user-level,
# which is valid for scanning — only fail if accounts.list() also fails.
logger.warning(
f"Unable to retrieve Cloudflare user info: {error}. "
"Trying accounts.list() as fallback."