What the reporter sends
The reporter is a short shell script that you run on your own server or in your own pipeline. It sends software versions, and some details that identify the machine, to Alopex in one request. Alopex never logs in to your server.
Note
Servers and threats are in beta. They appear only on accounts where Alopex has switched them on.
The script is a single file of about 170 lines, and the full text is on the server page under The script. Read it before you run it. This page describes what it does, and the script is the authority if the two ever differ.
What it needs and does
- It needs
sh,awk,gzipandcurl. - It needs no root. It runs read-only commands and writes no files.
- It makes one
httpsrequest to the Alopex ping host and contacts nothing else, unless you setALOPEX_URLyourself. - It is run by cron on a host, or by your pipeline for an environment. Setup is in Add a server.
What it sends
| Data | What is sent | Where it comes from | Hosts only |
|---|---|---|---|
| Schema and reporter version | Two numbers that say which format and which script version this is. | The script. | No |
| Mode | host or environment, which is the Kind of the server. | The --environment option. | No |
| Host name | The machine's name. | The hostname command. | No |
| Operating system | Three values: ID, VERSION_ID and PRETTY_NAME. | /etc/os-release | No |
| Packages | The name, version and source package name of every installed package, and which package manager they came from (dpkg or apk). With dpkg, also the archive and archive component (such as main or universe) each came from, when apt knows, so Alopex can tell Ubuntu's own builds, which follow Ubuntu's support dates. | dpkg-query and apt-cache policy, or apk list -I | No |
| Programs | For each of php, nginx, mysql, mysqld, mariadb, mariadbd, postgres, psql, sqlite3 and node that the script finds: the program's name, its path, and the first line of its version output that contains a version number. | Running each program with -v or --version | No |
| Plesk version | The version number, when Plesk is installed. | /usr/local/psa/version | No |
| Addresses | The machine's global IP addresses. | ip -o addr show scope global | Yes |
| Plesk sites | The names of the sites Plesk hosts, when Plesk is installed. | plesk bin site --list | Yes |
The script looks for each program in every folder on PATH, plus /usr/local/sbin, /usr/local/bin, /usr/sbin and /sbin. It also looks for PHP under /opt/plesk/php/, Node under /opt/plesk/node/ and PostgreSQL under /usr/lib/postgresql/. Cron runs with a short PATH, which is why it adds those folders.
Alopex keeps only the public addresses from the list, and drops private and reserved ones. For a host it also records the address that the report arrived from.
What it does not send
The script does not send file contents, configuration, logs, users, passwords or environment variables. It sends only the data in the table above, and ALOPEX_TOKEN in the request header.
It does send data that is not a version: the host name, the program paths, the addresses and the Plesk site names. It reads three environment variables of its own, all optional for a dry run. ALOPEX_TOKEN authenticates the report. ALOPEX_URL changes where the report goes, and is filled in for you in the copy you download. ALOPEX_ROOT exists for tests.
To see the data before it leaves, run it with --dry-run. See Check it yourself.
The request
The script makes one request:
- Method and address:
POSTtohttps://et.alopex.uk/report. - Body: the report as JSON, compressed with gzip.
- Headers:
Content-Type: application/json,Content-Encoding: gzip, andAuthorization: Bearer <token>. - Time allowed: 30 seconds.
Alopex answers with a status and no body:
| Status | Meaning |
|---|---|
204 | The report was accepted. |
401 | The token does not match a server. |
403 | Servers are switched off for the account, or the account is suspended. |
413 | The body is larger than the first two limits below, or is not valid gzip. |
415 | The body was not sent as application/json. |
422 | The report is not valid, has more packages than the limit below, or its mode does not match the server's kind. |
429 | Too many requests. See the limits below. |
The script uses curl -f, so it prints an error and exits with a failure for any of the error statuses above.
Authentication
The token identifies the server. It starts with alx_, followed by 40 letters and digits. Alopex stores only a hash of it, so it is shown once, when you add the server or regenerate it. See Server settings.
The script reads the token from the ALOPEX_TOKEN variable and passes it to curl through a file descriptor rather than on the command line, so ps does not show it. The crontab holds the token in plain text, and while the script runs the token is in its environment, so the user who runs the job, and root, can read it. The script refuses to run if the variable is empty or contains anything other than letters, digits and underscores. Treat the token as a password. Anyone who has it can send a report for that server.
Limits
| Limit | Value |
|---|---|
| Request body, compressed | 512 KiB |
| Report after decompression | 4 MiB |
| Packages in one report | 20,000 |
| Programs in one report | 64 |
| Addresses kept from the report | 32 |
| Plesk sites kept | 2,000 |
| Reports per minute for one token | 10 |
| Reports per minute from one IP address | 60 |
| Downloads of the script per minute | 120 |
A report over the first three limits is refused. Over the limits on programs, addresses and sites, the report is trimmed: the extra ones are not kept. Over a rate limit, the request is refused with 429.
Schedule
A host runs the reporter hourly from cron, at a minute that Alopex chooses for it. An environment runs it whenever your pipeline does. A host that has not reported for 3 hours is marked as Stopped reporting. See About servers.
Check it yourself
Copy the SHA-256 hash from The script on the server page.
Download the script and compare. The install commands do this for you, and refuse to install a file whose hash does not match:
curl -fsS https://et.alopex.uk/reporter.sh -o alopex-reporter.sh echo "<sha256> alopex-reporter.sh" | sha256sum -c -
Read
alopex-reporter.sh.Print what it would send, without sending anything. The token is not needed:
sh alopex-reporter.sh --dry-run
Add
--environmentto see the report for an environment.
The printed JSON has the fields in the table above and nothing else. Run it as the same user as the cron job: what a command such as plesk prints can depend on the user.