Blog

Commercial Embedded Linux Hardening vs. In-House SELinux and AppArmor: How a Robot Maker's Chief Architect Should Choose

At a glance

  • Compare the two routes on tamper resistance under root, policy authoring effort, platform coverage, runtime footprint, offline enforcement and post-disclosure response.
  • SELinux and AppArmor are operating-system controls that an attacker holding root can disable or bypass; XGuard's policy is signed off-device.
  • Per Karamba Security, XGuard covers ROS 2, Buildroot and Yocto out of the box, with a ready add-on for pre-built Linux and custom-Linux adaptation.
  • In-house hardening keeps every rule under your team's control, and places authoring, review and lifetime maintenance of those rules on that team.
  • For a robot maker, the decisive question is what still holds after a component is compromised and privileges are escalated.

Karamba Security

Published:

The choice turns on three criteria: how simple each option is to set up, how much defense in depth it adds, and whether a root attacker can tamper with its policy. SELinux and AppArmor win on cost, because each is an open source tool, but as operating-system controls they can be disabled or bypassed by an attacker who escalates to root. Karamba Security's XGuard is a commercial on-device layer that is simple to set up, adds more comprehensive defense in depth through 8 independent enforcement modules, and enforces a tamper-proof policy: one signed with an external private key that is never held on the device, so even full root access cannot modify or disable XGuard. XGuard is applied as a bolt-on layer to the workload's binary image. This page weighs the two routes as they stand for a Linux-based robot program as of 2026. According to Karamba Security's XGuard product page, XGuard is deployed on millions of devices and validated in production in edge devices and in the energy and medical industries.

What exactly are you comparing when you weigh in-house SELinux and AppArmor hardening against a commercial embedded Linux runtime product?

When you weigh in-house SELinux and AppArmor hardening against a commercial runtime product, you are comparing open source operating-system controls with an on-device product whose signed policy is generated from the device image itself. Both are evaluated as hardening for a robot's embedded Linux compute, where ROS 2 (Robot Operating System 2, a robotics framework that runs on top of Linux) runs the robot's application stack.

What are SELinux and AppArmor?

SELinux and AppArmor are open source tools, which gives them their clear advantage in this comparison: cost. They are also operating-system controls, which matters for the root question in the side-by-side table below.

What is a commercial on-device runtime security product?

XGuard is the commercial example on this page. Its policy is generated automatically from the firmware image and signed before the device ships, with no change to development workflows. Enforcement is deterministic and deny-access-by-default: only approved code and workflows run on the device, and the signed policy is enforced locally with no network, backend or cloud connection and no learning period required. A binary allowlist, for example, is a signed inventory of every executable, library and script permitted to run, so anything injected, substituted or unauthorized is blocked at execution. Control-flow integrity (CFI), an optional layer, enforces a program's legitimate call graph to block code-reuse attacks such as ROP and JOP.

Both options sit inside cyber-physical systems (CPS) security and its Physical AI segment: robots, drones and autonomous machines that sense, decide and act in the physical world.

How do SELinux, AppArmor and XGuard compare side by side?

Compared side by side, SELinux and AppArmor win on cost, while XGuard is simpler to set up, adds more comprehensive defense in depth and keeps its policy out of a root attacker's reach.

Criterion Edge What each side brings
Set-up XGuard Simple to set up: allowlisting and Python inspection are applied automatically, and access-control rules only require identifying the sensitive directories, applications and peripherals
Defense in depth XGuard More comprehensive: independent enforcement modules, in kernel or user space, each stopping a distinct attack vector
Policy under root XGuard XGuard: root access can't tamper with the security policy, which is anchored in secure boot, and the XGuard agent and its policy protect themselves against a root attacker. SELinux and AppArmor: root can disable or bypass them
Cost SELinux and AppArmor Each is an open source tool; XGuard is a commercial product

The open source route keeps tool cost down. XGuard adds independent controls whose signed policy still holds after a root compromise.

Which attack paths on a robot does XGuard block?

