- Create a file named
.env
- Add the following items
REFLEX_AGENT_PAIR_MODE=true
REFLEX_API_HOST=http://yourapihosthere
REFLEX_AGENT_PAIR_TOKEN=your.pairing.token
REFLEX_AGENT_ROLES=runner,poller
REFLEX_AGENT_IGNORE_TLS=true
- Run the following command
docker run -v $PWD/.env:/.env reflex-agent:latest
version: "3.8"
services:
reflex-agent:
image: zeroonesec/reflex-agent:latest
volumes:
- ./.env:/.env:ro
- ./config.txt:/config.txt
- Log in to your management console
- Click Agents
- Click New Agent
- Download the agent package
- Pair the agent
python reflex-agent.py --pair --token <token> --console https://myconsole.com --roles poller,runner
- Run
python reflex-agent.py
- Create a service file
sudo vi /lib/systemd/system/reflex-agent.service
- Add the service details to the file
[Unit]
Description=Reflex Agent
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
Type=simple
WorkingDirectory=/etc/reflex
ExecStart=/usr/bin/python /etc/reflex/reflex-agent.py
StandardInput=tty-force
[Install]
WantedBy=multi-user.target
- Enable the service
sudo systemctl daemon-reload
sudo systemctl enable reflex-agent.service
sudo systemctl start reflex-agent.service