Skip to content
Kandaro
Book a demo

EDR

Early access

Deploy to many machines

For more than a handful of machines, make one install token for all of them and let your deployment tool run the installer. The Console gives you a template for Ansible, cloud-init, Terraform or a machine image, filled in for your organisation.

What you get

  • An install token for many machines. One token, a limit on how many machines may use it, and an expiry date.
  • One secret per machine. The install token also opens the download, and nothing that opens Kandaro's downloads stays on the machine.
  • An installer that needs no keyboard. It reads the token from a file and asks nothing.
  • A signed package repository, for tools that install packages themselves.
  • Four templates, for Ansible, cloud-init, Terraform and machine images.

On a container platform, install the agent on the machines underneath. The templates are for Linux; Windows and Macs go out through your device management with the same kind of token (Install on Windows, Install on macOS).

The templates

On the Add machines page in the Console, open Deploy to many machines, pick your tool and copy or download its files. Kandaro fills in the settings that aren't secret: your Kandaro address, the download address, the update channel, whether Kandaro may act on the machines, and the fingerprint of the key that signs the installer. None of the files contains the token. Each one names the place where your own tool puts it.

TemplateUse it whenWhere the token goes
AnsibleYou manage your servers with Ansible and want the agent in your playbooks.The variable kandaro_agent_install_token, set from Ansible Vault or your secrets manager.
cloud-initNew virtual machines that read user data when they first start.The marked place in the user data, filled in by the tool that creates the machine.
TerraformYou create machines with Terraform and pass them user data.The sensitive variable kandaro_install_token, set from your secrets manager.
Machine imageYou build one image and start many machines from it.A file your provisioning writes on each machine’s first start. Never the image itself.

Every template runs the same small script on the machine. It downloads the installer, its signature and the signing key, opening the download with the install token, and runs nothing until the key has the expected fingerprint and has signed the installer. Then it installs the version your update channel names, after checking Kandaro's signature on that choice and on the package, with the token from a file only root can read, and deletes that file. No package repository and no key stays on the machine: the agent updates itself, in stages.

  • Ansible: a role and a playbook. The role skips machines that already have the agent, so you can run it again.
  • cloud-init: user data for a new virtual machine. At most providers any program on the machine can read user data, so give the token a short life and few uses.
  • Terraform: an example that builds the same user data and names no provider. Treat the state as secret, because it holds the token.
  • Machine image: a first-start job for an image you build yourself. The image carries the agent, installed but not enrolled, and the checked installer, never a token. The image build has no token, so it opens the download with your organisation's download key from a file only root can read, which the script deletes before the image is saved.

We wrote the templates without running them on your systems. Try one machine first, and revoke the token when the roll-out is done. If your tool isn't one of the four, the steps below work with any tool.

1. Make a token for many machines

Under SOC → Install tokens, make a token for many machines. It adds up to 1,000 machines and expires after 30 days unless you choose otherwise (at most 100,000 machines and 365 days). You also choose what happens to new machines:

  • an admin approves each one;
  • they are approved automatically; or
  • they are approved automatically and listed for review for 7 days. This is the default.

Anyone who holds the token can add a machine to your organisation until it expires or runs out. Keep it in your deployment tool's secret store, give it the smallest limit that fits, and revoke it when the roll-out is done.

2. Get the installer to each machine

Download the installer once and check its signature, as Install step by step describes. Then let your tool copy that checked file to each machine, or have each machine download it from https://dl.kandaro.com/install.sh and check it the same way, as the templates do. Don't pipe it from the network into a shell: the installer refuses that.

3. Run it with the token in a file

Have your tool write the token to a file only root can read, then run the installer with --no-repo and --token-file. The token also opens the download, so the machine needs no other secret. Without a terminal and without a token file, the installer stops instead of waiting for input.

On each machine, as root
# The token arrives as a file only root can read (mode 600), put there by your deployment tool
sudo bash install.sh --no-repo --token-file /root/kandaro-token

The other options work here too: --proxy, --response on, --version to install one exact version everywhere, and --dry-run to see the steps first (all options). On a machine that already has the agent, the installer changes nothing and reports success, so a tool can run it again safely.

Installing the package yourself

If your tool manages packages itself, add Kandaro's repository, its key and your organisation's download key the way the installer does (run it once without --no-repo and with --dry-run to see the exact files), and give the package its settings as variables when it is first installed:

VariableWhat it sets
KANDARO_ENDPOINTThe Kandaro address the agent connects to, for example agents.kandaro.com. The Console shows yours.
KANDARO_TOKEN_FILEA file only root can read that holds the install token. The package deletes it once the agent has its own copy.
KANDARO_RESPONSEon or off: whether Kandaro may act on the machine once an admin approves an action.
KANDARO_PROFILEserver or workstation, to choose the machine’s role yourself.
KANDARO_PROXYsystem, none or the address of a proxy.

Hold the package afterwards, as the installer does, so the operating system's updates don't race Kandaro's staged ones (Updates and versions).

Disk images

Don't put an enrolled agent in an image: every machine made from it would share one identity. Kandaro notices an identity in use from two places and flags the machine. Run the installer when each new machine starts for the first time instead. The machine image template above does this for you.

Check that they arrived

New machines appear under SOC → Machines within a minute, and the install wizard shows how many machines have joined with a token. On a machine that doesn't show up, run sudo kandaro-agent doctor (Troubleshooting).