# The XTM stack: modules and shared services

> How the XTM stack is built around XTM One, which shared service each module uses, and how the modules connect to each other.

- URL: https://filigran.io/docs/lts/7.260309-lts/deploy/plan/architecture/
- Products (the whole suite): XTM One 1.261119.1, OpenCTI 7.260309.0-lts.8, OpenAEV 3.261118.0, OpenCRQ 0.261123.0, XTM Composer 3.261121.0
- OpenCTI line: 7.260309 LTS · 7.260309.0-lts.8
- For: platform engineers, evaluators
- Type: Concept

The XTM platform runs as one stack. XTM One is at its center. OpenCTI, OpenAEV, OpenCRQ, their default integrations and XTM Composer always start with it, and all of them share one set of backing services: Elasticsearch, RabbitMQ, Redis, S3 storage and PostgreSQL. This page explains what each part is, which shared service each module uses and how the modules talk to each other, as the official Docker deployment, [FiligranHQ/xtm-docker](https://github.com/FiligranHQ/xtm-docker), defines them. How each module works inside is on its own architecture page.

## What the stack is made of {#what-the-stack-is-made-of}

| Part | What it is | In xtm-docker |
| --- | --- | --- |
| Modules | The XTM applications: XTM One, OpenCTI, OpenAEV, OpenCRQ, XTM Composer and the default integrations | One Compose file per module, in `modules/`. Every module always starts |
| Shared services | The search engine, queue, cache, file storage and database the modules keep their data in | One instance of each, one Compose file per service, in `infra/` |
| Init jobs | Short tasks that prepare something for a module, then stop or wait | `xtm-one-db-init`, `opencrq-db-init`, `opencrq-bucket-init` and `rsa-key-generator` |

## The modules {#the-modules}

### XTM One {#xtm-one}

The AI layer at the center of the platform. It runs as two services: `xtm-one`, the web application and its API, and `xtm-one-worker`, which runs the background work. Before XTM One starts, the `xtm-one-db-init` job creates its PostgreSQL role, its `xtm_one` database and the pgvector extension. XTM One images are published for `linux/amd64` only. See [XTM One](https://filigran.io/docs/xtm-one/).

### OpenCTI {#opencti}

The threat intelligence platform. It runs as the `opencti` service and the `worker` service, with three worker replicas in xtm-docker. Its default connectors run with it. How the platform, its workers and its connectors work together is in [OpenCTI architecture](https://filigran.io/docs/lts/7.260309-lts/opencti/concepts/architecture/).

### OpenAEV {#openaev}

The exposure validation platform, as the `openaev` service. Its default collectors and injectors run with it. How the platform, its agents and its integrations work together is in [OpenAEV architecture](https://filigran.io/docs/openaev/concepts/architecture/).

### OpenCRQ {#opencrq}

The cyber risk quantification platform, as the `opencrq` service. Its image is `filigran/opencrq`: see [What xtm-docker runs for OpenCRQ](https://filigran.io/docs/lts/7.260309-lts/deploy/configure/opencrq/#what-xtm-docker-runs-for-opencrq). Before it starts, the `opencrq-db-init` job creates its PostgreSQL role, which is not a superuser, and the `opencrq` database that role owns, and the `opencrq-bucket-init` job creates its bucket. It reads threats from OpenCTI and validation results from OpenAEV, and registers with XTM One, without which it does not start. Inside the container, a process manager supervises an `http` process, for the interface and the API, and a `worker` process, for the background jobs and the connectors, or a single `main` process in the `monolith` profile. It answers the health check for all of them, and reports unhealthy when one stops sending heartbeats for `PROCESS_MANAGER__HEARTBEAT_TIMEOUT`; its Prometheus endpoint merges the metrics of every process. How they work together is in [OpenCRQ architecture](https://filigran.io/docs/opencrq/concepts/architecture/).

### XTM Composer {#xtm-composer}

XTM Composer deploys and runs integrations from the interface of OpenCTI and OpenAEV. It manages the integrations of both platforms, and starts once they are healthy. It starts integration containers through the Docker socket of the host, on the network of the stack. Before it starts, the `rsa-key-generator` job creates the RSA key it encrypts the integrations' configurations with. See [XTM Composer](https://filigran.io/docs/lts/7.260309-lts/deploy/integrations/composer/).

## The shared services {#the-shared-services}

| Shared service | Compose service | What it holds | Compose file |
| --- | --- | --- | --- |
| Elasticsearch | `elasticsearch` | The knowledge of OpenCTI and OpenAEV, and its search indices | `infra/elasticsearch.yml` |
| RabbitMQ | `rabbitmq` | The queues between the platforms, their workers and their integrations | `infra/rabbitmq.yml` |
| Redis | `redis` | Cache, sessions and live events | `infra/redis.yml` |
| S3 storage (RustFS) | `minio` | Files, imports and exports | `infra/rustfs.yml` |
| PostgreSQL with pgvector | `pgsql` | The databases of OpenAEV, OpenCRQ and XTM One | `infra/postgresql.yml` |

Every shared service starts with the stack. Each module waits until the shared services it depends on are healthy before it starts.

## Which module uses which service {#which-module-uses-which-service}

| Module | Elasticsearch | RabbitMQ | Redis | S3 storage | PostgreSQL |
| --- | --- | --- | --- | --- | --- |
| XTM One | No | No | Yes | Yes, bucket `xtm-one-files` | Yes, database `xtm_one` |
| OpenCTI | Yes | Yes | Yes | Yes, bucket `opencti-bucket` | No |
| OpenAEV | Yes | Yes | No | Yes, bucket `openaev` | Yes, database `openaev` |
| OpenCRQ | No | No | No | Yes, bucket `opencrq` | Yes, database `opencrq` |
| XTM Composer | No | No | No | No | No |
| Default integrations | No | Connectors and injectors | No | No | No |

One instance of each service is enough because each module keeps to its own data. OpenCTI and OpenAEV write Elasticsearch indices under their own prefix, `opencti` and `openaev` by default. Each module has its own bucket. OpenAEV and XTM One each have their own database, and XTM One connects with its own role, which is not the PostgreSQL superuser.

Two rules surprise people:

- XTM Composer uses no shared service. It talks to the APIs of OpenCTI and OpenAEV, and to Docker.
- By default, OpenCTI connectors and OpenAEV injectors connect to RabbitMQ, although nothing in their configuration names it. They use the connection details their platform gives them when they register, so they must be able to reach RabbitMQ under the host name the platform knows it by.

## How the modules connect {#how-the-modules-connect}

**Diagram: XTM One is at the center of the stack, OpenCTI, OpenAEV and OpenCRQ connect to it, and the integrations go through the platforms**

- Integrations: Default integrations (Connectors, collectors, injectors), XTM Composer (Runs integrations as containers)
- Platforms: OpenCTI (Platform and its worker), OpenAEV (Platform), OpenCRQ (Reads OpenCTI and OpenAEV)
- At the center: XTM One (Web application and its worker)

Connections:

- Default integrations → OpenCTI: platform API
- Default integrations → OpenAEV: platform API
- XTM Composer → OpenCTI: manages integrations
- XTM Composer → OpenAEV: manages integrations
- OpenCTI ↔ OpenAEV: API calls
- OpenCTI ↔ XTM One: registers
- OpenAEV ↔ XTM One: registers
- OpenCRQ ↔ XTM One: registers

- **OpenCTI, OpenAEV and OpenCRQ register with XTM One**, and XTM One calls their APIs. They all share one secret, `PLATFORM_REGISTRATION_TOKEN`: every platform connected to the same XTM One must use the same value.
- **OpenCTI and OpenAEV call each other's API**, each with the admin token of the other.
- **OpenCRQ reads OpenCTI and OpenAEV** through its connectors, set with their admin tokens for its **Default** tenant.
- **XTM Composer manages the integrations of both platforms** through their APIs, with their admin tokens.
- **The default integrations talk to their platform**: OpenCTI connectors to OpenCTI, OpenAEV collectors and injectors to OpenAEV.

Inside the stack, the modules reach each other by service name, such as `http://opencti:8080`. Browsers reach them on public URLs built from `.env`. [Network and ports](https://filigran.io/docs/lts/7.260309-lts/deploy/plan/network/) lists every address, port and token.

## What's next {#what-s-next}

- [What each XTM module brings](https://filigran.io/docs/lts/7.260309-lts/deploy/plan/modules/): the services, shared services and settings of each module.
- [Network and ports](https://filigran.io/docs/lts/7.260309-lts/deploy/plan/network/): who talks to whom, on which port.
- [Requirements](https://filigran.io/docs/lts/7.260309-lts/deploy/plan/requirements/) and [Sizing](https://filigran.io/docs/lts/7.260309-lts/deploy/plan/sizing/) for the machines.
- [How OpenCTI processes data in the background](https://filigran.io/docs/lts/7.260309-lts/opencti/concepts/architecture/#managers): the platform managers.
