> ## Documentation Index
> Fetch the complete documentation index at: https://help.allthenticate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the Domain Controller Bridge

> Register the Domain Controller Bridge in the admin portal, install it as a Windows service or a Docker container, configure it, and check that it syncs users.

The Domain Controller Bridge (version 1.5.0) is a small program you run inside your network. It reads users from Active Directory, hands each user's certificate request to your CA, and returns the certificate to Allthenticate. It makes only outbound connections. You do the registration and first start together with your Allthenticate engineer on the call; everything else can be prepared beforehand.

## Register the bridge

**1. Open DC Bridging**

Sign in to the admin portal as a **Super Admin** and select **DC Bridging** in the left menu. On the **Bridges** tab, select **Register Bridge**.

**2. Copy the secret and the ID**

The portal shows the bridge secret once. Copy it before you close the dialog. The bridge ID is the number after `#` on the bridge card, for example **Bridge #29**.

Each organization can currently have one bridge. Synced users are placed in the **DC Sync Group**.

> [!WARNING]
>
> **Treat the bridge secret like a domain administrator credential.** Whoever holds it can invite and delete users in your Allthenticate organization. Keep it in your secrets manager, never in a ticket or chat. It can't be rotated in place: rotating means deleting every Certificate Generation Policy (and with them all certificate records), deleting the bridge, registering a new one, updating the configuration, re-creating the policies and re-enrolling every user.

## Choose where to run it

| | Windows service (recommended) | Docker |
| - | - | - |
| Host | A dedicated, domain-joined Windows host | Linux with Docker |
| Enrollment path | CES or WCCE | CES only |
| LDAP authentication | Kerberos or NTLM | NTLM only |
| Runs as | A gMSA, NetworkService or LocalSystem | An unprivileged user in the container |

Don't run the bridge on a domain controller (where NetworkService and SYSTEM are the domain controller's own account) or on the CA host. Its enrollment agent certificate can obtain logon certificates for your users, so administer the host as Tier 0: only Tier 0 administrators in its local **Administrators** group, nothing else installed, and patching and monitoring like a domain controller.

## Install on Windows

**1. Download and verify the executable**

