# egress

Network access per role. Each role's agents reach only the hosts on its list, through a proxy that reads host names and never decrypts.

| | |
|---|---|
| Kind | Plugin |
| Roles | None (a service the node runs) |
| Status | experimental |
| Ships with Fleetlayer | Yes |
| Licence | FSL-1.1-ALv2 (source-available) |
| Maintainer | Fleetlayer |
| Source | https://github.com/fleetlayer/fleetlayer/tree/main/plugins/egress |
| Install | In every Fleetlayer release |
| Command | `fleetlayer-egress` |
| Platforms | Linux |
| Works with | Fleetlayer 0.3.13 and later |
| Plugin protocol | version 1 |
| Grants | `access.check` |

## What it does

Little Snitch for an agent fleet. A restricted role's port-443 and port-80 traffic is redirected to a local proxy,
its DNS to a local resolver, and once enforced everything else it sends off the machine is refused, LAN and tailnet
included. A role starts in log mode, and `fleetlayer-egress suggest` turns a week of the log into its list. A refused
agent asks for a host with a one-line reason, a person approves it through Fleetlayer's approvals, and it stays
allowed. A probe on each role's node checks that the rules really hold and reports through the node's health.

## Setup

It comes with Fleetlayer, so there's nothing else to install. To start from:

```yaml
plugins:
  - name: egress
    command: fleetlayer-egress
    grants: [access.check]
    # roles and hosts go in ~/.config/fleetlayer/egress.yaml; firewall: fleetlayer-egress firewall --apply (root)
```

## What it can read and do

Runs as a Unix user outside every restricted role, so the agents it limits can't stop or replace it. Reads the host name of each connection (CONNECT, the TLS server name, the HTTP Host header) and never decrypts traffic. Writes an audit line per connection (user, host, bytes, time) under its own state directory. Asks the control plane only whether a role's node may connect to a host, with the agent's reason; it holds no credentials. Root applies the firewall rules it generates.

More: https://fleetlayer.ai/docs/egress.md.
