NEWAI chat: ask your fleet anything, in plain language. Chat with your fleet Read more →

How to secure robots at the edge

A practical threat model for robots in the field: physical access, local networks, identity, detection, response, patching and what data leaves the machine.

Illustration for "Secure robots at the edge": a robot dog, the PhysicalFleet hub, with the label "unknown USB device blocked"

A server lives in a locked room. A robot lives in the room with everyone.

It stands on a factory floor during the night shift. It drives through a hospital corridor. It sits in a field where anyone with a pickup truck can reach it. It has USB ports, often a serial header on the board, and an SD card held in by friction. Most of the people who walk past it don't work for you or for your customer.

At Upswift we managed devices in places like that: casino floors, factories, a device mounted above swimming pools. The lesson that stuck with me is that edge security starts from a different assumption. You have to assume someone will touch the machine.

With AI-powered robots there's a second shift. These machines used to run fixed programs. Now they run learned models that decide many times a second from what they see, and that changes what an attacker wants. Taking the robot offline is crude. Changing what it does is worse, and much quieter. Swap the weights, shift a calibration file, nudge an input, and the robot keeps running, keeps reporting healthy, and does the wrong thing with confidence. Nothing crashes. So for a robot, integrity matters more than secrecy. You need to know the machine is still the machine you shipped.

This is how I'd approach it.

The short answer: Assume someone will touch the machine. Close the obvious doors (no password SSH, services on localhost, ROS 2 discovery limited to the machine, no privileged containers), give every robot its own identity with signed commands and outbound-only connections, and watch for logins, USB devices, new ports and changes to access, calibration and model files. Then patch through the same phased rollout as every other release.

Start with a threat model, a short one

You don't need a forty-page document. You need a list of who can reach the robot and how, so you can decide what to do about each.

  • Someone with physical access. A contractor, a visitor, a curious employee, a thief. They can plug in a USB stick, or a device that pretends to be a keyboard and types commands in a second. They can attach to a serial console. They can pull the SD card, read it on a laptop, change a file and put it back.
  • Someone on the local network. Your robot is on the customer's network, next to their laptops, their printers and whatever else is compromised there. Anything listening on 0.0.0.0 is reachable. So is a ROS 2 graph with default settings.
  • Someone attacking your path to the robot. Stolen engineer credentials, a fake robot trying to impersonate a real one, a captured command replayed against a different machine.
  • Known holes in what you ship. An old OpenSSL, a vulnerable library in the container base image, a kernel with a public exploit.
  • Your own team. Not malice. A hand edit to sshd_config during a late debugging session that never got undone. A debug server left listening.

I'd leave out of scope, for most teams, the attacker who rewrites firmware on your motor controllers. Not because it can't happen, but because you'll get further by closing the five doors above first.

Close the obvious doors on the machine

None of this needs a product. It needs an afternoon and discipline in your base image.

  • No passwords for SSH, and no default users. Keys only. Remove pi, ubuntu or whatever user came with the image and its known password. Better: don't run SSH on the network at all and reach the robot through an outbound relay (how that works).
  • Bind everything to localhost. The inference server, the visualization bridge, the notebook you use for calibration. They don't need the customer's network. If you need them remotely, forward to them.
  • Lock down the ROS 2 graph. By default, DDS discovery is open: anything on the same network and domain can see your topics and publish to them, including the one that moves the robot. If the whole graph runs on one computer, restrict discovery to the machine (ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST on Iron and later, ROS_LOCALHOST_ONLY=1 on older distributions). A unique domain ID is not security. If the graph spans machines, look at SROS2.
  • Don't run containers privileged out of habit. Map the exact devices you need (/dev/ttyUSB0, /dev/video0) instead of --privileged. Run the app as a normal user in the right groups.
  • Assume a pulled SD card is read. If your hardware can encrypt the data partition without someone typing a passphrase at boot, through a TPM or a secure element, do it. If it can't, make what's on the card worth little: per-robot credentials you can revoke, and no secret that works for the whole fleet.
  • Turn off what you don't use. The serial console in production images, Bluetooth, the HDMI login. Close the case. A tamper seal costs almost nothing and tells you if someone opened it.

Give every robot its own identity

