()
return rules_path
Get Sigma rules paths.

    Returns:
        A list of strings to the Sigma rules

    Raises:
        ValueError: If SIGMA_RULES_FOLDERS is not found in the config file.
            or the folders are not readabale.
Get Sigma rules paths.
Get Sigma rules paths .
def get_sigma_rules_path():
    """Get Sigma rules paths.

    Returns:
        A list of strings to the Sigma rules

    Raises:
        ValueError: If SIGMA_RULES_FOLDERS is not found in the config file.
            or the folders are not readabale.
    """
    try:
        rules_path = current_app.config.get('SIGMA_RULES_FOLDERS', [])
    except RuntimeError as e:
        raise ValueError(
            'SIGMA_RULES_FOLDERS not found in config file') from e

    if not rules_path:
        raise ValueError(
            'SIGMA_RULES_FOLDERS not found in config file')

    for folder in rules_path:
        if not os.path.isdir(folder):
            raise ValueError(
                'Unable to open dir: [{0:s}], it does not exist.'.format(
                    folder))

        if not os.access(folder, os.R_OK):
            raise ValueError(
                'Unable to open dir: [{0:s}], cannot open it for '
                'read, please check permissions.'.format(folder))

    return rules_path
def get_sigma_rules_path ( ) : try : rules_path = current_app . config . get ( 'SIGMA_RULES_FOLDERS' , [ ] ) except RuntimeError as e : raise ValueError ( 'SIGMA_RULES_FOLDERS not found in config file' ) from e if not rules_path : raise ValueError ( 'SIGMA_RULES_FOLDERS not found in config file' ) for folder in rules_path : if not os . path . isdir ( folder ) : raise ValueError ( 'Unable to open dir: [{0:s}], it does not exist.' . format ( folder ) ) if not os . access ( folder , os . R_OK ) : raise ValueError ( 'Unable to open dir: [{0:s}], cannot open it for ' 'read, please check permissions.' . format ( folder ) ) return rules_path