Skip to content

Server Configuration

kaiobendrauf edited this page Oct 14, 2026 · 9 revisions

Warning

If the rules and hostconfigs in the database do not have any targets they will never be sent to a machine. When using krampusctl to update the database, a default target of allis added to each rule and hostconfig if no target is given. If you populate the database without krampusctl this default target will have to be populated manually.

Database Support

Krampus supports a handful of database backends, and you can also extend backend support with your own module. The databases supported by this repository are as follows:

Name Version (tested on)
Postgres 18
MySQL 8.4
Google Cloud Firestore n/a

Environment Variables

This section details the environment variables that can be used to configure the Krampus server at runtime.

General Environment Variables

Environment Variable Default Value Description
SYNC_SECRET n/a A secret string that clients must provide as the value for the Krampus-Auth HTTP header. If unset, no authentication is required for syncing.
CTL_SECRET n/a A secret string that krampusctl must provide as the value for the Krampus-Auth HTTP header. If unset, no authentication is required for updating rules via the API.
MIN_CLEAN_SYNC_DAYS n/a When choosing when a host will next perform a clean sync, Krampus pick randomly selects a number of days between the minimum value, and a maximum value. This environment variable sets the minimum value.
MAX_CLEAN_SYNC_DAYS n/a When choosing when a host will next perform a clean sync, Krampus pick randomly selects a number of days between the minimum value, and a maximum value. This environment variable sets the maximum value.
BATCH_SIZE 50 Krampus sends rules to clients in batches, of BATCH_SIZE size at a time. If this environment variable is not set, Krampus will default to a batch size of 50 rules.

Database Environment Variables

Postgres-specific Environment Variables

Environment Variable Default Value Description
POSTGRES_HOST n/a FQDN/IP address of your Postgres instance.
DB_NAME n/a The name of your database within your Postgres instance.
POSTGRES_PORT 5432 The port number for your Postgres connection.
POSTGRES_USER n/a The Postgres username that Krampus should use.
POSTGRES_PW n/a The Postgres password that Krampus should use.

MySQL-specific Environment Variables

Environment Variable Default Value Description
MYSQL_HOST n/a FQDN/IP address of your MySQL instance.
DB_NAME n/a The name of your database within your MySQL instance.
MYSQL_PORT 3306 The port number for your MySQL connection.
MYSQL_USER n/a The MySQL username that Krampus should use.
MYSQL_PW n/a The MySQL password that Krampus should use.

Firestore-specific Environment Variables

Important

The Firestore library handles authentication for Krampus. It assumes you are using Application Default Credentials.

Environment Variable Default Value Description
GCP_PROJ_ID n/a The name of the Google Cloud project that your Firestore database is in.
DB_NAME n/a The name of the Firestore database you want to use with Krampus.

Event Handler Environment Variables

Pub/Sub-specific Environment Variables

Important

The Pub/Sub library handles authentication for Krampus. It assumes you are using Application Default Credentials.

Environment Variable Default Value Description
PUB_SUB_TOPIC_ID n/a Google Cloud Pub/Sub topic name to forward client events to. Defaults to empty.
PUB_SUB_PROJ_ID n/a Name of the Google Cloud project that your Pub/Sub topic is in.