Skip to content

am_instance gets empty config #5

Description

@erik-graf

In attackmate_api_server/routers/playbooks.py:

... 
            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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions