ait-testbed / ait-testbed/attackmate-api-server

am_instance gets empty config

未关闭
#5 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
0
派生
1
PR 合并指标
30 天内没有已合并 PR

描述

In attackmate_api_server/routers/playbooks.py:

```async def execute_playbook_from_yaml(
...
playbook = Playbook.model_validate(playbook_dict)
logger.info(f'Creating transient AttackMate instance, ID: {instance_id}')
am_instance = AttackMate(playbook=playbook, config=attackmate_config, varstore=None)
```

attackmate_config is empty, and msfrpcd connection does not work because of it.

I inserted this before am_instance:

```
if state.attackmate_config is None:
raise HTTPException(status_code=500, detail="AttackMate configuration is not loaded.")
```

and got the 500 upon trying.

Also,

`am_instance = AttackMate(playbook=playbook, config=attackmate_config, varstore=None)`

does not work, which I changed to:

`am_instance = AttackMate(playbook=playbook, config=attackmate_config, varstore=None, is_api_instance=True)`

for testing, which works. Otherwise the attackmate-client can't connect to the remote-api.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。