> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/connectivity/broker.md).

# Broker

Zero-trust reverse connectivity: the remote gateway and the solution both dial out to a broker, so assets in networks that cannot accept inbound connections stay reachable without a VPN.

A **broker** is the meeting point for reverse access. It is a service on a dedicated VM that acts as the control centre of a zero-trust overlay network. It sits neither inside the customer network nor inside the solution, but somewhere **both sides can reach**. The screen states the purpose directly: *"Zero-trust reverse connectivity: remote gateways and the PAM dial out to a broker. No inbound port is opened on the targets"*.

## What this is and when to use it

The broker **reverses the direction of the connection**. Instead of the solution entering the customer network, the remote gateways and connectors dial out to the broker, and the solution dials out to the broker as well. The two sides meet there.

```
[target on the remote network] <--- gateway --dials--> BROKER (public) <--dials-- solution
```

Each end is authenticated by certificate, and only the assets you explicitly publish become reachable. The customer network exposes no inbound port at all.

Use a broker when there is no route from the solution to the asset network and you cannot, or will not, open inbound firewall ports or build a VPN. That is the typical situation for third-party networks, branch offices, customer sites and anything behind NAT.

{% hint style="info" %}
**Broker gateway is not the same as a proxy gateway.** A broker gateway is an appliance installed next to the targets that only makes outbound connections. A proxy gateway is a jump host the solution dials into — see [Gateways](https://wiki.datadike.com/pam/administration/connectivity/gateways.md). An asset uses one path or the other, never both.
{% endhint %}

| Situation                                                                | Mechanism                                                                             |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| The solution reaches a machine in the network, but not the assets        | [Proxy](https://wiki.datadike.com/pam/administration/connectivity/proxy.md)           |
| The solution cannot reach the network, and no inbound port may be opened | **Broker**                                                                            |
| The target is a single isolated machine with no gateway on its network   | [Connectors](https://wiki.datadike.com/pam/administration/connectivity/connectors.md) |

Once the path exists, nothing else changes: the session is mediated, recorded and audited exactly like a session to a local asset, with session recording, command filtering, auditing and anomaly alerts all applying the same way.

## Before you start

* Administrator (**SysAdmin**) privileges in the console.
* A **broker** provisioned and reachable — a dedicated VM, delivered as part of the DataDike infrastructure.
* A machine or appliance at the remote site to act as the gateway, with **outbound** internet access. It needs no public IP and no open inbound port.
* The broker VM must accept inbound connections on its control port and its data port. The product notes list **1280/tcp** for control and **443/tcp** for data, while the registration form defaults to an admin port of `1280` and a router port of `3022`. Confirm which pair your broker build uses before opening the firewall.

Gateway appliance requirements:

| Resource | Recommended minimum                                          |
| -------- | ------------------------------------------------------------ |
| System   | An actively supported Linux distribution                     |
| vCPU     | 4                                                            |
| Memory   | 8 GB                                                         |
| Disk     | 60 GB                                                        |
| Network  | **Outbound** internet access (no public IP, no inbound port) |

{% hint style="danger" %}
**Register the broker by DNS name, never by IP.** The address is written into the certificates and the enrollment tokens and **cannot be changed afterwards without reinstalling the broker**. A literal IP only ever works for one network path, because behind NAT the LAN and the internet do not see the same IP.
{% endhint %}

Everything is managed in **Console › Gateway › Brokers**. The only step outside the console is running the gateway installer once, at the remote site, with a token the console generates.

## Steps

1. **Register the broker.** In **Console › Gateway › Brokers**, use **Register broker** and supply the broker host, the admin port (default `1280`), the router port (default `3022`) and the broker's administration token. The token is stored masked and encrypted in the vault and is never displayed again after saving. Then run **Test connection** — the status should come back *online*, with the broker version and the active routers.
2. **Enroll the site gateway.** Open the broker and, on the **Gateways** tab, use **Enroll gateway** and name it after the site (for example, `gateway-branch-sp`). The console issues a **single-use JWT**, shown only once. Run the gateway installer on the remote machine with that token:

   ```bash
   sudo ./install-gateway.sh --token "<PASTE-THE-TOKEN-HERE>"
   ```

   As soon as the gateway connects to the broker it appears *online* on the **Gateways** tab.
3. **Publish the target.** On the **Targets** tab, use **Publish target** and fill in the gateway that can see the asset, the target address as `IP:port` **as reachable from the gateway** (for example, `10.0.0.5:22` for SSH or `:3389` for RDP), a unique service name, and a dedicated high local port on the solution — **12000 or above**.
4. **Register the asset.** Register the asset as usual, pointing its address at the **local port** from the previous step. Platform, accounts and credentials are configured exactly as for a local asset.
5. **Grant access and connect.** Grant the normal [authorization](https://wiki.datadike.com/pam/administration/access/authorizations.md) to the user or group. The user connects from the browser with nothing to install.

{% hint style="warning" %}
The enrollment token is **single-use** and already embeds the broker address — the site operator never types an IP. If the token expires or is consumed without the installation completing, generate a new one from the screen.
{% endhint %}

## What you should see

![The Broker screen](https://1085357737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7xzJyi9JVzRwnV6JzUho%2Fuploads%2Fgit-blob-7321e43d1c63630412512e65fe4fa08cbf8c0d1c%2Fbroker.png?alt=media)

**1** How many brokers are registered.

The list shows the registered brokers, each with its address and its **connection status** (for example, *Online*). On a broker's detail:

* the **Gateways** tab lists each enrolled site with its status;
* the **Targets** tab lists each published target with its gateway, its address and the matching local port on the solution.

## How to verify it worked

1. The broker shows *Online* in the list, and **Test connection** returns the broker version and its active routers.
2. The gateway turns *online* on the **Gateways** tab within moments of the installer finishing. If it does not, the token was consumed or expired.
3. The published target appears on the **Targets** tab with its local port.
4. Opening a session from the browser connects and recording starts — the proof that the whole chain works end to end.
5. Confirm the remote site opened **no inbound port**. If someone opened one "to make it work", the reverse model is not what is carrying the traffic.

## Common errors

| Symptom                                                      | Cause                                                                   | Fix                                                                                                     |
| ------------------------------------------------------------ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| The gateway never turns *online* after the installer runs    | The single-use token was already consumed or has expired                | Generate a new token on the **Gateways** tab and run the installer again                                |
| **Test connection** fails right after registering the broker | Wrong host, wrong port pair, or a wrong administration token            | Re-check the address and ports; re-enter the token, which cannot be read back once saved                |
| The broker works, but the address now needs to change        | The address is baked into the certificates and enrollment tokens        | Reinstall the broker. Register by DNS name from the start so a restored VM keeps its certificates valid |
| A published target cannot be reached                         | The address was written as seen from the solution, not from the gateway | Use `IP:port` as reachable **from the gateway**, on that gateway's own LAN                              |
| The asset registration cannot find the remote asset          | The asset points at the real remote address rather than the local port  | Point the asset at the local port allocated when the target was published                               |
| An asset refuses the broker path                             | It is already bound to a proxy                                          | An asset uses a proxy or a broker gateway, never both                                                   |
| Access through one broker stops working                      | That broker's VM is unavailable                                         | Nothing to do by hand — see Availability below                                                          |

## Availability

The broker runs on **a single VM**, which holds both the control plane and the data plane. This version has no replication or automatic failover between several broker VMs.

If that VM becomes unavailable, only the accesses that go through **that** broker stop. Direct-access assets, assets using a [proxy](https://wiki.datadike.com/pam/administration/connectivity/proxy.md), and assets attached to another broker keep working.

Recovery **needs no manual intervention**: when the broker comes back, the gateways and connectors re-dial on their own and the solution reconciles state through its periodic routines. In practice access returns in about one to two minutes.

Until native high availability exists:

1. Provide **high availability at the virtualization layer**, with automatic VM restart.
2. **Back up the VM, above all its PKI.** The certificates are the root of trust for every gateway and connector. Losing the VM with no backup means reinstalling the broker and re-enrolling every remote endpoint.
3. **Always use a DNS name**, so you can point it at a restored VM and keep the certificates valid.
4. **Segment by separate brokers** per site or per criticality to reduce the blast radius. This is not failover: an asset belongs to a gateway of one specific broker and does not migrate on its own.

## Teardown and revocation

| Action                               | Effect                                                                           |
| ------------------------------------ | -------------------------------------------------------------------------------- |
| **Revoke** on the **Gateways** tab   | Ends that site's access                                                          |
| **Unpublish** on the **Targets** tab | Removes the target from the overlay                                              |
| **Unbind gateway** on a device card  | Removes the device's link to a broker gateway. Unavailable when there is no link |
| Session panel                        | Monitor and terminate live sessions in real time                                 |

Publish only the targets you need, and revoke gateways and targets that are no longer in use. Keep session recording mandatory for accesses that pass through a broker, as for any privileged access, and never share the broker administration token over an insecure channel.

## Field reference

### Registering a broker

| Field                | Meaning                                                                                          |
| -------------------- | ------------------------------------------------------------------------------------------------ |
| **Host**             | Broker address. Use a DNS name — it is written into the certificates and cannot be changed later |
| Admin port           | Administration port, default `1280`                                                              |
| Router port          | Router port, default `3022`                                                                      |
| Administration token | The broker's admin token. Stored masked and encrypted, never displayed again                     |

### Publishing a target

| Field          | Meaning                                                                                            |
| -------------- | -------------------------------------------------------------------------------------------------- |
| **Gateway**    | The online gateway that can see the asset on its own network                                       |
| Target address | `IP:port` reachable **from that gateway**                                                          |
| Service name   | Unique identifier for the published service, for example `db-prod-01`                              |
| Local port     | Dedicated high port on the solution, **12000 or above**, that the asset will be registered against |

### Per-broker actions

| Action              | What it does                                         |
| ------------------- | ---------------------------------------------------- |
| **Installer**       | Generates the installer to run on the remote machine |
| **Test connection** | Checks that the solution reaches the broker          |
| **Rotate secret**   | Rotates the broker's administration secret           |
| **Edit**            | Changes the registration                             |
| **Duplicate**       | Creates a copy of the registration                   |
| **Uninstall**       | Undoes the installation                              |
| **Delete**          | Removes the record                                   |

**Register broker** and **Export** sit in the top bar.

## Related pages

* [Gateways](https://wiki.datadike.com/pam/administration/connectivity/gateways.md) — the other kind of gateway, which the solution dials into
* [Proxy](https://wiki.datadike.com/pam/administration/connectivity/proxy.md) — the alternative path, where the solution dials into the network
* [Connectors](https://wiki.datadike.com/pam/administration/connectivity/connectors.md) — an agent on the target machine itself, for an isolated host
* [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md) — granting access to a published asset
* [Core concepts](https://wiki.datadike.com/pam/get-started/core-concepts.md) — how assets, accounts and sessions fit together
