(filepath, rule_uuid=None, reason=None)
Adds a problematic rule to the blocklist.csv.

    Args:
        filepath: path to the sigma rule that caused problems
        rule_uuid: rule uuid
        reason: optional reason why file is moved
Adds a problematic rule to the blocklist.csv.
Adds a problematic rule to the blocklist . csv .
def add_problematic_rule(filepath, rule_uuid=None, reason=None):
    """Adds a problematic rule to the blocklist.csv.

    Args:
        filepath: path to the sigma rule that caused problems
        rule_uuid: rule uuid
        reason: optional reason why file is moved
    """
    blocklist_file_path = get_sigma_blocklist_path()

    # we only want to store the relative paths in the blocklist file

    try:
        sigma_rules_paths = get_sigma_rules_path()
    except ValueError:
        sigma_rules_paths = None

    if sigma_rules_paths:
        for rule_path in sigma_rules_paths:
            file_relpath = os.path.relpath(filepath, rule_path)

    # path,bad,reason,last_ckecked,rule_id
    fields = [file_relpath, 'bad', reason,
              datetime.now().strftime('%Y-%m-%d'), rule_uuid]

    with open(blocklist_file_path, 'a') as f:
        writer = csv.writer(f)
        writer.writerow(fields)
def add_problematic_rule ( filepath , rule_uuid = None , reason = None ) : blocklist_file_path = get_sigma_blocklist_path ( ) # we only want to store the relative paths in the blocklist file try : sigma_rules_paths = get_sigma_rules_path ( ) except ValueError : sigma_rules_paths = None if sigma_rules_paths : for rule_path in sigma_rules_paths : file_relpath = os . path . relpath ( filepath , rule_path ) # path,bad,reason,last_ckecked,rule_id fields = [ file_relpath , 'bad' , reason , datetime . now ( ) . strftime ( '%Y-%m-%d' ) , rule_uuid ] with open ( blocklist_file_path , 'a' ) as f : writer = csv . writer ( f ) writer . writerow ( fields )