Ansible deployment
Reference for a Colander server deployed with the colander-ansible playbooks. To deploy one, see Deploy Colander on a server with Ansible.
Playbooks
Run them from the colander-ansible folder: ansible-playbook -i production.yml playbooks/<playbook>.
| Playbook | Description |
|---|---|
install-docker.yml | Installs Docker on the server, in rootless mode. |
generate-configuration.yml | Generates the configuration vault group_vars/colander/vault. Accepts --extra-vars "root_domain=<domain>". |
colander.yml | Configures and deploys Colander. Equivalent to configure-colander.yml followed by deploy-colander.yml. |
configure-colander.yml | Configures Colander on the server. |
deploy-colander.yml | Deploys the stack and creates the administrator accounts. |
backup-colander.yml | Creates a backup on the server. |
sanity-checks.yml | Checks that the DNS records of the services exist. The deployment playbooks run the same checks first. |
teardown-colander.yml | Permanently deletes Colander, its data, its backups and its configuration. |
Inventory file
production.yml, created from production-example.yml:
colander:
hosts:
production:
ansible_host: [IP address of the server]
ansible_user: colander
ansible_ssh_private_key_file: [path of your SSH private key]
Per-host customization
host_vars/production.yml, created from host_vars/production-example.yml, overrides the default configuration of the host. It is optional.
| Setting | Default | Description |
|---|---|---|
stack_overrides.flavor.use_threatr | True | Deploys Threatr. |
stack_overrides.flavor.use_cyberchef | True | Deploys CyberChef. |
stack_overrides.flavor.use_mandolin | True | Deploys Mandolin, which analyzes the uploaded artifacts. |
stack_overrides.flavor.use_playwright | True | Deploys Playwright, which takes the screenshots of URLs and captures their HAR files. |
stack_overrides.services.elasticsearch.xms | Initial memory allocated to Elasticsearch, for instance 512m. | |
stack_overrides.services.elasticsearch.xmx | Maximum memory allocated to Elasticsearch, for instance 512m. |
stack_overrides:
flavor:
use_threatr: True
use_cyberchef: False
use_mandolin: False
use_playwright: True
services:
elasticsearch:
xms: 512m
xmx: 512m
Configuration vault
group_vars/colander/vault, generated by generate-configuration.yml. The values marked randomly generated are created by the playbook; the email settings must be filled in by hand. Encrypt the file with ansible-vault encrypt group_vars/colander/vault, and never modify it after the deployment.
colander_vault:
# Email
acme_email: "machines@my.domain"
admin_name: "Badass Admin"
admin_email: "admin@my.domain"
django_default_from_email: "admin@my.domain"
email_host: "smtp.my.provider.com"
email_host_user: "machines@my.domain"
email_host_password: "password"
email_port: 465
email_use_tls: false
email_use_ssl: true
# Domains & sub-domains
root_domain: "my.domain"
colander_base_url: "https://colander.my.domain"
colander_django_allowed_hosts: "colander.my.domain"
colander_fqdn: "colander.my.domain"
threatr_base_url: "https://threatr.my.domain"
threatr_django_allowed_hosts: "threatr.my.domain"
threatr_fqdn: "threatr.my.domain"
cyberchef_base_url: "https://cyberchef.my.domain"
cyberchef_fqdn: "cyberchef.my.domain"
traefik_base_url: "https://traefik.my.domain"
traefik_fqdn: "traefik.my.domain"
# Traefik
traefik_auth_salt: "randomly generated"
traefik_admin_user: "admin"
traefik_admin_password: "randomly generated"
# Colander
colander_django_secret_key: "randomly generated"
colander_django_admin_url: "randomly generated"
colander_postgres_user: "randomly generated"
colander_postgres_password: "randomly generated"
colander_admin_user: "admin"
colander_admin_password: "randomly generated"
# Threatr
threatr_django_secret_key: "randomly generated"
threatr_django_admin_url: "randomly generated"
threatr_postgres_user: "randomly generated"
threatr_postgres_password: "randomly generated"
threatr_admin_user: "admin"
threatr_admin_password: "randomly generated"
# Minio
minio_access_key: "randomly generated"
minio_secret_key: "randomly generated"
| Variable | Description |
|---|---|
acme_email | Email address passed to Let's Encrypt. |
admin_name | Full name of the server administrator. |
admin_email | Email address the crash reports are sent to. |
django_default_from_email | Email address used to send emails. |
email_host, email_port | Host and port of the SMTP server. |
email_host_user, email_host_password | Credentials for the SMTP server. |
email_use_tls, email_use_ssl | true when the SMTP server uses TLS, respectively SSL. |
colander_django_admin_url, threatr_django_admin_url | Random path of the administration panels: ${colander_base_url}/${colander_django_admin_url} and ${threatr_base_url}/${threatr_django_admin_url}. |
colander_admin_user, colander_admin_password | Administrator account of Colander, created by the deployment. |
threatr_admin_user, threatr_admin_password | Administrator account of Threatr, created by the deployment. |
DNS records
An A record pointing to the public IP address of the server is required for each subdomain:
| Subdomain | Required |
|---|---|
colander.[root domain] | Always |
threatr.[root domain] | When Threatr is deployed |
cyberchef.[root domain] | When CyberChef is deployed |
traefik.[root domain] | Always |
Files on the server
| Path | Content |
|---|---|
/home/colander/colander | Installation folder |
/home/colander/colander/docker-compose.yml | Docker Compose file of the stack |
/home/colander/colander/volumes | Docker volumes |
/home/colander/colander/backups | Backups, one folder per backup |
/home/colander/colander/scripts/backup | Backup script |
/home/colander/colander/scripts/restore | Restore script, takes the name of a backup folder |
Backups
Each backup folder is named after the date and time of the backup and contains:
- a dump of the Colander database
- a dump of the Threatr database, when Threatr is deployed
- a snapshot of the Elasticsearch indices
- an archive of all the files stored in Minio
/home/colander/colander/backups/
`-- 2025_02_18-13_47_01
|-- colander-db
| `-- backup_2025_02_18T13_47_02.sql.gz
|-- elasticsearch
| `-- elasticsearch-2025_02_18-13_47_03.tgz
|-- minio
| `-- minio-2025_02_18-13_47_03.tgz
`-- threatr-db
`-- backup_2025_02_18T13_47_03.sql.gz
Log fields
The logs of the containers are sent to journald and tagged with the following fields:
| Field | Description | Example |
|---|---|---|
IMAGE_NAME | Name of the Docker image | ghcr.io/piroguetoolsuite/colander:main |
CONTAINER_NAME | Name of the container | colander-colander-front-1 |
COLANDER_SERVICE_NAME | Name of the service | colander-front |
COLANDER_SERVICE_TYPE | Type of service | web |
The values are defined in the Docker Compose file installed on the server.
Authentication failures
Every authentication failure is logged in journald with the following format:
<date> <hostname> <container>: ERROR <date> signals 19 <timestamp> COLANDER_AUTH_FAILURE username:[<user>] email:[<email address>] ip:[<IP address of the client>] datetime:[<date>] routable:[<True if the IP address is public, False otherwise>]