# WorkstationConfig

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> A setup you define once and attach to many workstations, by label or by name.


A **WorkstationConfig** is a setup you define once and reuse: the packages, tools, code
and settings that make a workstation ready for one kind of work. You attach it to
workstations by label, and every matching workstation gets it, including workstations
created later.

A WorkstationConfig carries the same fields for a workstation's contents and system
settings that a [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) does, plus a
`selector`, which says which workstations receive it, and a `priority`, which says where it
sits among the layers. It has no status.
[Configuration layers](https://docs-stg.ringleader.dev/workstations/configuration/configuration-layers/)
explains how a WorkstationConfig attaches to workstations, whose workstations it reaches,
the personal layer and the merge order.

```text
apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
```

## Example

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
  name: ide
  namespace: dev
spec:
  selector:
    matchLabels:
      tier: dev
  priority: 100
  image:
    os: linux
    distribution: debian
    version: "13"
  identity:
    shell: /bin/bash
  packages:
    - git
    - name: curl
      updatePolicy: latest
  devtools:
    - name: nodejs
    - name: vscode-web
  ports:
    - 8080
  securityUpdates: true
  defaultLocalBinding:
    enabled: true
    autoForward:
      forwardAll: true
```

## Attachment fields

| Field | Type | Description |
|-------|------|-------------|
| `selector` | `object` | `{matchLabels: {key: value}}`: which workstations auto-receive this config. Empty matches none. A member's selector reaches only workstations they own; an admin's reaches the namespace. |
| `selector.ownerScope` | `bool` | Also require the workstation's owner to be the WorkstationConfig's author (default `false`). Lets an administrator limit a WorkstationConfig that would reach the whole namespace to their own workstations. With **no** `matchLabels` it makes the config a [personal layer](https://docs-stg.ringleader.dev/workstations/configuration/configuration-layers/#personal-layers). |
| `priority` | `int` | Config-layer priority; lower applies first. Default `50`, or `75` for a personal layer. |

Every other field below is a **config-layer provisioning field**, the same set a
[Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) may carry inline. They are documented here because a config is
where you usually put them. All are optional; unknown top-level keys are rejected.

<div class="callout callout-note">
  <p class="callout-title">providerConfig is not a config-layer field</p>
  <div class="callout-body">
    <code>providerConfig</code> (VM sizing, and on a cloud its placement) comes from the Workstation alone and
is never merged from config layers, so a WorkstationConfig that declares it is refused when you
apply it. Keep it on the <code>Workstation</code>. For a fleet-wide default, use a
<a href="https://docs-stg.ringleader.dev/reference/resources/cloudidentity/">CloudIdentity</a>&rsquo;s <code>defaultProviderConfig</code> or
<code>overrideProviderConfig</code>.
  </div>
</div>


## Packages and repositories
`packages` installs software the base image does not carry. An entry's `type` says
where the software comes from: the operating system's package manager, npm, PyPI, the
Go module proxy or the mise registry. An entry is either a bare name, which is a system
package, or an object with a `name`, a `type` unless it is a system package, and the fields below.
[Package installation](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/package-installation/) shows an example, and explains how Ringleader chooses a
version, updates a package, links its commands and removes it.

### Package types

| `type` | Installs | `name` | `version` |
|---|---|---|---|
| `system` | An operating-system package, with `apt` or `apk` | A package name | An exact package version |
| `npm` | A command-line tool from the npm registry, with `npm` | `name` or `@scope/name` | An npm range such as `3`, `^3.1` or `>=3.2 <4`, an exact version such as `3.4.1`, or a dist-tag such as `next` |
| `pypi` | A Python command-line tool from PyPI, with `uv` | The normalized name: lowercase letters, digits and single hyphens, with optional extras as in `ruff[cli]` | A version specifier such as `>=0.6,<0.7`, `~=0.6.4` or `==0.6.9` |
| `go` | A Go program, with `go install` | A package path such as `golang.org/x/tools/gopls` | `latest`, a prefix such as `v1` or `v1.2`, or an exact version such as `v1.2.3` |
| `mise` | A tool from the mise registry, with `mise` | A registry name such as `terraform`, or `aqua:<owner>/<name>` or `github:<owner>/<repo>` | A prefix such as `1.9`, `latest`, `lts` or an exact version |

Applying the config refuses a name or version in the wrong form, and the message names
the field. Four cases are worth knowing before you write the entry:

- A PyPI name must be in its normalized form. For `Ruff` or `my_tool`, the message gives
  the name to use instead.
- An npm name must be one that npm reads as a registry package. A tarball file name, or
  `owner/repo`, which npm installs from GitHub, is refused.
- A Go path must name a `main` package. Ringleader learns whether it does only when
  `go install` builds it, so a wrong path fails during setup.
- A `mise` name cannot use mise's `npm:` or `pypi:` backends. Declare an `npm` or
  `pypi` entry instead.

An entry takes these fields besides `type`, `name` and `version`:

| Field | Types | Meaning |
|---|---|---|
| `updatePolicy` | every type | When an installed package moves to a newer version. See [Package update policies](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/package-installation/#package-update-policies). |
| `bin` | `npm` | A command the package must provide. Setup fails if the package does not provide it. |
| `allowScripts` | `npm` | `true`, or a list of npm package names, whose install scripts may run. |
| `shadows` | every type except `system` | Command names the package may link even when the operating system already provides a command of that name. See [Let a package replace a system command](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/package-installation/#let-a-package-replace-a-system-command). |

### Hosts a strict egress policy must allow

Under a strict [egress policy](#outbound-connection-restrictions), each type needs these
hosts, together with those of the devtool Ringleader may add:

| Type | Hosts |
|---|---|
| `npm` | `registry.npmjs.org`, and `deb.nodesource.com` for an added Node.js on Debian and Ubuntu |
| `pypi` | `pypi.org`, `files.pythonhosted.org`, and `github.com` for uv and its Pythons |
| `go` | `proxy.golang.org` and `sum.golang.org`, and `go.dev` and `dl.google.com` for an added Go |
| `mise` | `mise-versions.jdx.dev`, `github.com` and `api.github.com`, and the host each tool downloads from |

GitHub serves release downloads from `*.githubusercontent.com`, so allow that wherever
the table lists `github.com`. The daily [update scan](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/security-updates/#daily-update-scan)
reads the same registries.

### Package repositories

`packageRepositories` adds third-party apt repos or Launchpad PPAs before packages
install. `aptSources` is a legacy alias normalized into this shape.

```yaml
packageRepositories:
  - name: docker              # basename for the keyring + source files
    type: apt                 # apt (default) | ppa   (apk/rpm reserved)
    urls: ["https://download.docker.com/linux/debian"]
    key:
      url: https://download.docker.com/linux/debian/gpg   # or: inline | fingerprint
    apt:
      suites: ["bookworm"]
      components: ["stable"]
      architectures: ["amd64", "arm64"]   # optional; defaults to the machine's arch
      types: ["deb"]                        # optional; default ["deb"]
  - name: deadsnakes
    type: ppa
    ppa:
      ownerName: deadsnakes/ppa
      suite: jammy                          # optional; else derived from the OS codename
```

The `apt` block also accepts `suiteAliases` (remap the resolved OS codename for a
repo that lags a new distro release) and `options` (an escape hatch for extra
deb822 keys). A private repo adds `auth: {login, password}` (each may be a
`${secret:NAME}` reference).

## Devtools and tool configuration
`devtools` installs development tools from curated recipes, each entry
`{name, version?, config?, fatal?, retries?}`.
[Devtools](https://docs-stg.ringleader.dev/reference/tools/devtools/) lists every recipe and its fields.
`toolconfigs` sets up tools that are already installed, each entry `{id?, name, config}`.
[Tool configuration](https://docs-stg.ringleader.dev/reference/tools/tool-configuration/) lists every tool and its
fields. [Devtools and tool configuration](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/devtools-tool-configuration/) explains how both behave.

## Workspace trust

`trustedFolders` lists more folders for the workstation's coding tools to trust, beside
every `sources[].path`. [Trusted folders](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/#trusted-folders) says which tools
read it.

```yaml
trustedFolders:
  - /home/dev/scratch
```

## Code sources

`sources` puts code on the workstation, in declared order: a **git** clone or a **local**
folder, synced to `path`. [Code sources](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/#code-sources) explains each
setting.

```yaml
sources:
  - name: app
    path: /home/dev/app
    updatePolicy: latest      # pinned (default; clone once) | latest (fast-forward, git only)
    git:
      url: https://github.com/acme/app.git
      ref: main               # branch/tag/commit; empty = remote default
      credentialRef:          # Secret with a deploy key (SSH) or PAT (HTTPS)
        name: gh-token
        key: token
  - name: local-lib
    path: /home/dev/lib
    local:
      path: /host/checkout/lib   # host dir streamed in (ringleader-on-ringleader)
```

An entry can also run its repository's `devcontainer.json` on the workstation, as
[Devcontainer workstations](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/devcontainers/) describes:

| Field | Type | Description |
|-------|------|-------------|
| `devcontainer.enabled` | `bool` | Run this source's devcontainer on the workstation. Only **one** source may set it, and a second is refused at apply. The source must have a `path`. |
| `devcontainer.configPath` | `string` | Optional path to the devcontainer file, **relative to the source's `path`**. Omit it for the tool's own discovery: `.devcontainer/devcontainer.json`, then `.devcontainer.json`. |

## Scripts

`scripts` are setup commands the workstation runs in order.
[Setup scripts](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/scripts-files-services/#setup-scripts) explains `phase`, each `runPolicy` and when
scripts run:

```yaml
scripts:
  - name: setup
    phase: system             # system (root) | user (login user, in $HOME)
    content: |
      apt-get install -y build-essential
    runPolicy: onChange       # once (default) | onChange | always | onRecycle
    watchPaths: ["/etc/foo"]  # onChange: re-run when these change
    failOnError: true         # on a non-zero exit, skip the remaining scripts and services
    timeoutSeconds: 300       # 0 = no timeout
    env:
      TOKEN: ${secret:ci-token}
```

`runAsDefaultUser: true` is the canonical equivalent of `phase: user`.

A script may take its body from a
[ConfigMap](https://docs-stg.ringleader.dev/reference/resources/configmap/) instead of inlining it:

```yaml
scripts:
  - name: bootstrap
    phase: system
    contentFrom:
      configMapRef:
        name: bootstrap
        key: setup.sh
```

`contentFrom` and `content` are mutually exclusive: declaring both is refused at
apply.

## Managed services

`services` keeps programs running, each from a full systemd `unit` or a `command` that
Ringleader turns into one.
[Managed services](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/scripts-files-services/#managed-services) explains how they run:

```yaml
services:
  - name: api
    command: /home/dev/app/serve --port 3000
    runAs: dev
    enable: true              # start on boot (default true)
    start: true               # start now (default true)
    environment:
      PORT: "3000"
```

## Files

`files` puts files on the workstation.
[Declared files](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/scripts-files-services/#declared-files) explains ownership and when Ringleader writes and
removes them:

```yaml
files:
  - path: /etc/foo.conf
    content: "key = value\n"       # or contentBase64, url, or contentFrom
    owner: root:root               # "user[:group]"; default root (or the login user for ~/ paths)
    mode: "0644"
    parents: true                  # accepted for compatibility; parent folders are always created
  - path: ~/.config/app/config.yaml
    contentFrom:                   # from a ConfigMap key
      configMapRef:
        name: app-defaults
        key: config.yaml
    removeWhenUndeclared: true     # delete the file when this entry goes away
```

Content may contain `${secret:NAME}` references. Exactly **one** content source per
entry (`content`, `contentBase64`, `url` or
[`contentFrom`](https://docs-stg.ringleader.dev/reference/resources/configmap/)), and declaring two is refused
at apply.

## Identity and users
`identity` is the **one place** the login user is declared; the agent owns user
creation:

```yaml
identity:
  user: dev
  uid: 1000
  gid: 1000
  group: dev
  groups: ["docker", "sudo"]
  shell: /bin/bash            # default /bin/bash
  sudo: false                 # passwordless sudo is on by default; false opts out
```

The login user gets **passwordless sudo by default**. [Login user](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/users-environment-system-settings/#login-user) explains
where `sudo: false` takes effect, and how Ringleader names the user when you don't.

## Environment and shell
`environment` sets system-wide variables, and `dotfiles` adds lines to files in the login
user's home folder. [Dotfiles](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/#dotfiles) explains how Ringleader writes them.

```yaml
environment:                  # → /etc/environment + /etc/profile.d (system-wide)
  EDITOR: vim
  DB_URL: ${secret:db-url}
dotfiles:                     # path → content, written as managed blocks
  ".bashrc": |
    alias ll='ls -la'
```

## Dotfiles repository

`dotfilesRepo` clones your own dotfiles repository into the workstation and installs it
with the repository's own install script.
[Dotfiles repository installation](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/#dotfiles-repository-installation)
explains the steps.

```yaml
dotfilesRepo:
  url: https://github.com/me/dotfiles
  ref: main                   # branch/tag/commit; empty = the remote's default branch
  path: .dotfiles             # HOME-relative checkout dir (default .dotfiles)
  installScript: setup.sh     # repo-relative entry point; empty = probe for one
  updatePolicy: pinned        # pinned (default; clone once) | latest (fast-forward each pass)
  timeoutSeconds: 120         # bounds the clone AND the install script, separately
  credentialRef:              # a Secret with a deploy key (SSH url) or a PAT (HTTPS url)
    name: dotfiles-deploy-key
```

| Field | Type | Description |
|-------|------|-------------|
| `url` | `string` | **Required.** `https://`, `http://`, `ssh://`, `git@host:path` or `git://`. |
| `ref` | `string` | Branch, tag or commit. Empty clones the remote's default branch. |
| `path` | `string` | HOME-relative checkout directory. Default `.dotfiles`. |
| `installScript` | `string` | A repo-relative script to run instead of probing. It is executed as a **file inside the checkout**, never evaluated as a command line. |
| `credentialRef` | `object` | `{name, key}` naming a Secret, for a private repository. |
| `updatePolicy` | `string` | `pinned` (default) clones once; `latest` fast-forwards on each configuration pass. |
| `timeoutSeconds` | `int` | Bounds the clone and the install script separately. Default `120`. |
| `fatal` | `bool` | Default **`false`**, so a broken dotfiles install never blocks `Configured`. |
| `retries` | `int` | Extra attempts within one pass (0–5). |

## Step failure policy: `fatal` and `retries`

Most provisioning entries accept two extra keys: `fatal` and `retries`. They are
supported on `scripts`, `sources`, `packages`, `devtools`, `files`, `services` and
`dotfilesRepo`. [Step failures and retries](https://docs-stg.ringleader.dev/workstations/configuration/step-failures-retries/) explains what each
one does, and which steps take neither.

| Field | Type | Description |
|-------|------|-------------|
| `fatal` | `bool` | Does this step's failure block the workstation reaching `Configured` (and therefore `Available`)? |
| `retries` | `int` | Extra attempts **within one configuration pass** after a failure. Clamped to 0–5; a negative value means none. |

Defaults:

| Step | Default `fatal` |
|---|---|
| `scripts`, `sources`, `packages`, `devtools`, `files`, `services` | `true` |
| the same steps contributed by a [personal layer](https://docs-stg.ringleader.dev/workstations/configuration/configuration-layers/#personal-layers) | `false` |
| `dotfiles` (the map) and `dotfilesRepo` | `false` |

An unset `retries` is **2** for a non-fatal step and **0** for a fatal one.

## Workstation capabilities

`capabilities` declares what a workstation's **own** identity may do: the workstation acting
for itself, as opposed to you acting on it. A workstation has an identity of its own only where
whoever runs your control plane has turned workstation identity on, and it is off by default.
Where it is off, the workstation can use none of these capabilities, whatever you declare.

```yaml
capabilities:
  - self:read
  - self:power
```

| Capability | What it allows | Default |
|---|---|---|
| `self:read` | The box reads its own Workstation record: phase, conditions, status. | **on** |
| `self:power` | The box writes `spec.stopped` / `spec.restartNonce` on its own record, so it can stop or restart itself. | off |
| `sa:assume` | The box may assume a [ServiceAccount and IdentityProvider](https://docs-stg.ringleader.dev/reference/resources/serviceaccount/) at all. Which one is decided by that account's own trust rules. | off |


An unknown name is refused at apply, so a typo cannot quietly declare nothing.

**Both tiers must agree, and neither can widen past the owner.** What a box ends up
holding is the **intersection** of what admin-authored layers declare and what
member-authored ones do (the box's own spec counts as member-authored), and it is then
bounded by what the box's **owner** is themselves permitted to do. So:

- An admin's layer **grants**; declaring one extra capability does not silently revoke
  `self:read`, because the defaults are the base rather than a competing term.
- An admin's layer declaring `capabilities: []` opts the namespace out of the defaults
  entirely.
- A member can only **narrow**. Naming a capability no admin granted yields nothing;
  naming a subset narrows to that subset.
- If no member-authored layer mentions the key at all, the member tier constrains
  nothing.

Layer priority is irrelevant here: an intersection is order-free, and merge order is
not what decides an authorization.

## System settings

```yaml
hostname: dev-box
timezone: America/New_York    # IANA name
locale: en_US.UTF-8
sysctls:                      # → /etc/sysctl.d/
  vm.max_map_count: "262144"
limits:                       # pam_limits → /etc/security/limits.d/
  - domain: "*"
    type: soft                # soft | hard | -
    item: nofile
    value: "65536"
```

## Outbound SSH trust

`sshKnownHosts` adds host keys to `~/.ssh/known_hosts` for outbound SSH. Each entry
is a bare hostname (resolved from a built-in catalog) or `{host, keys}`.
[Host keys for outbound SSH](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/#host-keys-for-outbound-ssh)
explains why. For example:

```yaml
sshKnownHosts:
  - github.com                     # catalog-resolved
  - host: git.internal
    keys: ["ssh-ed25519 AAAA…"]
```

## Security updates and diagnostics
```yaml
securityUpdates: true         # install OS security updates once a day (Debian, Ubuntu and Alpine)
diagnostics:
  ledger:
    enabled: true             # default true
    retain: 30d               # default 30d
    maxOutputBytes: 65536     # per-step stdout/stderr cap
```

`securityUpdates: true` has the same effect as `updates.system: security` on a workstation
where no layer sets `updates.system`. To choose between security fixes and every update, use
[`updates`](#update-settings) instead. If the workstation or any of its layers sets
`securityUpdates: true`, the setting is on.

`maxOutputBytes` caps each step's stdout and stderr. A value above 128 KiB resolves to 128 KiB.

[Security updates and the update scan](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/security-updates/)
explains what `securityUpdates` installs and how the daily update scan works.

## Update settings

`updates` decides which updates a workstation installs on its own, once a day, and whether it
may reboot for them. Without it, a workstation installs no operating system updates unless
`securityUpdates` is `true`. Its packages and devtools with `updatePolicy: latest` keep moving
to newer releases.

```yaml
updates:
  system: security          # off (the default) | security | all
  packages: latest          # latest (the default) | off
  minimumReleaseAge: 3d     # 24h by default
  reboot: window            # never (the default) | window
```

| Field | Values | Default | What it does |
|---|---|---|---|
| `system` | `off`, `security`, `all` | `off`, or `security` when `securityUpdates` is `true` | Which operating system updates the workstation installs. `security` installs security fixes only. On Debian and Ubuntu, these come from the distribution's security suite. On Alpine, they are the updates that Alpine's security database lists as fixes. `all` installs every update from the workstation's package repositories. On Debian and Ubuntu, these include the repositories you declare. On Alpine, they are the `main` and `community` repositories of the installed release. |
| `packages` | `latest`, `off` | `latest` | Whether language packages and devtools with `updatePolicy: latest` move to newer releases. `off` keeps each of them at the release it has. |
| `minimumReleaseAge` | A duration, such as `24h` or `3d` | `24h` | How old a language package release must be before the workstation installs it, on a first install too. A devtool that installs from npm follows it as well. A value that isn't a positive duration is refused when you apply it. |
| `reboot` | `never`, `window` | `never` | Whether the workstation may reboot itself when an update needs a reboot. `window` lets it reboot inside its [maintenance window](#maintenance-windows), and a workstation without one never reboots. |

Each field takes its value from the highest-priority layer that sets it, so one layer can set
`system` and another `reboot`. The workstation's own `updates` is the base the layers apply
over.

[Devtool updates](https://docs-stg.ringleader.dev/reference/tools/devtools/#operating-system-updates) lists
which devtools move with `system` and which with `packages`.

## Maintenance windows

`maintenance` sets when a workstation may interrupt your work for an update. These wait for an
open window:

- A restart of a service that an update changed. Only the services Ringleader manages wait:
  those you declare in `services`, Docker, the code-server editor from `vscode-web`, the SPIRE
  agent and Tailscale.
- A reboot that an update needs, when `updates.reboot` is `window`.
- An update to Ringleader's agent on the workstation.

```yaml
maintenance:
  timezone: Europe/Warsaw
  windows:
    - days: [Sat, Sun]
      start: "02:00"
      duration: 4h
  maxDeferral: 7d
```

| Field | Notes |
|---|---|
| `timezone` | An IANA time zone name, such as `Europe/Warsaw`. Default `UTC`. An offset such as `+02:00` is refused. If the workstation can't load the name, the window has no effect: restarts and agent updates run when they are ready, and an update never reboots the workstation. |
| `windows[]` | **Required**, at least one. Leave out the whole `maintenance` block instead of giving an empty list. |
| `windows[].days` | Day names, short (`Sat`) or full (`Saturday`). Empty means every day. A day listed twice is refused. |
| `windows[].start` | When the window opens, `"HH:MM"` on a 24-hour clock in `timezone`. |
| `windows[].duration` | How long the window stays open, from `1h` to `7d`. |
| `maxDeferral` | The longest a restart or an agent update waits for a window before it runs anyway, at most `14d`. Without it, the limit your deployment sets applies, 14 days unless your operator changed it. If the deployment's limit is lower, the lower limit applies. |
| `openNow` | A one-off window: `{start, duration}`. `start` is an RFC 3339 time such as `"2026-12-07T09:00:00Z"`, and `duration` is from `1h` to `24h`. It opens beside `windows`, which you still declare. |

Without a `maintenance` block, a workstation restarts a service and updates the agent as soon
as the update is ready. It never reboots for an update. With or without a window, a restart
also waits for a coding agent turn in progress to finish, for up to 30 minutes after the
update.

A reboot has no `maxDeferral` limit. It waits until the window is open and no coding agent turn
is in progress, and if the window closes first, it waits for the next one. Ringleader reboots
only a workstation that runs systemd in a virtual machine, such as a Debian or Ubuntu
workstation. An Alpine workstation never reboots for an update. Until the reboot happens,
`status.packageUpdates.rebootPending` is `true`.

The highest-priority layer that declares `maintenance` supplies the whole block. Ringleader
doesn't combine its fields with those of the workstation's own block or a lower layer's.

## Tailscale

Join the workstation to a Tailscale tailnet. The join credential is **always** a Secret
reference. An inline key is rejected.

```yaml
tailscale:
  enabled: true
  authKeyRef:
    name: tailscale-authkey
    key: authkey
  ssh: true                        # --ssh
  hostname: dev-box                # --hostname
  tags: ["tag:dev"]                # --advertise-tags (must match the key's ACL tags)
  advertiseRoutes: ["10.0.0.0/24"] # subnet router
  acceptRoutes: true
  exitNode: "100.x.y.z"            # route egress via this node
  exitNodeAllowLANAccess: true     # keep the local LAN reachable while using an exit node
  advertiseExitNode: false         # make THIS workstation an exit node
  acceptDNS: true                  # MagicDNS (default on)
  loginServer: ""                  # custom control plane / Headscale
```

## Ports and forwarding
`ports` declares the workstation's listening ports. `defaultLocalBinding` is a template the
daemon uses to seed a [LocalBinding](https://docs-stg.ringleader.dev/reference/resources/localbinding/) once, when the workstation first reaches Running,
so ports forward to your device automatically. See the LocalBinding reference for the
full `autoForward`/`ports`/`sockets`/`urlForward` shape.

```yaml
ports: [8080, 3000]
defaultLocalBinding:
  enabled: true
  scope: owner                # owner (default) | accessors (grantees' devices seed it disabled)
  autoForward:
    forwardAll: true
    portOffset: 10000         # workstation 8080 → host 18080
```

To forward the workstation's Docker socket to each device that seeds the binding, add
`dockerSocket`. You do not name the path on your computer, because it differs from one device
to the next: Ringleader picks it on each device when it seeds the binding.

```yaml
defaultLocalBinding:
  enabled: true
  dockerSocket:
    enabled: true
    remotePath: /var/run/docker.sock   # the socket inside the workstation; this is the default
```

The seeded LocalBinding carries it as an ordinary
[`sockets[]` entry](https://docs-stg.ringleader.dev/reference/resources/localbinding/#spec-fields) marked
`docker: true`.

## Outbound connection restrictions

The `egress` block limits where a workstation may connect.
[Outbound restrictions](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/) shows how to
write one, and [Enforcement points](https://docs-stg.ringleader.dev/security/outbound/enforcement/) says
what enforces it on each provider.

```yaml
egress:
  enforcement: strict           # strict | bestEffort | audit | open; required, no default
  destinations:
    - cidr: 10.20.0.0/16        # a network, or a bare address
    - cidr: 203.0.113.7
      ports: [443, 5432]        # defaults to [443]
    - host: github.com          # a name; 80 and 443 only
    - host: "*.githubusercontent.com"
```

`enforcement` is required and has no default.

| Value | Means |
|---|---|
| `strict` | A workstation whose provider cannot hold this policy is **refused when you apply it**, so you find out while you can still change what you wrote. |
| `bestEffort` | The workstation is set up either way, and any shortfall is reported on its [`EgressEnforced` condition](https://docs-stg.ringleader.dev/reference/resources/workstation/#egressenforced-reasons). |
| `audit` | The workstation's connections go through an [Edge](https://docs-stg.ringleader.dev/reference/resources/edge/), which records each one it lets through. It enforces no destination, and `destinations` are optional. [Workstation reach audit](https://docs-stg.ringleader.dev/security/outbound/reach-audit/) shows how to turn the records into a `strict` policy. |
| `open` | The workstation reaches everything except what its `deny` list names. Write a `deny` list and no `destinations`. As with `strict`, `rl apply` rejects the workstation if its provider cannot enforce the list. |

Each destination is a `cidr` **or** a `host`, never both:

| Field | Notes |
|---|---|
| `cidr` | A network in prefix form (`10.20.0.0/16`) or a bare address. A network with host bits set below the prefix length is refused. Any port in `ports`. Behind an edge instance, a private range cannot be reached on GCP and Azure, and a range inside the VPC cannot be reached on AWS. |
| `host` | A name, optionally with a leading `*.` wildcard. **Only ports 80 and 443.** Enforcing a name needs an [Edge](https://docs-stg.ringleader.dev/reference/resources/edge/) serving the workstation's provider and region, except on hcs, vz and qemu. [Filtering behavior](https://docs-stg.ringleader.dev/security/outbound/filtering/#destinations-by-address-and-by-name) says why, and what a name that resolves to a private address gets. |
| `ports` | TCP ports, 1-65535. Defaults to `[443]`. |

Omitting the block entirely means no restriction. An **empty** block is not the same
thing: it is a policy with no `enforcement`, and it is refused. So is a `strict` or
`bestEffort` policy that names no destinations, because a policy permitting nothing would
keep the workstation from reaching Ringleader. An `audit` policy with no
destinations is accepted, because it enforces no destination. An `open` policy is refused
when it names any `destinations`, or when its `deny` list is empty.

Ringleader adds the destinations a workstation needs to stay managed, and the endpoints of its
attached Integrations. [Destinations Ringleader adds](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/#destinations-ringleader-adds)
says which.

### Block destinations with a deny list

A deny list names destinations the workstation must never reach. Each entry in `deny` is one of
three kinds:

| Field | What it refuses |
|---|---|
| `privateNetworks: true` | The private ranges on every port: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10` (carrier-grade NAT, and every Tailscale address), `198.18.0.0/15`, `192.0.0.0/24` and the IPv6 range `fc00::/7`. It takes no `ports`. |
| `cidr` | A network in prefix form (`10.20.0.0/16`) or a bare address. Without `ports` it refuses every port, where an allow entry defaults to 443. |
| `host` | A name, optionally with a leading `*.` wildcard, on ports 80 and 443. List one of the two in `ports` to refuse only that one. |

[Keep a workstation off your local network](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/#keep-a-workstation-off-your-local-network)
and [Block specific destinations](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/#block-specific-destinations)
show how to write a deny list, and [Limits of a deny list](https://docs-stg.ringleader.dev/security/outbound/filtering/#limits-of-a-deny-list)
says what it does not stop.

### Layer combination

When several layers declare `egress`, including the workstation's own spec, they combine into
one policy by two rules, and layer priority decides neither:

- **Destinations add up, and so do deny lists.** The workstation may reach every destination any
  layer names, except what any layer's `deny` list names. An entry two layers both name counts
  once.
- **`enforcement` only gets stricter.** The order is `strict`, then `bestEffort`, then `audit`,
  then `open`, and the strictest one any layer declares wins. One layer declaring `strict` makes
  the whole policy `strict`. A workstation is `open` only when nothing it declares or inherits
  says anything else.

[Layers and the Policy limit](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/#layers-and-the-policy-limit)
says what follows, and how an administrator caps which destinations workstations may reach.

## Status

None. A WorkstationConfig has no `status`: it is consumed by the config-layer merge
when a workstation is resolved.

