コード例 #1
0
def extra_configuration_after_yield():
    """
    Setup the symlink to one folder
    """
    # Symlink pointing to testdir1
    os.remove(symlink_path)
    fim.change_internal_options(param='syscheck.symlink_scan_interval',
                                value=600)
コード例 #2
0
def extra_configuration_after_yield():
    if remoted_server is not None:
        remoted_server.stop()

    # Set default values
    change_internal_options('agent.debug', '0')
    set_state_interval(5, internal_options)
    truncate_file(CLIENT_KEYS_PATH)
コード例 #3
0
def extra_configuration_before_yield():
    """
    Setup the symlink to one folder
    """
    # Symlink pointing to testdir1
    fim.create_file(fim.SYMLINK,
                    symlink_root_path,
                    symlink_name,
                    target=testdir1)
    # Set symlink_scan_interval to a given value
    fim.change_internal_options(param='syscheck.symlink_scan_interval',
                                value=link_interval)
コード例 #4
0
def extra_configuration_before_yield():
    """ Create files and symlinks """
    symlinkdir = testdir_link
    create_file(REGULAR, testdir1, 'regular1', content='')
    create_file(REGULAR, testdir1, 'regular2', content='')
    create_file(REGULAR, testdir2, 'regular1', content='')
    create_file(REGULAR, testdir2, 'regular2', content='')
    # Symlink pointing to /testdir1/regular1
    create_file(SYMLINK,
                symlinkdir,
                'symlink',
                target=os.path.join(testdir1, 'regular1'))
    # Symlink pointing to /testdir_target/
    create_file(SYMLINK, symlinkdir, 'symlink2', target=testdir_target)
    # Set symlink_scan_interval to a given value
    change_internal_options(param='syscheck.symlink_scan_interval',
                            value=symlink_interval)
コード例 #5
0
def set_state_interval(interval, internal_file_path):
    """Set agent.state_interval value on internal_options.conf
    Args:
        interval:
            - Different than `None`: set agent.state_interval
                                     value on internal_options.conf
            - `None`: agent.state_interval will be removed
                      from internal_options.conf
    """
    if interval is not None:
        change_internal_options('agent.state_interval', interval,
                                internal_file_path, '.*')
    else:
        new_content = ''
        with open(internal_file_path) as opts:
            for line in opts:
                new_line = line if 'agent.state_interval' not in line else ''
                new_content += new_line

        with open(internal_file_path, 'w') as opts:
            opts.write(new_content)
コード例 #6
0
def extra_configuration_after_yield():
    """ Set symlink_scan_interval to default value """
    change_internal_options(param='syscheck.symlink_scan_interval', value=600)
コード例 #7
0
def extra_configuration_after_yield():
    # Set default values
    change_internal_options('agent.debug', '0')
    set_state_interval(5, internal_options)
コード例 #8
0
def extra_configuration_before_yield():
    change_internal_options('agent.debug', '2')