LambdaGuard icon indicating copy to clipboard operation
LambdaGuard copied to clipboard

apigateway managment apis failing due to no resourceMethods

Open lorienpatt opened this issue 2 years ago • 0 comments

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.

  • arn:${Partition}:apigateway:${Region}::/usageplans/${UsagePlanId}/keys
  • arn:${Partition}:apigateway:${Region}::/apikeys

lorienpatt avatar Jul 12 '22 21:07 lorienpatt