# Names and certificates

_For tartan 0.9.36._

Reach every device by name, like files.acme.tartan.net, and serve HTTPS on it with a real certificate whose key never leaves the device.

Reach every device by name, like `files.acme.tartan.net`, and serve HTTPS on it with a real certificate whose key never leaves the device.

Every name is a label under your organization's zone: `<label>.acme.tartan.net`. A Tech, an Admin or an Owner sets names.
Only your Tartan names go to Tartan's resolver; everything else resolves as before.

## 1. Name a device

When it steps up, your passkey approves it.

```sh
tartan device list --org acme
tartan name set --org acme --label files --target device:<device id> --state internal
```

In the console: **Devices**, open the device, then **Names** › **Add a name**. A name made there is `internal`.

A name points at a device (`device:<id>`), a NAT resource (`nat:<id>`, from `tartan nat list --org acme`) or an IPv6 address
(`aaaa:<addr>`). A name is never moved silently: setting a label that already points somewhere else is refused
with `name_taken`. Remove it first, then set it again.

## 2. Choose who sees it

| State | Who resolves it |
|---|---|
| `internal` | Only your organization's own devices. Never published. |
| `gated` | Published; anyone outside sees Tartan's page in its place. Use it for a name a partner sees. |
| `public` | Published with its private IPv6 address. |

A NAT resource's name is never `public`.

A `gated` or `public` name, and any certificate, need the organization's zone published once. That is the Owner's: the
request waits for the Owner's own approval, then the same command finishes it. Your passkey approves the request;
the Owner's own passkey is the approval.

```sh
tartan zone show --org acme
tartan org zone-ds --org acme
tartan approval approve --org acme --id <approval id>
tartan org zone-ds --org acme --approval <approval id>
```

## 3. Serve HTTPS on the device

Turn on TLS for the device. The device makes its own key and sends a request for it; Tartan orders the certificate
for `*.acme.tartan.net` and an opaque per-device label, so your hostnames stay out of certificate transparency logs. When it steps up, your passkey approves it.

```sh
tartan device set --org acme --device <device id> --tls_serving --dry-run
tartan device set --org acme --device <device id> --tls_serving
```

On Windows the agent installs the certificate in the computer's Personal (`My`) store, on a key that can't be
exported. Bind your site to it once. At each renewal the agent moves any HTTP.sys or IIS binding that held the old
Tartan certificate to the new one; it never creates a binding and never touches one that holds another certificate.

Certificates renew on their own. To order one now instead of waiting:

```sh
tartan zone tls renew --org acme --device <device id>
```

## 4. Remove a name

When it steps up, your passkey approves it.

```sh
tartan name remove --org acme --label files
```

A published name is withdrawn from Tartan DNS.

## Check it worked

- `tartan name list --org acme` shows each name, its target and its publish state.
- `tartan zone tls status --org acme` shows each TLS device's names, fingerprint and expiry, and whether its key's
  request is still pending.
- From another device in the organization, `https://files.acme.tartan.net` opens with a valid padlock.

## Next

- [Share with a partner org](partner-org.md)
- [Zones and firewall rules](firewall.md)
- [Printers and legacy systems](legacy-systems.md)