This is the one decision that's hard to change later, so make it early.

  • Per-robot keys, generated on the robot. Not baked into the image, not shared. Each robot gets its own certificate. A compromised robot can then only act as itself. It can't read another robot's data or pretend to be one.
  • Revocation in seconds. When a robot is stolen or looks compromised, its certificate goes on a revocation list that takes effect right away, and its live connection is cut. "It'll expire in a year" is not revocation.
  • Every command signed and bound to one robot. The robot should only accept commands signed by your platform, and each command should name the robot it's for. A command captured from robot 12 then means nothing to robot 13.
  • Outbound only. The robot dials out over TLS. It accepts no inbound management connections, so there's no port to brute force.
  • One secure channel for app data. When an app on the robot needs to stream data back, a status feed or a stream of detections, send it through the agent's tunnel rather than having each app open its own connection with its own long-lived API key. Fewer secrets on the robot, fewer exits to watch.

Watch the machine: what each watchdog catches

Hardening reduces the chances. Detection tells you when it happened anyway. Here is what I'd watch on every robot, and why.

  • Logins on SSH, console and serial. Anyone getting a shell, and how. A console login on a robot that has never had a keyboard is not normal.
  • Brute-force bursts. Many failed logins in a short window. Usually from the local network, which tells you something about that network.
  • sudo and su. Who became root. In production, this should be rare and explainable.
  • New interactive shells. A shell started by something that never started shells before. Label your own remote terminal sessions so they're not noise.
  • USB plug and unplug. The most important one for physical access. A new keyboard on a robot is a strong signal: that's what a malicious USB device looks like to the kernel.
  • New listening ports. Something started a service. Sometimes it's an attacker. More often it's a debug server someone forgot, which you also want to know about.
  • Kernel modules loaded. Rare in normal operation, a classic way to hide.
  • File integrity of the files that grant access. sshd_config, authorized_keys, sudoers, and ld.so.preload, which is a quiet way to inject code into every process. Watch metadata, not contents, so nothing sensitive leaves.

Then add your own paths. This is where robot security differs from server security. Watch your calibration files, your safety limits config, and your model folder. If the weights or the camera extrinsics changed and no release did it, you want to know before the robot works a shift with them.

Two details that matter in practice:

  • Baseline first, then report changes. The first scan of a robot records what's there. Only changes after that raise anything. Otherwise day one is a thousand alerts and everyone mutes the channel.
  • Know which logs can be forged. On systems without journald, auth events come from files like /var/log/auth.log that a local user can write to with logger. Report those events, but don't take automatic action on them. Trust sources a normal user can't write, like journald entries from root or wtmp.

Respond, in stages

Detection without a response plan just means you find out sooner. Decide in advance what happens.

The responses I'd have available:

  • Alert. With what happened, on which robot, and what to do next.
  • Block USB devices not on an allow list. List the vid:pid of your cameras, serial adapters and anything else the robot legitimately uses. A new device is de-authorized before it can act.
  • End the session. An unexpected login or shell gets cut.
  • Quarantine. Cut open sessions, stop the agent's modules and allow only a small set of commands, so you can investigate and update the robot without leaving a working channel open.

Turn them on in stages. Run alert-only for a couple of weeks and learn what normal looks like on your fleet. Then enable USB blocking with an allow list. Then, if you want it, automatic quarantine on the critical signals: a new USB keyboard, a changed sshd_config, authorized_keys or sudoers, a login right after a brute-force burst.

Know the side effects. With automatic quarantine on, an admin editing sshd_config by hand quarantines the robot. That's good: it pushes those changes into releases, where they belong. Quarantine also stops the agent's own modules, watchdogs included, so it's a holding state, not a place to leave a robot for a month.

And keep the physical side in mind. A security response must not become a safety problem. Your security tooling should never be the thing that cuts power to an arm mid-motion. Decide what a compromised robot should do physically, a controlled stop for example, and make that your application's job, with its own safety logic.

One more opinion: an intrusion doesn't "recover" like a CPU spike. An issue opened by a watchdog should stay open until a person has looked and things have been quiet for a while, a day is reasonable. A reboot should not clear it.

Patch through the same pipeline as everything else

