Inferensys

Glossary

ROS 2 Security (SROS 2)

ROS 2 Security (SROS 2) is a framework for securing ROS 2 communications with authentication, encryption, and access control using DDS Security plugins and X.509 certificates.
Governance lead reviewing model governance framework on laptop, policy documents visible, executive office setup.
SECURITY FRAMEWORK

What is ROS 2 Security (SROS 2)?

ROS 2 Security, implemented through the SROS 2 utilities, is a comprehensive framework for securing communications within a ROS 2 robotic system.

ROS 2 Security (SROS 2) is the integrated security framework for the Robot Operating System 2 that provides authentication, encryption, integrity, and access control for all node-to-node communications. It leverages the underlying Data Distribution Service (DDS) Security specification, implementing it through a suite of command-line utilities and libraries that manage X.509 certificates and security policies. This transforms the default, open ROS 2 graph into a cryptographically secure network where every participant must prove its identity and is only permitted authorized interactions.

The framework operates by generating a Public Key Infrastructure (PKI) for the robotic system, where each node possesses a unique identity certificate. Security policies, defined in XML files, specify permissions—dictating which nodes can publish or subscribe to which topics, or call which services. At runtime, the DDS Security plugins enforce these policies, ensuring encrypted Transport Layer Security (TLS) channels and validating all actions against the access control lists. This enables secure multi-robot systems and is critical for deployment in safety-sensitive or adversarial environments.

ROS 2 SECURITY (SROS 2)

Core Security Mechanisms

ROS 2 Security, implemented through the SROS 2 utilities, provides a framework for securing ROS 2 communications with authentication, encryption, and access control using DDS Security plugins and X.509 certificates.

02

Encryption (Confidentiality)

All data transmitted between authenticated ROS 2 nodes is encrypted to ensure confidentiality. This protects sensitive sensor data, control commands, and system state from eavesdropping. SROS 2 leverages the DDS Security: Crypto plugin to perform transparent encryption and decryption of messages on topics and services. Common algorithms like AES-GCM are used, providing both encryption and integrity verification for the payload, securing data in transit across potentially untrusted networks.

03

Access Control (Permissions)

Fine-grained access control policies govern what actions an authenticated identity is allowed to perform. These policies are defined in XML files and specify permissions such as:

  • Publish/Subscribe to specific topics
  • Call/Provide specific services
  • Read/Write specific parameters For example, a navigation node may be permitted to subscribe to /odometry but not to /camera/image_raw. This principle of least privilege minimizes the impact of a compromised node by restricting its capabilities within the system.
04

Governance & Permission Documents

Security configuration is defined by two key XML documents. The Governance Document sets high-level security rules for an entire DDS Domain, specifying allowed security plugins and encryption algorithms. The Permissions Document is identity-specific, mapping a node's certificate to its exact set of allowed actions (topics, services). During startup, the DDS Security plugin validates the node's certificate and loads its corresponding permissions, enforcing the defined policy.

05

SROS 2 Command Line Tools

The sros2 utilities automate the complex process of generating and managing the security artifacts. Key commands include:

  • sros2 key generate: Creates a Certificate Authority (CA) and private keys.
  • sros2 key create: Issues identity certificates for nodes.
  • sros2 policy generate: Automatically generates permission policies by introspecting a running ROS 2 system. These tools abstract the underlying PKI (Public Key Infrastructure) complexity, making it practical to deploy security in real robotic systems.
06

Domain Isolation & ROS_DOMAIN_ID

A fundamental, non-cryptographic security mechanism is network segmentation using the ROS_DOMAIN_ID. Nodes with different domain IDs (0-232) operate in completely isolated communication graphs. This simple integer acts as a virtual network partition, preventing accidental or malicious cross-talk between independent robotic systems sharing the same physical network. It is a critical first layer of defense, often used in conjunction with cryptographic security for multi-robot or multi-tenant deployments.

SECURITY FRAMEWORK

How ROS 2 Security (SROS 2) Works

ROS 2 Security, implemented through the SROS 2 utilities, is a framework for securing ROS 2 communications with authentication, encryption, and access control using DDS Security plugins and X.509 certificates.

ROS 2 Security (SROS 2) is the security framework integrated into the Robot Operating System 2 that provides end-to-end protection for robotic communications. It leverages the underlying Data Distribution Service (DDS) Security specification to enforce authentication, data encryption, and fine-grained access control across the ROS 2 graph. This is achieved by generating and managing X.509 certificates and governance documents that define security policies for nodes, topics, services, and actions.

The SROS 2 command-line utilities (ros2 security) automate the creation of a Public Key Infrastructure (PKI) and the necessary security artifacts. At runtime, the DDS Security plugin within each ROS 2 node enforces the policies, ensuring only authorized nodes can join the secure domain and exchange protected messages. This framework is critical for production deployments where robotic systems must be resilient to eavesdropping, spoofing, and unauthorized command injection, especially in multi-tenant or safety-critical environments.

SROS 2 ENFORCEMENT TIERS

Security Configuration Levels

