Overwatch monitors your Metabase instances for data exfiltration. It reads each Metabase's application database with
a read-only login, learns each person's normal activity, runs detection rules, groups alerts into incidents, and
notifies you. It runs as one Docker image, metabase/overwatch, and keeps its data in a ClickHouse and a Postgres that
you run.
| what | requirement |
|---|---|
| A host for the image | Docker, 2 vCPU and 4 GB of memory for the container, x86_64 |
| ClickHouse | 26.3 or later, or ClickHouse Cloud. A database for Overwatch, and at least 4 GB of memory |
| Postgres | 16 or later. A database for Overwatch. It can be the server that holds the Metabase application database below |
| A Metabase for Overwatch's dashboards | Metabase Enterprise v1.65.6.2, new and not set up, used only by Overwatch |
| A licence token | Metabase Enterprise, with the features serialization, embedding-sdk and sso-jwt |
| SMTP | optional, for email notifications |
Each Metabase you monitor needs:
change-log, and audit-app for all rules to run;Overwatch serves plain HTTP. Put your TLS proxy or load balancer in front of it, as you do for Metabase. Overwatch
calls token-check.metabase.com:443 for the licence check, and download.db-ip.com:443 once a month for GeoIP
data.
Overwatch needs two logins in ClickHouse and two in Postgres: one for itself, and a read-only one for its Metabase.
Replace each … with a password.
In ClickHouse:
CREATE DATABASE overwatch;
CREATE USER overwatch IDENTIFIED BY '…' SETTINGS join_use_nulls = 1;
GRANT SHOW, SELECT, INSERT, ALTER, CREATE TABLE, CREATE VIEW, CREATE DICTIONARY, DROP TABLE, DROP VIEW,
DROP DICTIONARY, TRUNCATE, dictGet ON overwatch.* TO overwatch;
GRANT CREATE FUNCTION, DROP FUNCTION, SYSTEM RELOAD DICTIONARY ON *.* TO overwatch;
CREATE USER overwatch_metabase IDENTIFIED BY '…' SETTINGS join_use_nulls = 1, readonly = 2;
GRANT SELECT, SHOW, dictGet ON overwatch.* TO overwatch_metabase;
GRANT SELECT ON system.processes TO overwatch_metabase;
join_use_nulls = 1 is required. Without it, some rules and dashboards give wrong results.ON *.* are for what ClickHouse grants on the whole server only: Overwatch's four SQL functions, whose
names start with ow_, and the reload of its GeoIP dictionary.system.processes lets Metabase cancel a query when a viewer leaves a dashboard.In Postgres:
CREATE ROLE overwatch LOGIN PASSWORD '…';
CREATE DATABASE overwatch OWNER overwatch;
CREATE ROLE overwatch_metabase LOGIN PASSWORD '…';
Overwatch grants overwatch_metabase read access to the tables its dashboards use.
In each Metabase you monitor, make a read-only login. Run this in its application database:
CREATE ROLE overwatch LOGIN PASSWORD '…';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO overwatch;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO overwatch;
ALTER DEFAULT PRIVILEGES FOR ROLE metabase IN SCHEMA public GRANT SELECT ON TABLES TO overwatch;
ALTER DEFAULT PRIVILEGES FOR ROLE metabase IN SCHEMA public GRANT SELECT ON SEQUENCES TO overwatch;
metabase is the user that Metabase itself connects as (MB_DB_USER). The last two lines cover the tables that a
Metabase upgrade adds.
Run Metabase Enterprise v1.65.6.2 with its own application database, such as a database metabase on the same
Postgres. Do not open it or set it up: Overwatch does that at its first start, with Metabase's setup token.
Overwatch sets what it needs in this Metabase: the licence token, its admin, JWT single sign-on, the embedding settings, its two databases and the dashboards.
Overwatch reads its configuration from environment variables, from one file, or from both. The file is
/config/overwatch.yaml in the container, or the path in OW_CONFIG_FILE. When a key is set in both, the
environment variable wins.
Each key's variable is its path in capitals, with OW_ in front: clickhouse.password is OW_CLICKHOUSE_PASSWORD.
In the file, {{ env NAME }} reads a variable, so the file can hold no passwords.
| key | variable | required | what |
|---|---|---|---|
license_token | OW_LICENSE_TOKEN | yes | the Metabase Enterprise licence token |
encryption_key | OW_ENCRYPTION_KEY | yes | encrypts the passwords Overwatch stores, as MB_ENCRYPTION_SECRET_KEY does for Metabase. 32 characters or more |
base_url | OW_BASE_URL | yes | the address people use, such as https://overwatch.acme.com |
port | OW_PORT | the port Overwatch listens on. Default 8000 | |
admin.email, admin.password | OW_ADMIN_EMAIL, OW_ADMIN_PASSWORD | first start | the first admin. The password needs 12 characters or more |
postgres.host, .port, .database, .user, .password | OW_POSTGRES_HOST, … | yes | Overwatch's login. Port default 5432 |
postgres.metabase_user, .metabase_password | OW_POSTGRES_METABASE_USER, … | yes | the read-only login for Overwatch's Metabase |
clickhouse.host, .port, .secure, .database, .user, .password | OW_CLICKHOUSE_HOST, … | yes | Overwatch's login. secure: true for HTTPS, which ClickHouse Cloud needs. Port default 8123, or 8443 with secure |
clickhouse.metabase_user, .metabase_password | OW_CLICKHOUSE_METABASE_USER, … | yes | the read-only login for Overwatch's Metabase |
metabase.url | OW_METABASE_URL | yes | Overwatch's Metabase, as browsers reach it |
metabase.internal_url | OW_METABASE_INTERNAL_URL | Overwatch's Metabase, as Overwatch reaches it, when that differs from metabase.url | |
smtp.host, .port, .user, .password, .from_addr, .tls | OW_SMTP_HOST, … | email notifications. With smtp.host, Overwatch makes an email channel to admin.email, for incidents of severity high or more. port is 587 by default. tls, true by default, uses STARTTLS. A server that wants TLS from the first byte, as on port 465, does not work |
An example file:
license_token: "{{ env OW_LICENSE_TOKEN }}"
encryption_key: "{{ env OW_ENCRYPTION_KEY }}"
base_url: https://overwatch.acme.com
admin:
email: [email protected]
password: "{{ env OW_ADMIN_PASSWORD }}"
postgres:
host: pg.acme.internal
database: overwatch
user: overwatch
password: "{{ env OW_POSTGRES_PASSWORD }}"
metabase_user: overwatch_metabase
metabase_password: "{{ env OW_POSTGRES_METABASE_PASSWORD }}"
clickhouse:
host: abc123.us-east-1.aws.clickhouse.cloud
secure: true
database: overwatch
user: overwatch
password: "{{ env OW_CLICKHOUSE_PASSWORD }}"
metabase_user: overwatch_metabase
metabase_password: "{{ env OW_CLICKHOUSE_METABASE_PASSWORD }}"
metabase:
url: https://overwatch-metabase.acme.com
smtp:
host: smtp.acme.com
port: 587
user: [email protected]
password: "{{ env OW_SMTP_PASSWORD }}"
from_addr: [email protected]
docker run -d --name overwatch --restart unless-stopped -p 8000:8000 \
--env-file overwatch.env -v "$PWD/overwatch.yaml:/config/overwatch.yaml:ro" \
metabase/overwatch:latest
overwatch.env holds the environment variables of step 3, one NAME=value on each line.
At each start, Overwatch checks the licence and its configuration, migrates its tables in Postgres and ClickHouse,
and sets up its Metabase when it is new. It keeps no data in the container. The container runs as uid 10001, so a
mounted overwatch.yaml must be readable by others.
overwatch ready in docker logs overwatch, and the UI at base_url, where you log in as the admin./healthz answers 200 when Overwatch serves. Use it for your load balancer's health check. For the container's
health check, run overwatch health: it also checks that each service is alive.
Open Instances, click Register instance, type the URL that people open the Metabase at, an instance id and the connection to its application database, click Test, then Save. Test says what is wrong with a connection, and which rules cannot run on that Metabase.
Overwatch first reads the last 126 days of the Metabase's history. On a large application database this takes hours. Overwatch does not notify the incidents it finds in the history, but the incident list shows them. It notifies everything it detects after that.
Overwatch keeps what it reads, and nothing expires: the rules compare each person with their own history. This includes people's emails, IP addresses and query text. To remove a Metabase's data, delete the instance in Instances: that removes everything read from it, its incidents and their triage.
Read the release notes of each version between yours and the new one.
Back up the Overwatch databases in ClickHouse and Postgres.
Pull the new image and run it in place of the old one:
docker pull metabase/overwatch:latest
docker rm -f overwatch
docker run -d --name overwatch ... metabase/overwatch:latest
At start, the new version migrates its tables, then reads each Metabase from where the old one stopped. Migrations
do not run backwards: to go back, restore the backup and run the old version by its tag,
metabase/overwatch:<version>.
Metabase deletes its change log entries after 30 days. If Overwatch is stopped for longer than 29 days, it can miss some changes, and an alert says so.
All of Overwatch's data is in its two databases. Back them up as you back up your other databases: the Postgres
database overwatch, and the ClickHouse database overwatch. Keep encryption_key too. Without it, Overwatch cannot
read the passwords it stores, and you must enter each instance's and channel's password again.
| command | what it does |
|---|---|
docker exec overwatch overwatch health | healthy, or which service is not, with why |
docker exec overwatch overwatch diagnose | a report to send us when something is wrong: versions, health, each instance's phase and errors. Ids, counts and times only, no query text or emails |
docker exec overwatch overwatch version | the version |
docker exec overwatch overwatch metabase-admin | the login of the admin Overwatch made in its Metabase |
Content type
Image
Digest
sha256:1f4286e3d…
Size
85.9 MB
Last updated
about 5 hours ago
docker pull metabase/overwatch