# Host access and loopback reach

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


> A node-bound workstation's host access is whatever reaches your computer from outside its virtual machine, and it never leaves your computer.


A node-bound workstation's host access is anything that reaches your computer from outside the
virtual machine, and it never leaves your computer. This page lists which fields are host access,
and whether the workstation reaches your computer's own `127.0.0.1`, which depends on its
provider. A [node-bound workstation](https://docs-stg.ringleader.dev/workstations/basics/#node-bound-workstations)
is a local workstation whose record Ringleader keeps.

## Host access that stays on your computer

These spec fields are host access:

- `providerConfig.mounts`, and every `providerConfig` key that names a file or a port of your
  computer: `image` on the providers these docs cover, vz, hcs and qemu, and `command` on qemu.
- An entry of `sources` that copies a folder from your computer (`sources[].local`).
- `ports` and `defaultLocalBinding`, the forwards to your computer.
- `hostAccess`, which sets whether the workstation reaches your computer's `127.0.0.1`, and the
  labels your computer selects it by. The
  [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/#host-access-fields) reference lists its
  fields.

Write them in the workstation file as usual, and apply it on the computer that runs the
workstation. `rl apply`, `rl edit` and `rl workstation create` keep them on your computer and
send the rest to Ringleader. `rl get` on that computer shows the whole spec. On any other
device, and in the console, the spec has none of them.

A WorkstationConfig can't supply host access to a node-bound workstation. If a WorkstationConfig
sets one of these fields, Ringleader leaves the field out. The workstation then shows a
`HostAccessFromDevice` condition naming the field and the WorkstationConfig. `rl apply` rejects
`hostAccess` on a WorkstationConfig outright.

## Loopback reach

Whether a node-bound workstation reaches your computer's `127.0.0.1` depends on its provider. The
table covers the providers these docs cover:

| Provider | By default | `loopback: true` | `loopback: false` |
| --- | --- | --- | --- |
| vz, hcs | No reach. | Refused. | Accepted, and changes nothing. |
| qemu | No reach. | Starts the workstation on an open network that reaches it. Refused when you set it while an egress policy or an injected credential applies to the workstation. | The default. |
| qemu, when a restricted network isn't available for it on your computer | Reaches it. | Accepted. | Refused, because the workstation reaches it whatever the field says. |

A qemu workstation has no restricted network in two cases:

- On a computer that runs neither Linux nor macOS.
- When it was created before Ringleader could set up the network cards it needs.

Otherwise, an egress policy or an injected credential moves a running qemu workstation that has
`loopback: true` onto the restricted network. [qemu network cards](https://docs-stg.ringleader.dev/security/outbound/enforcement/#qemu-network-cards)
says when it restarts, and when it returns to the open network.

A workstation that reaches your loopback, by default or through `loopback: true`, also reaches
your computer's link-local addresses. When your computer is itself a cloud virtual machine, that
includes its metadata service and the cloud credentials it hands out. A `DeviceReach` condition
on the workstation says that it reaches your loopback, so you and the console can both see it.

## Set a workstation's host access

To set what a node-bound workstation reaches on your computer, write its host access in the
workstation file. Apply the file on the computer that runs it:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: Workstation
metadata:
  name: my-box
  namespace: team
spec:
  provider: qemu
  ports: [3000]
  hostAccess:
    loopback: false
    labels:
      ssh: personal
```

Here, the workstation doesn't reach your computer's `127.0.0.1`, and forwards port 3000 to your
computer. The SSHKey and LocalBinding resources on your computer that select `ssh: personal`
reach it.

## Next steps

- [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) lists the `node` and `hostAccess`
  fields among the rest of the spec.
- [LocalBinding](https://docs-stg.ringleader.dev/reference/resources/localbinding/) and
  [SSHKey](https://docs-stg.ringleader.dev/reference/resources/sshkey/) cover the resources on your computer that select
  a workstation by its host-access labels.

