Skyscanner / LambdaGuard

AWS Serverless Security
Apache License 2.0
400 stars 69 forks source link

An error occurred (InvalidClientTokenId) when calling the SimulateCustomPolicy operation: The security token included in the request is invalid #32

Closed andushow closed 4 years ago

andushow commented 4 years ago

I don't know if you've stumbled upon this before, but i keep getting this error. Setup: Running in AWS Cloud9. Running: lambdaguard --keys aws_access_key_id aws_secret_access_key --region eu-west-3

An example:

[2020-08-19 16:44] [arn:aws:lambda:eu-west-3:365579225032:function:vf-backend-test-test-readUserSettings] Traceback (most recent call last): File "/home/ec2-user/.local/lib/python3.6/site-packages/lambdaguard/core/Lambda.py", line 63, in get_function if self.identity.acl.allowed("lambda:GetFunction"): File "/home/ec2-user/.local/lib/python3.6/site-packages/lambdaguard/utils/acl.py", line 99, in allowed ActionNames=[action] File "/home/ec2-user/.local/lib/python3.6/site-packages/botocore/client.py", line 316, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/ec2-user/.local/lib/python3.6/site-packages/botocore/client.py", line 635, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the SimulateCustomPolicy operation: The security token included in the request is invalid

adeptex commented 4 years ago

Hi @andushow seems that there is a problem with your credentials. If you need the MFA security token, then you have to first setup a profile with the creds+token