def security_group_rule_count_by_group(context, security_group_id):
    return model_query(context, models.SecurityGroupIngressRule,
                   read_deleted="no").\
                   filter_by(parent_group_id=security_group_id).\
                   count()
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.