Launching
To run the entire infrastructure, a pre-configured compose.yaml
file is provided. The file defines the following services:
avala-server
: Core server component that orchestrates all operations.avala-submitter
: Component responsible for submitting flags. It can be configured to run multiple instances (replicas) to handle high volume of flags, which is useful when submitting in streams.rabbitmq
: Message broker that handles the flow of flags from the server to the submitters.postgres
: Database used for storing flags, their statuses, responses and historical data.
Docker compose file¶
Create a file named compose.yaml
in your current directory and paste the content below. The compose.yaml
file typically requires only minor adjustments, primarily for:
- Credentials: You should update the access credentials for RabbitMQ and PostgreSQL. Make sure these credentials, along with hostnames, ports, and other connection parameters, match the settings in your
avala.yaml
file. - Time zone: The time zone is set to
Europe/Belgrade
, which may need to be adjusted to match your location. - Extra packages: Your flag ID and submitter scripts will likely use third-party libraries that you will need to install. You can specify these in
EXTRA_PACKAGES
environment variable, and they will be installed upon running the containers. - Docker image: The services are configured to use images from Docker Hub. If your images have different names or are hosted on a different registry, you'll need to update the
image
field accordingly. - Volumes: The configuration uses Docker volumes to persist data for RabbitMQ and PostgreSQL. Ensure these are correctly set up if you are not using Docker's default volume management.
services:
avala-server:
image: dusanlazic/avala-server
ports:
- "2024:2024"
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_started
restart: always
environment:
TZ: Europe/Belgrade
EXTRA_PACKAGES: requests==2.32.5
tty: true
volumes:
- ./avala.yaml:/etc/avala/avala.yaml:ro
- ./flag_ids.py:/etc/avala/flag_ids.py:ro
avala-submitter:
image: dusanlazic/avala-submitter
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_started
restart: always
environment:
TZ: Europe/Belgrade
EXTRA_PACKAGES: pwntools==4.14.1 requests==2.32.5
tty: true
volumes:
- ./avala.yaml:/etc/avala/avala.yaml:ro
- ./submitter.py:/etc/avala/submitter.py:ro
deploy:
replicas: 1
rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 1s
timeout: 3s
retries: 30
restart: always
tty: true
volumes:
- rabbitmq-data:/var/lib/rabbitmq
postgres:
image: postgres:alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: avala
tty: true
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
rabbitmq-data:
driver: local
postgres-data:
driver: local
Launching¶
In your directory you should have the following:
Launching all containers is done using the following command:
After your containers are up, you can access the dashboard via http://<your hostname>:2024/
(assuming that you're using the default port 2024). Upon opening the page you will be prompted for a username and a password. The password is the one you set in avala.yaml
, while the username can be anything.
To confirm the system is working, manually submit a test flag. If the submitted flag appears in the database with the correct status and server response, the setup is successful. If not, check the container logs for errors.
Other commands¶
If you need to restart a service, run the following:
To shut down the infrastructure temporarily:
To destroy the infrastructure and clean up the volumes completely:
Next steps¶
- Create an empty directory on your server ✅
- Write the submitter script ✅
- Write the flag IDs fetching script ✅
- Configure the Avala server ✅
- Launch all containers using Docker Compose ✅
Now that your Avala server is running, you're ready to install the Avala client and start writing exploits. 🚀