Run a vulnerability scanner on a stock Debian image and you can easily get a list of hundreds of CVEs. If you alert on all of them, nobody reads the alerts.

  • Alert on critical vulnerabilities that have a fix. That's the list someone can act on today. The rest is a report you review on a schedule.
  • Scan what's actually installed on each robot, not what you think the image contains. Robots that missed releases are exactly the ones with old packages.
  • Ship the fix as a normal release. A patched OpenSSL or a rebuilt container base image goes through the same phased rollout and health checks as a new model. A security update that breaks the control loop is still an outage, on a machine that moves. See the OTA checklist for what that pipeline needs.
  • Rebuild base images on a schedule. A lot of what scanners find in containers comes from the base layer, not from your code. Rebuilding monthly and rolling it out in phases fixes more than chasing single CVEs.

Be clear about what leaves the machine

Your customer's security team will ask: "What data leaves our site?" Have a one-page answer, and make sure it's true.

  • Config file contents stay on the robot. Names, versions and paths can leave. The contents don't. They often contain network details and credentials.
  • Secrets are masked on the robot in logs, events and crash reports, before anything is sent.
  • Camera pixels leave only when someone asks, for a snapshot or live view, and in incident recordings if you allow thumbnails. Make that switchable per customer.
  • Customers can disable the terminal and the camera on the robot itself, in a way your cloud can't override.

Privacy and security pull in the same direction here. The less leaves the robot, the less there is to leak.

Checklist

  • A one-page threat model: physical, local network, your access path, known vulnerabilities, your own team.
  • SSH keys only, no default users, ideally no SSH listening on the network.
  • Services bound to localhost. ROS 2 discovery restricted to the machine, or SROS2 across machines.
  • No privileged containers by default; apps not running as root.
  • Encrypted data partition where the hardware allows it; otherwise nothing fleet-wide on the card.
  • Unused interfaces off, serial console disabled, case closed and sealed.
  • Per-robot keys and certificates, revocable in seconds. Commands signed and bound to one robot.
  • Outbound-only connections and one tunnel for app data.
  • Watchdogs on logins, brute force, sudo, shells, USB, ports, kernel modules and file integrity, plus your calibration, safety and model paths.
  • Responses staged: alert, then USB allow list, then automatic quarantine on critical signals.
  • Vulnerability alerts limited to critical with a fix; patches shipped through phased rollouts.
  • A written, accurate answer to "what leaves our site?"

How PhysicalFleet handles it

The PhysicalFleet agent includes these watchdogs, with optional responses (block USB, end a session) and opt-in automatic quarantine. Every robot has its own keys and certificate, revocable within seconds, and every command is signed and bound to the device. The agent connects out only, offers a secure tunnel for app data, scans packages for vulnerabilities and alerts only on critical ones with a fix, which you then ship with our phased OTA. More on the security page.

If you've had to defend robots in places you couldn't lock, I'd love to hear what worried you most.

Common questions

How do I secure ROS 2 on a robot?

If the whole graph runs on one computer, restrict discovery to that machine with ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST on Iron and later, or ROS_LOCALHOST_ONLY=1 on older distributions. By default, anything on the same network and domain can see your topics and publish to them, including the one that moves the robot. A unique domain ID is not security, and if the graph spans machines, look at SROS2.

Can someone hack a robot through its USB port?

Yes. A device that pretends to be a keyboard can type commands in about a second. Watch USB plug events, treat a new keyboard on a robot as a strong signal, and block devices that aren't on an allow list of the vendor and product IDs your robot actually uses.

What should a robot security threat model include?

Five groups: someone with physical access, someone on the local network, someone attacking your path to the robot, known vulnerabilities in what you ship, and your own team's forgotten changes. One page is enough. For a robot, integrity matters more than secrecy, because changed weights or calibration make it do the wrong thing while it still reports healthy.

How should I handle vulnerability scan results for robots?

Alert only on critical vulnerabilities that have a fix, and review the rest on a schedule. Scan what's actually installed on each robot, since the robots that missed releases have the oldest packages. Ship the fixes through the same phased rollout as any other release, because a patch that breaks the control loop is still an outage.

What data should leave a robot at a customer site?

As little as possible, and you should be able to describe it on one page. Config file contents stay on the robot, secrets are masked before logs leave, and camera pixels leave only on request or in incident recordings the customer allowed. Customers should be able to turn off terminal and camera access on the robot itself.

#robot security#edge security#threat model#intrusion detection#USB security#vulnerability management#ROS 2
Amit EzerCo-founder, PhysicalFleet

From the lab bench. To the entire fleet.

Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.

Free for up to 3 machines · Then pay as you go