Download [dc-bridge-windows-x86\_64.exe](https://software.allthenticate.com/dc-bridge/dc-bridge-windows-x86_64.exe), always the latest release, and its [.sha256](https://software.allthenticate.com/dc-bridge/dc-bridge-windows-x86_64.exe.sha256). [version.json](https://software.allthenticate.com/dc-bridge/version.json) says which version that is, and each release stays available as `dc-bridge-<version>-windows-x86_64.exe`, for example `dc-bridge-1.5.0-windows-x86_64.exe`. Any computer with HTTPS to `software.allthenticate.com` can download them; copy them to the bridge host.

Check the file before you run it:

```powershell theme={null}
Get-AuthenticodeSignature .\dc-bridge-windows-x86_64.exe   # Status Valid, signer Allthenticate
Get-FileHash .\dc-bridge-windows-x86_64.exe -Algorithm SHA256   # matches the .sha256 file
```

Check the signer's name, not the issuing CA. The chain ends at *Microsoft Identity Verification Root Certificate Authority 2020*; a host without automatic root updates (common on servers) reports `UnknownError` until that root is installed. SmartScreen may warn about a new release until it builds reputation.

**2. Create the bridge folder**

Create a folder of its own, for example `C:\ProgramData\dc-bridge`, copy the executable into it as `dc-bridge.exe`, and add the enrollment agent PFX and any CA certificate files. `service install` refuses a drive root, `C:\Windows`, `C:\Program Files`, `C:\ProgramData` itself, `C:\Users` and user profiles.

**3. Write the placeholder files**

Open PowerShell in the folder and run `.\dc-bridge.exe`. With no configuration present, it writes a placeholder `dc-bridge-config.json` and a `.env` listing the variables the placeholder uses, then exits. It reads both files from its working directory, not from the executable's folder; `--config` and `--env-file` point it elsewhere.

**4. Fill in the configuration**

The placeholder isn't ready to run. Replace every bracketed value, set `bridge.id`, and put the secrets in `.env`. Set `period` to `3600` and `poll_period` to `300`: the placeholder's `5` is for testing only. The placeholder uses Kerberos LDAP authentication and a `ces` block; for NTLM or WCCE, swap the blocks as described in [Bridge configuration](https://help.allthenticate.com/windows/active-directory/configuration.md#first-run-placeholder). Write Windows paths with doubled backslashes. See [Example configurations](#example-configurations).

**5. Test from a console**

Run `.\dc-bridge.exe`, read the output, and stop it with **Ctrl+C**. A console run reaches the CA and the directory as you, not as the run-as account, so it tests configuration and startup only.

**6. Install and start the service**

In an elevated PowerShell in the bridge folder:

```powershell theme={null}
.\dc-bridge.exe service install --account CORP\gmsa-dcbridge$    # recommended: a gMSA, no password
.\dc-bridge.exe service install --account NetworkService         # or the bridge host's computer account
Start-Service dc-bridge
```

`--account` is required. See [Run-as account](#run-as-account) to choose one.

> [!TIP]
>
> `Get-Service dc-bridge` shows `Running`, and `logs\dc-bridge.log` in the bridge folder has a line with `dc-bridge service running` and `account="DOMAIN\\name"` naming the run-as account. The log doubles each backslash; that's escaping, not an error.

A healthy start of a WCCE bridge running as a gMSA with Kerberos LDAP authentication looks like this at the `info` level. The last two lines appear once the first certificate request reaches the bridge. With the enrollment agent certificate in the Windows certificate store, the first line is `Using enrollment agent certificate <thumbprint> in LocalMachine\My (…)` instead.

```txt theme={null}
INFO dc_bridge::crypto: Found enrollment agent certificate
INFO dc_bridge::ces: Loaded enrollment agent cert and keys
INFO dc_bridge::ces: WCCE enrollment runs as this Windows account ca_config="ca01.internal.example.com\\Example Issuing CA" account="CORP\\gmsa-dcbridge$"
INFO dc_bridge::crypto: Loaded LDAP CA certificate from C:\ProgramData\dc-bridge\internal-root.cer (DER): subject=…
INFO dc_bridge::ldap: LDAP sync scope base_dn=OU=Members,DC=internal,DC=example,DC=com groups=0
INFO dc_bridge::ldap: Successfully connected to LDAP at dc01.internal.example.com
INFO dc_bridge::ldap: Successfully bound LDAP
INFO dc_bridge::ces::builders: built CMS on-behalf enrollment request principal_name="<user>"
INFO dc_bridge::ces: Successfully enrolled certificate for <user>
```

`groups=0` means no `group_dns` restriction; any other number is how many `group_dns` entries there are.

### What service install sets up

| Setting | Value |
| - | - |
| Service | `dc-bridge`, display name **Allthenticate Domain Controller Bridge** |
| Start type | **Automatic (Delayed Start)** |
| Recovery | Restarts 60 seconds after a crash or a failed start, every time |
| Stop | Finishes the certificate request in flight (up to 20 seconds), then exits. The pre-shutdown timeout is 35 seconds. |
| Working directory | The configuration's folder |
| Folder permissions | Inheritance removed; SYSTEM and Administrators full control; the service identity `NT SERVICE\dc-bridge` read and execute, and modify on `logs\` |
| Log | `logs\dc-bridge.log`, without color codes. Each start renames the previous file to `dc-bridge.1.log`, keeping up to `dc-bridge.9.log`. |
| Logon right | **Log on as a service**, granted to a gMSA |

After install, only SYSTEM, Administrators and the service can open the folder, so edit files, upgrade or run `.\dc-bridge.exe --version` from an elevated PowerShell. `.\dc-bridge.exe service uninstall` removes the service and leaves the configuration, secrets, logs and permissions in place. Running `service install` a second time is refused; uninstall first to change the account or paths.

### Run-as account

The run-as account is who the domain controller sees for Kerberos LDAP, and who the CA sees for WCCE.

| `--account` | Who the CA and domain controller see | Notes |
| - | - | - |
| gMSA, `DOMAIN\name$` (recommended) | The gMSA | No password to store; Windows rotates it. `service install` grants it **Log on as a service**. |
| `NetworkService` | The host's computer account, `DOMAIN\HOST$` | Nothing to create in Active Directory. Shared by every SYSTEM and NetworkService process on the host, and changes if the host is renamed or rejoined. Fine for an evaluation. |
| `LocalSystem` | `DOMAIN\HOST$` | Full local privileges the bridge doesn't need. |
| `LocalService` | Nobody | No network credentials: works only with CES and NTLM. Under WCCE every request fails with `0x800706ba`. |
| An account with a password | | Refused, so the password isn't stored in the service. Install with `--account NetworkService`, then in `services.msc` open the service's **Properties** > **Log On** and enter the account and password. Windows grants it **Log on as a service**. Update the password there when it changes. |

> [accordion] Create a gMSA for the bridge
>
> 1. Check that the forest has a KDS root key with `Get-KdsRootKey`. If it lists none, a domain administrator runs `Add-KdsRootKey -EffectiveImmediately` and waits about 10 hours before creating the gMSA.
>
> 2. As a domain administrator, create the gMSA, with the bridge host's computer account allowed to retrieve its password. The name can be at most 15 characters, not counting the `$`:
>
>    ```powershell theme={null}
>    New-ADServiceAccount -Name 'gmsa-dcbridge' `
>        -DNSHostName 'gmsa-dcbridge.internal.example.com' `
>        -PrincipalsAllowedToRetrieveManagedPassword 'BRIDGEHOST$' `
>        -KerberosEncryptionType AES256
>    ```
>
> 3. On the bridge host, install the Active Directory PowerShell module and test the gMSA:
>
>    ```powershell theme={null}
>    Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0'   # Windows 10 or 11
>    Install-WindowsFeature RSAT-AD-PowerShell                                         # Windows Server
>    Test-ADServiceAccount gmsa-dcbridge                                               # must return True
>    ```
>
> 4. If a Group Policy defines **Log on as a service** on the bridge host, add the gMSA to that policy. Otherwise the policy replaces the grant `service install` adds, and the service fails to start with error 1069.
>
> 5. With Kerberos LDAP authentication, give the gMSA read access to the synced OU. With WCCE, grant it the CA rights in [Configure AD CS](https://help.allthenticate.com/windows/active-directory/certificate-services.md).

> [accordion] Fallback: run the bridge as a scheduled task
>
> Use a scheduled task only where a service isn't wanted. Registering the console program as a service with `sc.exe create` or `New-Service` doesn't work: it fails with error 1053.
>
> * Set **Start in** to the bridge folder, or pass absolute `--config` and `--env-file` paths. A task with no **Start in** runs in `C:\Windows\System32` and stops with exit code 101 (`0x65`) and `failed to write placeholder config: … Access is denied.`
>
> * Select **Run whether user is logged on or not** and leave **Do not store password** cleared, so the task has network credentials.
>
> * Clear **Stop the task if it runs longer than** on the **Settings** tab (3 days by default).
>
> * The Task Scheduler dialog doesn't accept a gMSA. Set it from PowerShell, and give the gMSA **Log on as a batch job** on the host:
>
>   ```powershell theme={null}
>   $p = New-ScheduledTaskPrincipal -UserId 'CORP\gmsa-dcbridge$' -LogonType Password
>   Set-ScheduledTask -TaskName '<task>' -Principal $p
>   ```
>
> * A task keeps no output. To keep a log, run `cmd.exe /c dc-bridge.exe >> C:\ProgramData\dc-bridge-logs\dc-bridge.log 2>&1` with a separate log folder the task's account can modify, and add `NO_COLOR=1` to `.env`.
>
> * Once setup is finished, lock the bridge folder yourself, because a new folder under `C:\ProgramData` inherits read access for local users:
>
>   ```powershell theme={null}
>   icacls C:\ProgramData\dc-bridge /inheritance:r /grant:r "SYSTEM:(OI)(CI)F" "Administrators:(OI)(CI)F" "CORP\svc-allth-bridge:(OI)(CI)RX"
>   ```
>
>   Grant the task's account by name (in single quotes for a gMSA, whose name ends in `$`). Under NetworkService grant `NT AUTHORITY\NETWORK SERVICE`. Don't lock the folder before the first run, which writes the placeholders there.

## Install with Docker

The Docker image runs CES with NTLM only. Images are published per release as `allthenticate/allthenticate-dc-bridge:<version>` on Docker Hub, for `linux/amd64`, with no `latest` tag.

**1. Create the files first**

On the Docker host, create a directory holding `compose.yaml`, `dc-bridge-config.json`, `.env` and a `certs/` folder with your CA certificates (PEM or DER) and the enrollment agent PFX. Create every file **before** the first start: if a bind-mounted file is missing, Docker creates an empty directory in its place and the bridge exits with `… is a directory, not a file`. Restrict `.env` and the PFX to the administrators who run the bridge, keeping them readable by the container's unprivileged user.

**2. Write compose.yaml**

```yaml compose.yaml theme={null}
services:
  dc-bridge:
    image: allthenticate/allthenticate-dc-bridge:1.5.0
    restart: unless-stopped
    stop_grace_period: 30s
    environment:
      RUST_LOG: debug
    logging:
      driver: json-file
      options:
        max-size: "20m"
        max-file: "5"
    volumes:
      - ./dc-bridge-config.json:/app/dc-bridge-config.json:ro
      - ./.env:/app/.env:ro
      - ./certs:/app/certs:ro
```

`stop_grace_period` gives the bridge time to finish the certificate request in flight (up to 20 seconds) when it stops; Docker's default is 10 seconds. The `logging` block caps the log, which Docker otherwise keeps forever.

**3. Start it and follow the log**

```bash theme={null}
docker compose config     # an error here is a YAML problem
docker compose up -d
docker compose logs -f dc-bridge
```

A healthy CES start logs `Found enrollment agent certificate`, `Loaded enrollment agent cert and keys`, a `Loaded CES CA certificate from …` and `Loaded LDAP CA certificate from …` line for each CA file, `LDAP sync scope base_dn=… groups=…`, `Successfully connected to LDAP at …` and `Successfully bound LDAP`. After a user's request is signed, it logs `Successfully enrolled certificate for <sAMAccountName>`. If the bridge exits at once, the last log line names the problem.

At `RUST_LOG: debug` the log shows every poll, the account names it enrolls and your domain controller's hostname, never passwords. At `info`, a healthy idle bridge is silent. `RUST_LOG` doesn't affect error reporting.

## Example configurations

Every value below is an example. `id`, `error_reporting`, `period` and `poll_period` are the only unquoted values. For every field, see [Bridge configuration](https://help.allthenticate.com/windows/active-directory/configuration.md).

> [tab] Windows, WCCE, Kerberos
>
> ```json dc-bridge-config.json theme={null}
> {
>   "bridge": {
>     "id": 29,
>     "secret_env": "BRIDGE_SECRET",
>     "error_reporting": true
>   },
>   "wcce": {
>     "ca_config": "ca01.internal.example.com\\Example Issuing CA",
>     "agent_pfx_path": "C:\\ProgramData\\dc-bridge\\enrollment-agent.pfx",
>     "agent_pfx_password_env": "WCCE_AGENT_PFX_PASSWORD",
>     "period": 3600
>   },
>   "ldap": {
>     "url": "dc01.internal.example.com",
>     "base_dn": "OU=Members,DC=internal,DC=example,DC=com",
>     "auth": { "type": "Gssapi", "fqdn": "dc01.internal.example.com" },
>     "requested_fields": ["mail", "sAMAccountName"],
>     "poll_period": 300
>   }
> }
> ```
>
> ```txt .env theme={null}
> BRIDGE_SECRET=paste-the-secret-shown-when-you-registered-the-bridge
> WCCE_AGENT_PFX_PASSWORD='password-set-when-exporting-enrollment-agent.pfx'
> ```

> [tab] Docker, CES, NTLM
>
> ```json dc-bridge-config.json theme={null}
> {
>   "bridge": {
>     "id": 29,
>     "secret_env": "BRIDGE_SECRET",
>     "error_reporting": true
>   },
>   "ces": {
>     "url": "https://ca.internal.example.com/internal-CA_CES_UsernamePassword/service.svc/CES",
>     "ca_cert_path": "/app/certs/ca-root.pem",
>     "auth": {
>       "type": "UsernamePassword",
>       "username": "svc-allth-enroll@internal.example.com",
>       "password_env": "CES_PASSWORD"
>     },
>     "agent_pfx_path": "/app/certs/enrollment-agent.pfx",
>     "agent_pfx_password_env": "CES_AGENT_PFX_PASSWORD",
>     "period": 3600
>   },
>   "ldap": {
>     "url": "dc01.internal.example.com",
>     "base_dn": "OU=Members,DC=internal,DC=example,DC=com",
>     "ca_cert_path": "/app/certs/ca-root.pem",
>     "auth": {
>       "type": "Ntlm",
>       "username": "svc-allth-ldap@internal.example.com",
>       "password_env": "LDAP_PASSWORD"
>     },
>     "requested_fields": ["mail", "sAMAccountName"],
>     "poll_period": 300
>   }
> }
> ```
>
> ```txt .env theme={null}
> BRIDGE_SECRET=paste-the-secret-shown-when-you-registered-the-bridge
> CES_PASSWORD='password-of-the-CES-authentication-account'
> CES_AGENT_PFX_PASSWORD='password-set-when-exporting-enrollment-agent.pfx'
> LDAP_PASSWORD='password-of-the-LDAP-bind-account'
> ```

During the call you can set `period` to `60` so changes show within minutes. Set it back to `3600` before leaving the bridge unattended, and keep `poll_period` at `600` or less.

## Validation checkpoints

Run these after the bridge starts. On Windows, read `logs\dc-bridge.log`; in Docker, `docker compose logs -f dc-bridge`. With WCCE, run them with the bridge running as its service, not from a console.

| Check | Where | Expected result |
| - | - | - |
| Configuration loads | Log right after start | No `failed to parse`, `Missing required environment variable(s)`, `is a directory, not a file` or `dc-bridge failed to start` message, and the service or container stays up. |
| Enrollment agent loads | Log | `Loaded enrollment agent cert and keys`. PFX problems show `Failed to verify password against key archive` or `No certificate with enrollment agent EKU found in pfx`. |
| Run-as account (WCCE) | Log | A line with `WCCE enrollment runs as this Windows account`, the `ca_config` you expect and `account=` naming the run-as account (`DOMAIN\\HOST$` under NetworkService). The bridge doesn't contact the CA at startup, so also run `certutil -config "HOST\CA name" -ping` on the host. |
| LDAPS connection and bind | Log | `Successfully connected to LDAP at dc01…` then `Successfully bound LDAP`. A rejected bind (wrong password, no Kerberos ticket) logs `Failed to connect to LDAP: failed to bind: …` instead. |
| Users returned | Admin portal: **DC Bridging** > **Active Directory Information** | The test user is listed with `mail` and `sAMAccountName` within one `poll_period`. `sync withheld: the LDAP query matched no users with a mail attribute` on the bridge card means a wrong base DN, a group the user isn't in, or no **E-mail**. |
| Bridge accepted by Allthenticate | Admin portal: **DC Bridging** > **Bridges**, and the log | No error on the bridge card. A wrong `id` logs `404 Not Found` and a wrong or blank secret `403 Forbidden`, for example `Failed to poll pending CSRs: backend returned 403 Forbidden for GET /dccsrs`. The portal has no separate online indicator. |
| Sync | Admin portal: **Users** > **Groups** > **DC Sync Group** | The test user is a member. |
| CA sees the run-as account (WCCE) | After the first certificate is issued, run on the CA: `certutil -view -restrict "CallerName=CORP\gmsa-dcbridge$" -out "RequestID,RequesterName,CallerName,CommonName,NotBefore"` | The issued request shows the user as **Requester Name** and the run-as account as **Caller Name**. `certutil -view` needs the CA management tools: run it on the CA, or install `Rsat.CertificateServices.Tools~~~~0.0.1.0` (Windows 10 or 11) or `RSAT-ADCS-Mgmt` (Windows Server) on the bridge host. |
| Error reporting (skip if turned off) | Run the bridge with `--test-error-reporting` added (Docker: `docker compose run --rm dc-bridge --config /app/dc-bridge-config.json --env-file /app/.env --test-error-reporting`) | Exit code 0. Code 1 means the reporting host is blocked or reporting is off; 2 means it was reached but rejected the report, which is for Allthenticate to fix. |

Next: [Issue certificates and sign in](https://help.allthenticate.com/windows/active-directory/first-sign-in.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.