Docs / Agent

Install the agent on Linux

One command installs the agent and enrolls it: on Ubuntu and Debian from the apt repository, so it upgrades through apt; anywhere else with systemd, as a checked binary that upgrades itself with signed releases.

Builds: linux-amd64, linux-arm64, linux-arm (ARMv7: Raspberry Pi 2 and later on a 32-bit OS) and linux-386. The apt repository has amd64, arm64 and armhf packages.

One-line install

Put central's enrollment token in a file only root can read (agents.enrollment_tokens in central's server.yaml), then:

curl -fsSL https://uptight.io/install-agent.sh | sudo sh -s -- \
  --central https://uptight.example.com --token-file /root/uptight-enroll.token

On Ubuntu and Debian it adds the apt.uptight.io source and its key, writes /etc/uptight/agent.yaml (mode 0600) and installs the uptight-agent package of the current release. Elsewhere (Rocky, RHEL, Fedora, Amazon Linux, Arch, SUSE…) it downloads the agent binary, refuses it unless its SHA-256 is the release's (the installer carries the checksums of the release's signed SHA256SUMS), and installs it as /usr/local/bin/uptight-agent with the systemd unit. The agent enrolls on its first push.

OptionDoes
--central URLCentral's address (central_url); https://
--token-file FILEThe enrollment token. --token TOKEN works too, but shows in ps and your shell history; so does UPTIGHT_ENROLLMENT_TOKEN (with sudo -E)
--tags role=web,team=paymentsStatic tags
--ca-file /etc/uptight/ca.pemTrust your own CA for central
--insecure-httpAllow an http:// central, such as a Docker trial's port 8090. Labs only
--method apt|binaryForce one method (default: apt on Ubuntu and Debian)
--version X.Y.ZAnother release than the current one. The binary method then checks its Ed25519 signature with the release keys, which needs OpenSSL 3 (--skip-signature installs it unchecked where there is no OpenSSL 3)
--upgrade-url URLDownload from your mirror; also written to agent.yaml for self-updates
--dry-runPrint what it would do, change nothing
--forceReplace an existing agent.yaml (kept as agent.yaml.bak)
--uninstallRemove the agent; agent.yaml and the agent's key stay

An existing agent.yaml is never replaced without --force, so running the installer again upgrades the agent and keeps its settings. Read the script first if you like: curl -fsSL https://uptight.io/install-agent.sh | less. To roll out to many hosts, deploy/ansible/uptight-agent.yml in the repository adds the same apt source and key with Ansible.

With apt, by hand (Ubuntu, Debian)

Add the apt repository, then:

sudo apt install uptight-agent

Edit /etc/uptight/agent.yaml (it is created root-only, mode 0600) and set the two required keys:

central_url: https://uptight.example.com
enrollment_token: "the token from central's server.yaml"
sudo systemctl restart uptight-agent
journalctl -u uptight-agent -f

Or write agent.yaml first: the package never replaces an existing file, so the agent starts enrolled. Once enrolled, the agent saves its own key in /var/lib/uptight-agent/agent.key and no longer needs the token.

With the binary, by hand (any distribution)

Download uptight-agent-<version>-linux-<arch> and check it (how), then:

V=0.14.0
curl -fsSLO https://downloads.uptight.io/uptight-agent/$V/uptight-agent-$V-linux-amd64
curl -fsSLO https://downloads.uptight.io/uptight/$V/uptight-agent.service
curl -fsSLO https://downloads.uptight.io/uptight/$V/agent.example.yaml
sudo install -m 0755 uptight-agent-$V-linux-amd64 /usr/local/bin/uptight-agent
sudo install -d -m 0755 /etc/uptight
sudo install -m 0600 agent.example.yaml /etc/uptight/agent.yaml     # then edit it
sudo install -m 0644 uptight-agent.service /etc/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable --now uptight-agent

Release binaries update themselves. A binary you build yourself with make build-agents does not, unless you build it with your own release key (make release-agents).

The unit logs to the journal (journalctl -u uptight-agent) and to /var/log/uptight-agent/uptight-agent.log. Rotate that file with logrotate's copytruncate; the deb ships a logrotate file that keeps 14 daily logs.

On NixOS

The flake has a NixOS module for the agent. Add the flake as an input (inputs.uptight.url = "github:uptight-io/uptight/<rev>", pinned to a release commit), then in the host's configuration:

{
  imports = [ inputs.uptight.nixosModules.uptight-agent ];
  services.uptight-agent = {
    enable = true;
    centralUrl = "https://uptight.example.com";
    enrollmentTokenFile = config.sops.secrets.uptight-enrollment-token.path;
    settings.tags.role = "web";
  };
}

Dry run first

uptight-agent test runs discovery once and prints what it would report, without contacting central:

