def get_rulegroups_summary()

in ingest_suricata_rules/summary_report.py [0:0]


def get_rulegroups_summary(rulegroups):
    total_rule_count = 0
    total_rulegroup_capacity = 0
    for rulegroup in rulegroups:
        response = anf.describe_rule_group(
            RuleGroupName=rulegroup["Name"],
            RuleGroupArn=rulegroup["Arn"],
            Type=rulegroup_type)
        
        rulestring = response["RuleGroup"]["RulesSource"]["RulesString"]
        rulegroup_capacity = response["RuleGroupResponse"]["Capacity"]
        rules=rulestring.splitlines()
        print(rulegroup["Name"]+" : " + str(len(rules)) + " / " + str(rulegroup_capacity))
        total_rule_count = total_rule_count + len(rules)
        total_rulegroup_capacity = total_rulegroup_capacity + int(rulegroup_capacity)
    print("Total Rule Count : ", total_rule_count)
    print("Total RuleGroup Capacity : ", total_rulegroup_capacity)