A comparison of the three primary security enforcement modes available in ROS 2 Security (SROS 2), detailing the scope of protection and the required configuration complexity for each.

Security Feature / AttributeEnforcement: DisabledEnforcement: PermissiveEnforcement: Strict

Authentication (Node Identity)

Encryption (Data in Transit)

Access Control (Permissions)

Cryptographic Material Required

None

X.509 Certificates & Keys

X.509 Certificates, Keys, & Governance/Permissions Files

Primary Use Case

Development / Debugging

Performance Profiling / Incremental Rollout

Production Deployment

Communication Overhead

< 1%

5-15% latency increase

10-25% latency increase

Configuration Complexity

None (Default)

Moderate (Identity only)

High (Full policy)

Protection Against Eavesdropping

Protection Against Spoofing

Protection Against Unauthorized Pub/Sub

ROS 2 SECURITY (SROS 2)

Implementation & Ecosystem

ROS 2 Security, implemented through the SROS 2 utilities, provides a framework for securing ROS 2 communications with authentication, encryption, and access control using DDS Security plugins and X.509 certificates.

01

DDS Security Integration

ROS 2 Security is built directly on the Data Distribution Service (DDS) Security specification (v1.1). This provides a standardized, middleware-level security model. The SROS 2 tools generate the necessary configuration files and credentials that enable DDS Security plugins (like RTI Connext DDS Secure or eProsima Fast DDS Secure) to enforce:

  • Authentication: Verifying the identity of nodes using X.509 certificates.
  • Encryption: Securing data in transit with cryptographic algorithms (e.g., AES-GCM).
  • Access Control: Governing which nodes can publish/subscribe to specific topics or call services based on permissions files.
02

Certificate Authority & Identity Management

SROS 2 establishes a Public Key Infrastructure (PKI) for the ROS 2 graph. A central Certificate Authority (CA) is created to sign certificates for all participants. Each ROS 2 node receives a unique identity comprising:

  • A private key (kept secure).
  • A signed identity certificate (proving its identity).
  • A permissions certificate (defining its allowed actions). This model allows for fine-grained identity-based security, where trust is rooted in the CA, and compromised nodes can be revoked by invalidating their certificates.
03

Governance & Permissions Files

Security policies are defined in two XML documents:

  • Governance File: Sets the global security rules for the domain, including the list of enabled security plugins (Authentication, Encryption, Access Control) and their properties (e.g., allowed cipher suites).
  • Permissions File: A node-specific rulebook that grants fine-grained access. It uses subject names from certificates to specify exact allowances, such as:
    • Publish to /cmd_vel
    • Subscribe to /scan
    • Call the /compute_path service SROS 2 utilities auto-generate these files from a high-level policy description, simplifying management.
04

Access Control Models

SROS 2 supports two primary models for defining node permissions:

  • Topic-Based Access Control: Permissions are granted based on ROS communication constructs (topics, services, actions). This is the most common model, mapping directly to the ROS graph.
  • Partition-Based Access Control: Permissions are granted based on DDS partitions—logical groups within a domain. This offers an alternative, DDS-native grouping mechanism that can be useful for certain architectural patterns. Permissions can specify allow or deny rules, enabling the implementation of least-privilege security principles where nodes only have the minimum access required for their function.
05

SROS 2 Command-Line Utilities

The sros2 package provides command-line tools to manage the security lifecycle:

  • sros2 keys create: Generates the root CA and key pairs.
  • sros2 keys generate: Creates identity and permission keys/certificates for a specific node or enclave.
  • sros2 distribution: Securely distributes keys and certificates to remote machines.
  • sros2 policy: Generates governance and permissions XML files from a YAML policy template. These utilities abstract the complexity of the underlying DDS Security configuration, making it operable for robotics engineers without deep PKI expertise.
06

Enclaves for Process Isolation

An enclave is a security context within a ROS 2 process. A single Linux process can host multiple nodes, each in its own enclave with distinct security credentials. This enables:

  • Secure composition: Multiple nodes with different security postures can run in one process, isolated by enclave boundaries.
  • Performance: Avoids the overhead of inter-process communication (IPC) for tightly coupled, trusted nodes.
  • Resource efficiency: Reduces memory and launch complexity compared to one-process-per-node. Enclaves are a key feature for balancing security granularity with system performance.
ROS 2 SECURITY (SROS 2)

Frequently Asked Questions

ROS 2 Security, implemented through the SROS 2 utilities, provides a framework for securing ROS 2 communications with authentication, encryption, and access control using DDS Security plugins and X.509 certificates.

ROS 2 Security (SROS 2) is the framework and set of utilities that implement authentication, encryption, and fine-grained access control for ROS 2 communications by leveraging the underlying Data Distribution Service (DDS) Security specification. It works by generating and managing a Public Key Infrastructure (PKI) of X.509 certificates, which are used to cryptographically verify the identity of nodes (authentication) and encrypt all network traffic (encryption). The SROS 2 tools (ros2 security) automate the creation of these certificates and the generation of security policy files that define which nodes are permitted to publish or subscribe to specific topics or call services, thereby enforcing a zero-trust security model within the ROS 2 graph.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.