pip install fastapi uvicorn httpx PyYAML pydantic bcrypt==3.2.2 !! otherwise passlib complains
uvicorn remote_rest.main:app --host 0.0.0.0 --port 8000 --reload
[] TODO sort out logs for different instances
[] TODO return logs to caller
[] TODO limit max. concurent instance number
[] TODO concurrency for several instances?
[] TODO add authentication
[] TODO queue requests for instances
[] TODO dynamic configuration of attackmate config
[] TODO make logging (debug, json etc) configurable at runtime (endpoint or user query paramaters?)
[] TODO ALLOWED_PLAYBOOK_DIR -> define in and load from configs
[] TODO add swagger examples
[] TODO generate/check OpenAPI schema
[x] TODO seperate router modules?
python -m remote_rest.client playbook-yaml examples/playbook.yml
Ensure 'playbook.yml' exists in server's ALLOWED_PLAYBOOK_DIR
python -m remote_rest.client playbook-file safe_playbook.yml
python -m remote_rest.client command shell 'echo "Hello"'```bash
python -m remote_rest.client command shell 'echo hello' --metadata tactic=recon --metadata technique=TXXX
```
```bash
python -m remote_rest.client command sleep --seconds 8 --background
```
# (Client returns immediately, server sleeps)
preliminary, automate later?
with open ssl
bash openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
Common Name: localhost (or ip adress the server will be)
running client:
python -m client --cacert <path_to_cert> login user user