SEK SystemsDocs Open console

Getting started

Uninstall

Removing an agent has two parts: revoke it in the console, so its identity can never be used again, and remove the software from the host. Do both; the order does not matter.

1. Revoke the agent in the console

  1. Open Agents and the host.
  2. In the panel Revoke agent, enter a reason (for example "decommissioned").
  3. Click Revoke…, type the host name to confirm, and confirm with your security key.

Its credentials go on the revocation list, the connection is closed and open jobs are cancelled. The findings stay in the history but no longer count. This cannot be undone: enrolling the host again creates a new agent. You need the owner or admin role.

2a. Remove from Windows

In PowerShell as Administrator:

$slot = (Get-Content "C:\Program Files\SEC\current.txt").Trim()     # slot-a or slot-b
& "C:\Program Files\SEC\$slot\sec-agent.exe" uninstall

On an older installation without supervisor, the program is C:\Program Files\SEC\sec-agent.exe.

This removes the services (SEKSupervisor, SEKAgent and the older names), C:\Program Files\SEC, and also C:\ProgramData\SEC with the identity and the key in the TPM. Add --keep-state to keep C:\ProgramData\SEC (policy, identity and logs), for example when you reinstall right away.

2b. Remove from Linux (installation line)

The installation line has no uninstall command. Remove the files it created:

sudo systemctl disable --now sek-agent
sudo rm -f /etc/systemd/system/sek-agent.service
sudo rm -rf /etc/systemd/system/sek-agent.service.d
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/sec-agent /usr/local/bin/sec-supervisor
sudo rm -rf /opt/sec-agent /var/lib/sec-agent
sudo rm -f /etc/sec/policy.toml /etc/sec/tuf-root.json
sudo rmdir /etc/sec 2>/dev/null || true

/var/lib/sec-agent holds the agent's identity and keys. Remove it only after you revoked the agent, or when you do not want to reinstall with the same identity.

2c. Remove from Linux (package)

If the agent came from a SEK Systems package repository, remove it with the package manager (for example sudo apt-get remove sec-agent or sudo dnf remove sec-agent). The package stops and disables the service. It keeps /var/lib/sec-agent and /etc/sec/policy.toml, also on purge; remove them by hand after revoking.

Reinstalling

To reinstall a host that is still enrolled, simply run a new installation line: it keeps the identity. To start over with a new identity, revoke the agent, remove /var/lib/sec-agent (or C:\ProgramData\SEC), and install again.