'alert when an IAM Role has an assume_role_policy_document but using a star
instead of limiting the assume to a specific IAM Role.'

def check_star_assume_role_policy(self, iamrole_item):

    tag = '{0}    allows    assume-role    from    anyone'.format(self.i_am_singular)
    def check_statement(statement):
        action = statement.get('Action', None)
        if (action and (action == 'sts:AssumeRole')):
            effect = statement.get('Effect', None)
            if (effect and (effect == 'Allow')):
                principal = statement.get('Principal', None)
                if (not principal):
                    return
                if (type(principal) is dict):
                    aws = principal.get('AWS', None)
                    if (aws and (aws == '*')):
                        self.add_issue(10, tag, iamrole_item, notes=json.dumps(statement))
                    elif (aws and (type(aws) is list)):
                        for entry in aws:
                            if (entry == '*'):
                                self.add_issue(10, tag, iamrole_item, notes=json.dumps(statement))
    assume_role_policy = iamrole_item.config.get('AssumeRolePolicyDocument', {})
    statement = assume_role_policy.get('Statement', [])
    if (type(statement) is dict):
        statement = [statement]
    for single_statement in statement:
        check_statement(single_statement)