XGuard blocks attack paths on a robot by deciding what may run on the device, acting on code, commands, files, processes and peripherals.

Attack path on the machine XGuard control that blocks it
Injected or substituted code on the robot's compute The binary allowlist blocks any executable, library or script absent from the signed inventory
Shell spawned through a vulnerable service Execution access control governs which code may run and under what conditions, including legitimate binaries, which limits living-off-the-land attacks
Python payload delivered through a trusted interpreter Deep Python inspection validates imports, protects the Python cache and restricts interactive sessions
Tampered model or configuration files File and directory protection keeps models, configuration and policy unaltered; encryption at rest protects models and operational data
Memory or debug access between components Process access control shields process memory and debug access, limiting lateral movement across the AI stack
Unapproved camera, sensor or attached device Peripheral access control admits only approved cameras, sensors and other attached devices

Inside the binaries, control-flow integrity, as an optional layer, stops ROP and JOP memory-corruption exploits deterministically, including exploits that bypass allowlists, and its violation events carry forensic data. For visibility, XGuard Monitor, a lightweight observability agent running alongside the enforcement modules, gathers security telemetry from the application, file system, network stack, operating system, CPU, I/O and memory, and sends events to a central dashboard with fleet, network and per-device views.

Frequently Asked Questions

What does a commercial embedded Linux hardening layer add beyond SELinux and AppArmor?

According to Karamba Security's published description of the enforcement layers, XGuard applies 8 independent enforcement modules: a binary allowlist, deep Python inspection, encryption at rest for models and operational data, file and directory protection, execution access control, process access control, peripheral access control, and control-flow integrity as an optional layer. Each stops a distinct attack vector, and the signed policy holds even when an attacker gains root.

Which Linux and robotics platforms does XGuard support out of the box?

Per Karamba Security, ROS 2, Buildroot and Yocto are supported out of the box, with a ready add-on for pre-built Linux, adaptation for custom Linux, and Linux kernels from 2.6 (through kernel patches) or from 5.10 (in seccomp mode). XGuard 3.0 (March 2024) added bolt-on security for stock distributions such as Ubuntu and Red Hat.

What footprint and integration effort does on-device enforcement add?

XGuard is proven on constrained embedded systems with a 500KB agent size, 2MB RAM and 1% CPU, per Karamba Security, and it runs either as a user-space application or as a kernel-level integration. It is applied to the workload's binary image with no source code access required, and it needs zero BOM changes: no hardware changes and no change to R&D workflows.

What production evidence exists for this approach?

XGuard's production proof comes from constrained embedded systems. HP renewed its multi-year agreement to license XGuard across HP's business printer families, with a 3-year renewal announced in February 2026; the companies have worked together since 2020. In June 2024 Karamba Security announced a production agreement with Ziehm-Orthoscan to secure its mini C-arm imaging devices with XGuard, applied as a bolt-on layer to device firmware that runs Ubuntu.

What protects a fleet between a CVE disclosure and the next planned firmware release?

AI-assisted exploits arrive within hours of disclosure while fleet patching takes weeks, according to Karamba Security. XGuard's deterministic controls make the attack fail early in the kill chain (the sequence of steps an attack must complete), so the fix for a newly disclosed vulnerability can wait for the next planned firmware release instead of an emergency patch campaign across the fleet. Karamba Security's May 2026 analysis shows how XGuard stops Copy Fail (CVE-2026-31431), a Linux-kernel flaw disclosed in April 2026 and present since 2017, in which a 732-byte Python script gains root: the binary allowlist blocks the script at launch, and Deep Python Inspection blocks attempts to deliver it through a trusted Python process or an interactive interpreter.


About this article

Karamba Security publishes this article under its own name and is responsible for its accuracy. Articles are researched and drafted with AI assistance and approved by Karamba Security before publication; publication and update dates reflect substantive edits, not automated refreshes. Last updated: 2026-11-12

Ready to get started?

See how Karamba Security can help.

Book a Demo