def match()

in qs_cfn_lint_rules/IAMExcludeReason.py [0:0]


    def match(self, cfn):
        """Basic Matching"""
        violation_matches = []
        term_matches = []
        for prop in self.SEARCH_PROPS:
            term_matches += cfn.search_deep_keys(prop)
        for tm in term_matches:
            config = tm[-1]
            if "ignore_checks" not in config:
                continue
            if "EIAMPolicyResourceWildcard" in config['ignore_checks']:
                if "ignore_reasons" not in config:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
                elif "EIAMPolicyResourceWildcard" not in config["ignore_reasons"]:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
                elif len(config["ignore_reasons"]["EIAMPolicyResourceWildcard"]) < 1:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
            if "EIAMPolicyActionWildcard" in config['ignore_checks']:
                if "ignore_reasons" not in config:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
                elif "EIAMPolicyActionWildcard" not in config["ignore_reasons"]:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
                elif len(config["ignore_reasons"]["EIAMPolicyActionWildcard"]) < 1:
                    violation_matches.append(RuleMatch(tm, LINT_ERROR_MESSAGE))
        return violation_matches