Skyscanner / LambdaGuard

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

apigateway managment apis failing due to no resourceMethods #44

Open lorienpatt opened 2 years ago

lorienpatt commented 2 years ago

When using a policy to access apigateway managment apis, we recieve an error when we are accessing resources that are outside of a specific api (apikeys, usageplan). These resources have no resourceMethods in them, because they are not associated with any specific api that contains resourceMethods. https://github.com/Skyscanner/LambdaGuard/blob/master/lambdaguard/security/Public.py The above class is posting an error when we are trying to use these resources, when it should really just return if self.item.resources is empty, unless you have some other reason it should fail? https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonapigatewaymanagement.html#amazonapigatewaymanagement Using these resources the lambda is failing, as these resources are outside of a specific api in apigateway service.