in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py [0:0]
def match(self, cfn):
"""
Match against IAM roles with Lambda as principal and stars in actions
"""
matches = []
for key, value in cfn.get_resources(["AWS::IAM::Role"]).items():
principals = self._get_principals(value.get("Properties", {}))
actions = self._get_actions(value.get("Properties", {}))
if "lambda.amazonaws.com" in principals and any([a == "*" or ":*" in a for a in actions]):
matches.append(RuleMatch(["Resources", key], self._message.format(key)))
return matches