ScoutSuite's "--local" option (valid for the AWS provider; I haven't tested the others) is documented as follows:
-l, --local Use local data previously fetched and re-run the analysis.
Using previously-fetched data implies no need to hit the provider again, which in turn implies no need for valid credentials. However, the first thing that it does, even in "--local" mode, is:
2024-07-24 14:09:40 <redacted> scout[11483] INFO Authenticating to cloud provider
If the user's credentials have expired, ScoutSuite fails:
2024-07-24 14:09:43 <redacted> scout[11483] ERROR __main__.py L217: Authentication failure: An error occurred (ExpiredToken) when calling the GetCallerIdentity operation: The security token included in the request is expired
When run with the "--debug" argument, ScoutSuite provides the following stack trace:
Traceback (most recent call last):
File "<redacted>/ScoutSuite/ScoutSuite/providers/aws/authentication_strategy.py", line 50, in authenticate get_caller_identity(session)
File "<redacted>/ScoutSuite/ScoutSuite/providers/aws/utils.py", line 10, in get_caller_identity identity = sts_client.get_caller_identity()
File "<redacted>/ScoutSuite/test-venv/lib/python3.10/site-packages/botocore/client.py", line 565, in _api_call
return self._make_api_call(operation_name, kwargs)
File "<redacted>/ScoutSuite/test-venv/lib/python3.10/site-packages/botocore/client.py", line 1021, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ExpiredToken) when calling the GetCallerIdentity operation: The security token included in the request is expired
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<redacted>/ScoutSuite/ScoutSuite/__main__.py", line 217, in _run
credentials = auth_strategy.authenticate(profile=profile,
File "<redacted>/ScoutSuite/ScoutSuite/providers/aws/authentication_strategy.py", line 60, in authenticate
raise AuthenticationException(e)
ScoutSuite.providers.base.authentication_strategy.AuthenticationException: An error occurred (ExpiredToken) when calling the GetCallerIdentity operation: The security token included in the request is expired
To Reproduce
Obtain temporary credentials to an AWS account that have at least the minimum permissions required to run a ScoutSuite scan.
Run a ScoutSuite scan against the target account: scout aws --force --no-browser.
Wait until the temporary credentials have expired. I suspect that also works to tamper with the credentials so that they are no longer valid but I did not test this.
Attempt to re-analyze the previously-retrieved data: scout aws --force --no-browser --local.
This is the case because the valid credentials are being used to evaluate a few details about the cloud environment which are used to define the name of the output files and possibly a few other things.
Describe the bug
ScoutSuite's "--local" option (valid for the AWS provider; I haven't tested the others) is documented as follows:
Using previously-fetched data implies no need to hit the provider again, which in turn implies no need for valid credentials. However, the first thing that it does, even in "--local" mode, is:
If the user's credentials have expired, ScoutSuite fails:
When run with the "--debug" argument, ScoutSuite provides the following stack trace:
To Reproduce
scout aws --force --no-browser
.scout aws --force --no-browser --local
.