sudo uptight-agent test -c /etc/uptight/agent.yaml

What Linux adds

Automatic upgrades

Central decides when each agent upgrades (Upgrade now in Settings → Fleet, or agent upgrade rings Team), and the order carries only a version number. auto_upgrade: true is the default; set it to false in agent.yaml to opt a host out.

The shipped uptight-agent.service allows the agent to replace /usr/local/bin/uptight-agent (ReadWritePaths=-/usr/local/bin) and restarts it after the update (Restart=always). sudo uptight-agent test prints whether upgrades work on this host, and if not, why (Fleet shows the same reason; for a binary install, test run from a shell cannot check that systemd runs the agent, and says so). Agents in Docker or Kubernetes and NixOS hosts are upgraded by rebuilding the image or with Nix.

A self-updating agent downloads <upgrade_url>/<version>/uptight-agent-<version>-linux-<arch> and the same name plus .sig. upgrade_url in agent.yaml wins over the URL the agent was built with (AGENT_UPGRADE_URL). Fleet shows manual, with the reason, when the agent cannot update itself:

ReasonFix
this build has no release keyInstall a release binary from downloads.uptight.io (or one built by make release-agents). make build-agents without RELEASE_PUBKEY builds agents that never update themselves.
no upgrade_url is set and this build has none built inSet upgrade_url in agent.yaml, or build with AGENT_UPGRADE_URL.
not run by a service manager that restarts it (…)Run it from the shipped unit. On Linux only systemd is recognized.
cannot write /usr/local/bin: read-only file system (…)Add ReadWritePaths=-/usr/local/bin to the unit (in deploy/uptight-agent.service from 0.10.0).
installed by Nix / running in a containerUpgrade with Nix, or rebuild the image.

A version that failed is not retried on that host for an hour. See an upgrade failed or rolled back.

Vulnerability remediation Team

Off by default, on two switches: central's vulnerability_remediation.enabled and this host's remediation.enabled in agent.yaml (settings). Ubuntu and Debian package installs of uptight-agent 0.10.0 or later only; on macOS, Windows, FreeBSD, NixOS, Docker images and plain binaries the agent reports remediation unsupported, with the reason.

Central's switch lives in the config repository: one file, git only (read-only in uptight-web), checked by uptight validate. It is not a server.yaml key.

vulnerability_remediation:
  enabled: true          # default false: no Fix now, and the API answers 409
  auto:                  # optional, off by default
    enabled: false
    min: kev             # kev (default): known exploited only; critical: and critical; high: and high
    envs: [staging]      # empty: every env

With auto.enabled: true the leader checks every 5 minutes, with the alerts, and queues one request per server for its open, not accepted, fix_available rows at or above min in envs. They are recorded as requested_by: auto. A CVE whose last fix on a server failed or was refused is not retried automatically for 24 hours (1 hour when the result was retryable). Fix now still works.

On the host:

  1. Central asks for package names and minimum versions, nothing else. The agent refuses unless remediation is on and every package is installed and allowed by your packages, deny and allow_kernel settings.
  2. The agent never runs apt. It writes the request to /var/lib/uptight-agent/remediate/request (root only), and the package's uptight-agent-remediate.path unit starts uptight-agent-remediate.service, which runs uptight-agent remediate-apply as root.
  3. That helper checks everything again, skips held packages, runs apt-get update, and installs each package's apt candidate only when it is newer than what is installed: apt-get install --only-upgrade --no-remove, keeping your configuration files. It refuses the whole request if apt would remove anything. It never reboots: the result says when /run/reboot-required asks for one.
  4. The result appears on the Security page and in the audit log, and the fixed rows clear once the agent reports its new package versions.

Limits on the host:

A request goes queued → sent → running → succeeded, failed or refused, or canceled before it was sent. One still queued after 24 hours, sent but not started after 15 minutes, or running after 2 hours fails with the reason.

Stop it on a host at any time with remediation.enabled: false or sudo systemctl disable --now uptight-agent-remediate.path. Check a host with sudo uptight-agent test, which prints Remediation: on, supported or why not. If Fix now is refused, see Fix now is refused.

Cloned machines and images

The agent id comes from /etc/machine-id. In image builds, truncate it (truncate -s 0 /etc/machine-id) and never bake /var/lib/uptight-agent into the image, so each instance enrolls as itself. A clone that gets 409 agent already enrolled needs a new machine id: rm /etc/machine-id && systemd-machine-id-setup.

Check it worked

Within a minute the host appears in the web UI under Inventory and on the dashboard, with CPU, memory, IO and disk checks. pm2 apps, and Java and Node processes that have run for 5 minutes (long_running), get checks of their own, named <host>:<kind>:<identity>. Only systemd units wait under Discovered for you to approve them. If it does not show up, see the agent does not show up.