# Host inspection and exclusion

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


> Check a host's requests without adding a key, or keep a host from being decrypted, in an httpProxy Integration.


In an `httpProxy` Integration, check a host's requests without adding a key, or keep a host from
being decrypted. Ringleader decrypts the HTTPS traffic to a host so that it can add a key to a
request. Two settings use that decryption for something else. `inspect: true` decrypts a
host's traffic and adds nothing, so Ringleader can check each request. `exclude` lists hosts that
are never decrypted, for a client that fails with Ringleader's certificate. An Edge's
`spec.llm.inspect` is a different setting. It decrypts the hosts of LLM providers for every
workstation the Edge serves, on a cloud Edge only.
[The LLM setting](https://docs.ringleader.dev/reference/resources/edge/#the-llm-setting) describes it.

## Prerequisites

Both settings are part of an `httpProxy` Integration, so they need what injection needs. A cloud
workstation needs an Edge, and the injection
[Prerequisites](https://docs.ringleader.dev/security/credentials/injected-credentials/#prerequisites) apply.

## Inspect a host without injecting

`inspect: true` decrypts a host's traffic and adds nothing. Each request is checked for a `Host`
header that matches the host the connection was opened to. That stops a request from being sent to
one service under another service's name. To inspect a host:

1. If the workstation has an egress policy, make sure the policy lists the host, as the
   paragraphs after these steps explain.
2. Add a rule with `inspect: true` in place of `inject`:

   ```yaml
   apiVersion: workstations.ringleader.dev/v1
   kind: Integration
   metadata:
     name: inspect-npm
     namespace: acme
   spec:
     type: httpProxy
     selector:
       matchLabels:
         team: platform
     httpProxy:
       rules:
         - host: registry.npmjs.org
           inspect: true
   ```

3. Apply the Integration with `rl apply -f integration.yaml`.

Cloud, hcs, vz and qemu workstations check an inspected host.

Inspection does not make a host reachable. When a workstation has an egress policy, the policy
must list the host before an inspection rule can check it. Inspection adds no destination or
Integration source to the compiled allowlist. A host the policy already names remains allowed and
visible in `rl workstation describe`, and a rule cannot widen a colleague's policy. A workstation
with no egress policy remains unrestricted, so an inspection rule can still check its named host.

An `inspect` rule takes no `inject` and no `allowDaemonPlacement`, and Ringleader refuses an
Integration that sets either beside it.

## Exclude a host from decryption

`exclude` lists hosts that are never decrypted, even when a rule names them. Use it for a client
that fails with Ringleader's certificate, as
[Requests to a named host](https://docs.ringleader.dev/security/credentials/injection-effects/#requests-to-a-named-host)
describes. An entry is a hostname, or `*.` and a domain for every name under it. `*.example.com`
does not cover `example.com` itself. To exclude a host:

1. Add the host under `exclude` in an Integration that reaches the workstation:

   ```yaml
   apiVersion: workstations.ringleader.dev/v1
   kind: Integration
   metadata:
     name: github-api
     namespace: acme
   spec:
     type: httpProxy
     selector:
       matchLabels:
         team: platform
     httpProxy:
       rules:
         - host: api.github.com
           inject:
             header: Authorization
             value: "Bearer ${secret:github-pat/token}"
       exclude:
         - uploads.github.com
         - "*.pinned.example.com"
   ```

2. Apply the Integration with `rl apply -f integration.yaml`.

An exclusion applies to every injection into the workstations the Integration reaches, including
generated GitHub hosts and other Integrations' rules. A host that an exclusion covers reports
`HostNotIntercepted` on the Integration that names it in a rule.

To keep a generated GitHub host out of the GitHub preset, exclude it. Ringleader then leaves it out
of the preset. This Integration excludes one:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: Integration
metadata:
  name: github-exclusions
  namespace: acme
spec:
  type: httpProxy
  selector:
    matchLabels:
      team: platform
  httpProxy:
    exclude:
      - raw.githubusercontent.com
```

## Next steps

- [Injected credentials](https://docs.ringleader.dev/security/credentials/injected-credentials/) adds a key to a request as it
  leaves the workstation.
- [Effects of injection on a workstation](https://docs.ringleader.dev/security/credentials/injection-effects/)
  says which clients fail on a decrypted host.
- [Injection fields](https://docs.ringleader.dev/reference/resources/integration/#injection-fields) lists the `inspect` and
  `exclude` fields and their limits.

