util.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:ndr 作者: SecuredByTHEM 项目源码 文件源码
def setup_ndr_client_config(self):
    logging.getLogger().addHandler(logging.NullHandler())
    self._ncc = ndr.Config(NDR_CONFIG_FILE)
    self._ncc.logger = logging.getLogger()
    self._ncc.image_information_file = IMAGE_CONFIG

    self._created_files = []
    config_ndr_for_signing_and_local_queue(self)

    # Create a temporary directory for handling config files that are optional but may get
    # written out or updated or something.

    self._ncc_config_dir = tempfile.mkdtemp()

    # Override optional config files with paths that won't conflict
    self._ncc.nmap_configuration_file = self._ncc_config_dir + "/nmap_config.yml"

    # Write out the test config for testing mainrun programs
    self._ndr_config_file = create_temp_file(self)
    with open(self._ndr_config_file, 'w') as f:
        yaml_content = yaml.dump(self._ncc.to_dict())
        f.write(yaml_content)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号