AvrelDocs

Security and data

This page is for the IT or security team that approves the collector. For the install itself, see Connect a site.

What the collector can and cannot do#

  • It makes read-only HTTP GET requests to the data source set with --source-url, and to nothing else on your network. For hydro-readonly that is /api/system/status and /api/sensors/latest. It never calls endpoints that probe or change hardware.
  • It runs under systemd as a throwaway unprivileged user (DynamicUser=yes), with no Linux capabilities and no way to gain them (CapabilityBoundingSet=, NoNewPrivileges=yes).
  • It cannot open device files, so it has no access to I2C, GPIO, serial or USB (PrivateDevices=yes, DevicePolicy=closed).
  • The rest of the file system is read-only to it, home directories are hidden, and it can write only to its queue folder (ProtectSystem=strict, ProtectHome=yes, StateDirectory=avrel-collector).
  • It can only open internet and local sockets (RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX), and is capped at 64 MB of memory and 10% of one CPU.
  • It accepts no inbound connections. You do not open any port or firewall rule.

The full service definition is written by deploy/collector/install.sh, and you can read it on the gateway with systemctl cat avrel-collector.

What it sends#

Every reading carries only:

  • your organization ID and the system ID;
  • the time, the collector version and the source type;
  • whether the controller answered, and the error if it did not;
  • each numeric sensor reading the controller reports, with its unit and the time it was measured. Readings older than 15 minutes are dropped, so stale values are never shown as current;
  • a random ID for the reading, so a reading sent twice is stored once;
  • the health of the gateway itself: uptime and a random boot ID, temperature, free memory and disk, supply alarms and voltages, battery and mains state, load, the name and state of the network interface it uses (for example wlan0, up), Wi-Fi signal strength, and its upload queue. After a start it also sends why it started. The full list is in Alerts and collector health.

It does not send files, logs, passwords, IP addresses, network names, hostnames or anything else from the gateway.

Alerts#

Alerts go out from the Avrel server, never from the site. Owners choose where they go: an HTTPS webhook on the public internet (signed with HMAC-SHA256, redirects not followed), a Slack incoming webhook, a PagerDuty integration key or email. Webhook addresses on private or internal networks are refused. An alert contains the organization and collector names, times, the likely cause with its readings, and the site checklist.

Keys#

  • Each collector has its own key. Avrel stores only a SHA-256 fingerprint and the first few characters, never the key itself.
  • A key can only send readings for its own organization. Avrel refuses readings for any other organization.
  • On the gateway the key is in /etc/avrel-collector/collector.env, readable by root only. systemd passes it to the service; the service cannot read the file.
  • You can revoke a key at any time in Edge > Collectors. Avrel refuses it from then on.

The collector download#

The installer downloads the collector from your own Avrel server and checks it against the SHA-256 checksum the server publishes at /api/collector/agent before installing it. A mismatch stops the install.

In transit and at rest#

  • Use an https:// server address so readings and sign-ins are encrypted in transit. Use plain http:// only inside a private network such as a VPN.
  • Each organization's systems, readings and keys are stored separately, and a key for one organization cannot write to another.
  • Only signed-in members of an organization can see its data. See Accounts and sign-in.
  • Avrel keeps raw readings for 30 days.

Photos and drawings you upload#

When an owner chooses Photo or PDF in the hardware window, the files go from the browser to Avrel and on to the Anthropic API (Claude), which reads them and returns a draft. Avrel does not store the files or the draft: only the hardware the owner then saves is kept, in their organization. Photos are made smaller in the browser before they are sent. Only owners of an organization can do this, and only for that organization.

Accounts and sign-in#

  • Invite only. Nobody can create an account without a single-use invite link from an owner. Links expire after 7 days and can be revoked.
  • Separation. Every page and API call checks that the signed-in person is a member of the organization. To anyone else, the organization does not exist. Owners and members have different rights; see Accounts and access.
  • Passwords are at least 10 characters and stored only as a salted scrypt hash. Avrel cannot see or recover them.
  • Sessions use a random token in an HttpOnly, SameSite=Lax cookie, marked Secure (and named with the __Host- prefix) over HTTPS. Avrel stores only a SHA-256 fingerprint of each session and invite token. Sessions last 30 days; signing out or changing your password ends them.
  • Cross-site requests that would change something are refused: Avrel checks the request's origin and accepts only JSON.
  • Repeated wrong passwords pause sign-in for that email (after 10 in 15 minutes) and for the sending address (after 50).
  • Collectors do not sign in. They use their own keys, which can only send readings and cannot read anything back.

AI assistants#

Owners can connect their own AI assistant with sign-in, or create agent keys for a CI pipeline, so they can use Avrel over MCP. See AI assistants (MCP).

  • Each key or connection belongs to one organization, acts as the person who created it, and stops working when they leave or when it is revoked. Avrel stores only a SHA-256 fingerprint of each key and token.
  • Sign-in uses OAuth 2.1 as the MCP standard sets out: PKCE is required, tokens are issued only for Avrel's own /mcp address, access tokens last one hour, and refresh tokens last 30 days and are replaced each time they are used. A reused refresh token or authorization code ends the connection, since it means a copy exists somewhere else.
  • Only an owner can approve a connection, on an Avrel page that names the app and the address it returns to, and that other sites cannot frame or submit for you. The page never offers more access than the assistant asked for.
  • A key is read-only unless the owner gives it propose or operate access. Hardware an assistant proposes is never saved until an owner loads and saves it.
  • Assistants never see members' email addresses, alert channel addresses, webhook URLs or any key, and cannot invite people or create keys.
  • The data an assistant reads goes to the AI provider that assistant uses, under your agreement with that provider.

Audit log#

Avrel records, for each organization, every change made by a person and every request made by an AI assistant or a key, including reads, and including the ones that were refused or failed. Sign-ins, sign-outs, failed sign-ins, password changes and assistant connections are recorded for each account too.

Each entry has:

  • when it happened (UTC) and what was done, with what it was done to;
  • who did it, and how: in the app, with a named key, or with a named sign-in connection;
  • whether it was done, refused (and why) or failed;
  • the facts needed to understand it, such as a release's version and commit, or how many components a hardware save had;
  • the address and browser it came from.

What is never recorded: passwords, keys, tokens, invite links, webhook addresses, alert channel addresses, the content of documents and photos you upload, or what someone typed into a failed sign-in.

Entries are append-only. Each one carries a SHA-256 hash of its contents and of the entry before it, so changing or removing any entry breaks the chain from that point on. The app checks the chain each time the log is opened and shows Chain intact or where it is broken. Entries are kept for as long as the organization exists.

Owners open the log in Settings > Audit log, filter it by people or assistants and by outcome, and export it as CSV with the hash of each entry, so the chain can be checked outside Avrel. Assistants cannot read the log.