Running into 302 error Subscription could not be found
#7,214 opened on Mar 12, 2025
Description
Steps to Reproduce
Hi, running in a bit of an issue while executing command on azure cloud shell:
#command: prowler azure --sp-env-auth --subscription-id 'XXXXXXXXXXXXXX' --azure-region AzureUSGovernment --log-level ERROR
#Error: 2025-03-12 16:40:13,084 [File: azure_provider.py:918] [Module: azure_provider] ERROR: APIError[896] -- APIError Code: 302 message: The server returned a redirect status code 302 without a location header
2025-03-12 16:40:13,812 [File: provider.py:232] [Module: provider] CRITICAL: ResourceNotFoundError[181]: (SubscriptionNotFound) The subscription 'xxxx' could not be found. Code: SubscriptionNotFound Message: The subscription 'xxxxx' could not be found.
On a vm I am seeing one additional error while running the same above command:
2025-03-12 16:44:23,793 [File: azure_provider.py:918] [Module: azure_provider] ERROR: AttributeError[897] -- 'NoneTy pe' object has no attribute 'value'
2025-03-12 16:44:24,477 [File: provider.py:232] [Module: provider] CRITICAL: ResourceNotFoundError[181]: (Subscr iptionNotFound) The subscription 'xxx' could not be found. Code: SubscriptionNotFound Message: The subscription 'xxx' could not be found.
Expected behavior
Scan and produce a report
Actual Result with Screenshots or Logs
{"timestamp": "2025-03-12 16:47:41,065", "filename": "azure_provider.py:918", "level": "ERROR", "module": "azure_provider", "m essage": "AttributeError[897] -- 'NoneType' object has no attribute 'value'"} {"timestamp": "2025-03-12 16:47:41,512", "filename": "provider.py:232", "level": "CRITICAL", "module": "provider", "message": "ResourceNotFoundError[181]: (SubscriptionNotFound) The subscription 'redaacted' could not be found . Code: SubscriptionNotFound Message: The subscription 'redacted' could not be found."}
How did you install Prowler?
Cloning the repository from github.com (git clone)
Environment Resource
- azure -cloudshell
- azure - vm - linux redhat 9.5
OS used
- Redhat9.5 in Azure
Prowler version
5.4.0
Pip version
21.3.1
Context
No response