STATERA Library · Series 08 · Volume 05 · Chapter 06 · EN
Source: https://github.com/Statera-Library/08_Vol_05_Robot_Middleware_and_ROS2/blob/main/Chapter_06_ROS2_Security/Chapter_06_ROS2_Security_EN.md

Volume 05 Robot Middleware and ROS2

06. ROS2 Security

06.01 SROS2 Security Architecture Overview

SROS2 is the security framework used to expose and manage the security capabilities of the ROS 2 communication architecture. Rather than introducing an independent security transport, SROS2 builds on the DDS Security standard beneath ROS 2 and provides ROS-oriented tools for identity creation, security configuration, access-control policy generation, and deployment of security artifacts. Its purpose is to make secure distributed robot communication practical within normal ROS 2 development and operation.

The architectural position of SROS2 is closely related to the layered structure of ROS 2. Application nodes communicate through client libraries such as rclcpp or rclpy, which interact with the ROS middleware interface and an underlying DDS implementation. Security enforcement ultimately occurs within DDS Security mechanisms, while SROS2 provides the tooling and conventions that allow ROS 2 developers to configure those mechanisms using ROS concepts such as nodes, topics, services, and actions.

A fundamental principle of this architecture is that every participating ROS 2 process should possess a verifiable digital identity. Identity is normally represented through certificates and private keys issued within a trusted public key infrastructure. When participants discover one another, authentication mechanisms can verify that they belong to the expected security environment before protected communication is established. This changes ROS 2 discovery from simple participant detection into authenticated distributed-system membership.

The trust foundation is commonly organized around a security enclave structure and a certificate authority. A certificate authority establishes the root of trust from which participant identities and permissions can be derived. Security artifacts are stored in a keystore and distributed to authorized robot computers or processes. Protecting this material is critical because possession of valid credentials may allow software to participate in otherwise protected ROS 2 communication domains.

Authentication alone does not determine what an authenticated participant is permitted to do. SROS2 therefore combines identity with authorization policies implemented through DDS Security access control. Permissions can constrain communication according to domains, topics, partitions, and other DDS entities. At the ROS 2 level, these controls can be mapped to application communication requirements so that a perception node, navigation component, actuator interface, or diagnostic process receives only the privileges required for its intended function.

This architecture supports the principle of least privilege. A camera-processing component, for example, may require permission to receive image data and publish perception results but should not automatically gain permission to publish velocity commands. Similarly, a monitoring application may need read access to diagnostics without authority to modify control parameters. Security policy therefore becomes part of the software architecture rather than merely a network-level mechanism surrounding an otherwise unrestricted ROS 2 graph.

Confidentiality and integrity protection form another major architectural layer. DDS Security cryptographic plugins can protect message exchanges so that unauthorized observers cannot easily inspect protected payloads and malicious modification can be detected. Depending on configuration, protection may be applied to communication data and selected protocol elements. Security design must therefore determine which information requires encryption, authentication, integrity protection, or combinations of these controls instead of treating every communication path identically.

SROS2 security is especially important because ROS 2 discovery creates a dynamic distributed graph. Nodes may start, stop, migrate between computers, or communicate across multiple network interfaces while DDS automatically discovers available participants and endpoints. Without security controls, this flexibility can enlarge the attack surface. With authenticated participants and explicit permissions, discovery remains dynamic while membership and communication privileges are constrained according to the deployed trust model.

A practical SROS2 deployment can therefore be understood as several cooperating security functions rather than a single encryption feature. Identity establishes who a participant is, authentication verifies that identity, access control determines what communication is allowed, cryptographic protection secures selected data exchanges, and governance rules define broader security behavior. Keystores, certificates, permissions, governance files, and runtime environment configuration collectively translate these functions into an operational ROS 2 system.

Security enclaves provide an important abstraction between application architecture and credential management. Instead of assuming that every ROS 2 node must always have an entirely independent security configuration, deployments can organize processes according to security boundaries appropriate to their execution model. The enclave concept is particularly useful when nodes are composed into common processes, deployed in containers, or grouped by subsystem, because the security boundary can reflect the actual operational trust boundary.

This also means that node architecture and process architecture must be considered together. ROS 2 composition can place multiple components inside one process for reduced communication overhead, but components sharing a process may also share security context. A system designer should therefore avoid assuming that logical node separation automatically provides an equivalent security boundary. Performance-oriented composition decisions and security-oriented isolation decisions must be evaluated together during system architecture design.

SROS2 should also be distinguished from complete robot cybersecurity. It protects important ROS 2 and DDS communication paths, but it does not independently secure the operating system, boot chain, container runtime, Ethernet infrastructure, wireless network, cloud API, firmware, physical interfaces, or application logic. A production robot therefore requires defense in depth in which SROS2 operates alongside host hardening, network segmentation, credential protection, secure update mechanisms, monitoring, and application-level validation.

Network segmentation remains valuable even when DDS Security is enabled. Safety controllers, perception computers, operator interfaces, fleet gateways, development machines, and external services may have very different trust requirements. VLANs, firewalls, DDS domain separation, routing controls, and SROS2 permissions can provide complementary boundaries. Network controls reduce reachable attack surfaces, while SROS2 provides identity-aware protection closer to the ROS 2 communication objects themselves.

Operational security also requires lifecycle management of credentials and policies. Certificates eventually require renewal or replacement, compromised credentials may need revocation, and software updates can introduce new topics or services requiring revised permissions. Consequently, SROS2 configuration should be managed as version-controlled deployment material associated with the software release. Security policies that exist only as manually maintained files on individual robots become difficult to audit and unreliable across a large fleet.

Security configuration inevitably interacts with performance. Authentication increases startup and discovery work, while encryption, integrity checking, key management, and protected communication introduce computational and bandwidth overhead. The impact depends on hardware, DDS implementation, payload size, message frequency, network topology, and protection configuration. High-rate cameras, LiDAR streams, control messages, and low-bandwidth diagnostics therefore should not be assumed to experience identical security costs.

For real-time robotic systems, this performance relationship becomes particularly important. SROS2 does not convert ROS 2 into a deterministic safety network, and cryptographic protection can add latency variation to communication paths. Time-critical control loops should therefore be benchmarked with the intended security configuration enabled rather than measured in an unsecured development environment. Security requirements, latency budgets, CPU utilization, message rates, and failure behavior must be evaluated as one integrated system problem.

Failure handling is another architectural consideration. A participant may fail authentication because credentials are missing, expired, corrupted, or inconsistent with the deployed trust chain. Communication may also fail because permissions deny an endpoint that application developers expected to exist. Secure ROS 2 systems should distinguish these failures from ordinary network faults and expose sufficient diagnostics for operators to determine whether communication disappeared because of connectivity, discovery, authorization, or credential problems.

For multi-robot systems, SROS2 becomes part of a broader trust architecture spanning individual robots, fleet infrastructure, and operational networks. Credentials and permissions should prevent one compromised or incorrectly configured participant from automatically obtaining unrestricted access to every robot. Namespace conventions alone are not security boundaries. Identity, authorization, network segmentation, domain architecture, and fleet-level credential management must work together when ROS 2 communication extends beyond a single machine.

The chapter structure places this overview before detailed treatment of certificate-authority setup, permission XML, DDS Security configuration, encryption performance, vulnerability analysis, network segmentation, audit logging, automated security testing, and IEC 62443 strategy. SROS2 architecture should therefore be understood as the foundation connecting these later mechanisms into one security model rather than as an isolated configuration procedure.

Ultimately, SROS2 changes the security question from whether a machine can reach the ROS 2 network to whether a cryptographically identified participant is trusted and explicitly authorized to perform a particular communication operation. This identity-centered model is essential for production robots because modern ROS 2 systems are distributed across processors, containers, networks, edge computers, and fleet services. Secure architecture must preserve ROS 2 flexibility while deliberately limiting trust and communication authority.

06.02 CA Setup and Certificate Generation [w/Code]

In SROS2, Certificate Authority setup establishes the root of trust used to authenticate ROS 2 participants and protect DDS-based communication. The CA issues cryptographic identities that allow nodes or security enclaves to prove their membership in a trusted robotic system. Because ROS 2 security ultimately relies on DDS Security, certificate generation is not merely an administrative task; it defines the identity foundation on which authentication, authorization, encryption, and secure discovery depend.

The SROS2 security environment is normally organized around a keystore that contains the cryptographic material required by secured ROS 2 processes. A keystore provides a structured location for certificates, private keys, governance information, permissions, and enclave-specific security artifacts. During development it may exist on one workstation, while production environments require controlled generation and distribution procedures so that sensitive private keys and signing credentials are not exposed unnecessarily.

Creating the keystore begins the Public Key Infrastructure, or PKI, lifecycle for the ROS 2 deployment. The security administrator defines where the keystore will reside and initializes the trust structure before generating participant identities. This structure should be treated as security-critical configuration rather than ordinary application data. Access permissions, backup procedures, storage protection, and ownership of the keystore must therefore be established before large numbers of robot identities are created.

At the center of this trust structure is the Certificate Authority, or CA. The CA possesses signing credentials that allow it to issue or validate certificates used by security enclaves. A certificate signed by the trusted authority establishes a cryptographic relationship between an identity and the security domain in which it operates. If the CA private key is compromised, an attacker may potentially create identities that appear legitimate, making protection of CA signing material one of the most important operational requirements.

SROS2 tooling simplifies the creation of this security infrastructure by providing ROS-oriented commands for keystore and enclave management. Instead of requiring developers to manually assemble every DDS Security artifact, the tools generate the expected directory structures and cryptographic files. This abstraction reduces configuration complexity while preserving the underlying DDS Security trust model. Developers should nevertheless understand what is generated because automated tooling does not eliminate the need for secure key handling.

A security enclave represents an execution identity within the SROS2 architecture. An enclave may correspond to a particular node, process, container, subsystem, or other operational security boundary depending on system design. When an enclave is created, SROS2 generates the security material necessary for that identity to participate in protected communication. The enclave name therefore becomes an important part of deployment architecture and should follow stable, predictable naming conventions.

Certificate generation typically creates an identity certificate together with an associated private key. The certificate contains information that can be presented to other DDS participants, while the private key must remain confidential to the entity that owns the identity. During authentication, cryptographic operations demonstrate possession of the corresponding private key without transmitting that key across the network. This enables participants to establish trust before application-level ROS 2 communication is accepted.

Identity certificates should not be confused with authorization permissions. A valid certificate answers the question of whether a participant possesses an identity trusted by the security infrastructure, but it does not automatically grant unrestricted communication rights. Permissions determine what the authenticated participant may publish, subscribe to, request, or otherwise access. Secure deployment therefore requires both correctly generated identities and appropriately restrictive authorization policies.

DDS Security also uses governance and permissions information alongside identity credentials. Governance configuration establishes security behavior for DDS domains and communication categories, while permissions documents describe operations available to particular identities. These artifacts are cryptographically signed so that unauthorized modifications can be detected. The resulting architecture creates a chain from the trusted authority through signed security documents to the participant that uses them at runtime.

Certificate generation must therefore be integrated with policy generation rather than treated as an isolated operation. A newly created enclave may possess valid cryptographic credentials but still require permissions corresponding to its ROS 2 interfaces. For example, a localization component may need to subscribe to sensor data and publish pose information, while an actuator controller requires a substantially different policy. Identity naming and communication policy should consequently be designed together.

Runtime configuration connects the generated security artifacts to ROS 2 execution. The system must know that security enforcement is enabled and which enclave or keystore context should be used by the process. If paths, enclave identities, environment settings, or security files are inconsistent, nodes may fail to authenticate or discover one another even though ordinary unsecured ROS 2 communication would have worked. Deployment automation should therefore validate security configuration before starting the complete robot stack.

File-system protection is especially important for private keys. Certificates are designed to be shared as part of authentication, whereas private keys represent secret credentials and should be accessible only to authorized processes and administrators. On production robots, operating-system permissions, protected storage, container isolation, secure boot mechanisms, or hardware-backed key storage may complement SROS2. Copying complete development keystores indiscriminately across robots can undermine otherwise strong cryptographic protection.

A development CA and a production CA should also be considered different operational assets. Development environments frequently require repeated creation and removal of identities, whereas deployed robots need controlled issuance and traceability. Separating these environments reduces the possibility that experimental credentials gain unintended production access. Production signing keys can additionally be maintained on more strongly protected systems rather than being permanently available on every engineering workstation or robot.

Large robot fleets require systematic certificate naming and ownership rules. Identities may need to represent robot units, computing modules, containers, fleet services, operator stations, or functional subsystems. Without a consistent convention, determining which certificate belongs to which operational component becomes difficult. A structured identity model also supports auditing because administrators can associate observed DDS participants with expected software functions and deployment locations.

Certificate lifecycle management continues after initial generation. Credentials can expire, systems can be replaced, private keys can become suspected of compromise, and authorization requirements can change as robot software evolves. Organizations therefore need procedures for certificate renewal, replacement, revocation, and redistribution. Certificate validity periods should reflect operational realities rather than being chosen solely to avoid maintenance, because excessively long-lived credentials increase exposure when keys are lost or compromised.

Key rotation provides another mechanism for limiting long-term credential exposure. New keys and certificates can be issued periodically or after security-sensitive events, while old credentials are removed from active deployment. Rotation procedures must be tested carefully because inconsistent credentials across distributed ROS 2 systems can prevent authenticated discovery. Fleet-scale systems therefore benefit from automated inventory and deployment mechanisms capable of tracking which security artifacts are installed on each robot.

Backup of CA and keystore material requires a different approach from ordinary source-code backup. Losing essential signing material may make future certificate management difficult, but casually replicating private keys creates additional compromise opportunities. Backups should therefore be encrypted, access-controlled, and stored according to the importance of the keys they contain. Recovery procedures should also be tested so that a security infrastructure failure does not leave deployed robots permanently unable to receive valid credentials.

Certificate generation should be reproducible at the process level without making secret keys reproducible themselves. Configuration, naming conventions, policy templates, scripts, and deployment procedures can be maintained under version control, while generated private keys should remain outside ordinary repositories. This separation enables engineers to reconstruct the security environment through controlled procedures without exposing sensitive cryptographic material through Git histories, build artifacts, container images, or shared development directories.

Containerized ROS 2 deployment introduces additional credential-management considerations. Embedding long-lived private keys directly inside reusable container images is undesirable because every image copy may contain the same secret. A stronger pattern is to provide required security artifacts to the container at deployment time through protected mounts or secret-management mechanisms. The container can then remain reproducible while the identity assigned to a particular robot or subsystem remains independently controlled.

Multi-robot systems increase the consequences of poor certificate architecture. Giving every robot identical credentials may simplify deployment, but it reduces the ability to identify, isolate, or revoke an individual compromised unit. Per-robot or appropriately scoped enclave identities provide finer-grained control. A fleet manager, robot controller, perception subsystem, and maintenance workstation can then possess distinguishable identities and permissions while remaining members of the same overall trust infrastructure.

Testing must verify more than successful secure communication. Engineers should confirm that valid participants authenticate correctly, invalid or unknown certificates are rejected, unauthorized operations are denied, corrupted security artifacts cause predictable failures, and missing credentials do not silently disable protection. Negative security tests are essential because a system that works with valid certificates has not yet demonstrated that its trust boundaries resist invalid participants.

Operational diagnostics should make certificate-related failures observable without exposing secret material. Logs can identify failed authentication, invalid permissions, certificate validity problems, enclave configuration errors, or inaccessible keystore files, but private keys and sensitive credential contents must never be written to diagnostic output. Clear error classification becomes especially valuable in fleets where an apparent ROS 2 discovery failure may actually originate from certificate or policy inconsistency.

The CA and certificate infrastructure ultimately establishes who is allowed to present a trusted identity inside the secured ROS 2 environment. Later SROS2 mechanisms build upon this foundation by defining what those identities may access and how their communication is cryptographically protected. A robust implementation therefore combines protected CA operation, controlled certificate generation, carefully scoped enclave identities, secure key distribution, lifecycle management, and systematic testing into one continuous security process.

06.03 Node Access Control Policy: Permission XML [w/Code]

Node-level access control in SROS2 determines which communication operations an authenticated ROS 2 participant is authorized to perform. Authentication establishes identity, while access control limits the authority associated with that identity. Permission policies therefore define whether a security enclave may publish or subscribe to topics, invoke or provide services, use actions, or participate within specified DDS domains. This separation of identity and privilege is fundamental to least-privilege ROS 2 security.

SROS2 access control is built on the DDS Security Access Control Plugin and represents authorization rules through signed permissions documents. At runtime, the DDS implementation evaluates these rules before allowing protected communication endpoints to interact. SROS2 provides ROS-oriented tooling and policy abstractions so developers can describe required communication using familiar ROS concepts while ultimately producing security artifacts compatible with the underlying DDS Security architecture.

The permissions XML document is a central artifact in this mechanism. It associates a participant identity with one or more authorization grants and defines the conditions under which communication is allowed or denied. A grant typically identifies the certificate subject to which it applies, establishes a validity interval, contains permission rules, and specifies a default behavior for operations not explicitly matched. The resulting document expresses a machine-enforceable security contract for the participant.

The subject identity in a permissions grant must correspond to the identity represented by the participant certificate. This binding prevents a permissions document intended for one trusted participant from being arbitrarily reused by another identity. Certificate naming and permission-policy design should therefore be coordinated from the beginning of the security architecture. Inconsistent identity conventions can create difficult deployment failures when certificates authenticate correctly but no appropriate authorization grant matches them.

Permission rules can constrain access according to DDS domains. This is useful when multiple ROS 2 systems, development environments, robots, or operational zones use different domain identifiers. A participant may be authorized to operate only within a designated domain rather than receiving access across the entire DDS environment. Domain restrictions complement network segmentation and ROS domain configuration by adding cryptographically enforced authorization at the middleware security layer.

Publish and subscribe permissions represent the most direct mapping to ROS 2 topic communication. A perception enclave may be allowed to subscribe to camera data and publish detected-object information, while being denied authority to publish actuator commands. Conversely, a motion controller may subscribe to approved trajectory information and publish control status. Designing these rules around actual data flows prevents every authenticated component from becoming an unrestricted publisher or subscriber within the ROS 2 graph.

Services require additional consideration because ROS 2 service communication is implemented using DDS entities beneath the ROS abstraction. Similarly, actions use multiple communication channels for goals, results, feedback, status, and cancellation behavior. Policy authors should therefore avoid assuming that one visible ROS interface always corresponds to one DDS topic. SROS2 tooling helps translate ROS-oriented policies into the underlying communication rules required for topics, services, and actions.

Access-control policy should begin from the intended node interface rather than from an unrestricted ROS graph. Engineers should identify what information a component consumes, what information it produces, which services it calls or provides, and which actions it participates in. These communication requirements can then become an explicit allowlist. Starting with broad permissions and attempting to remove unnecessary access later often leaves privileges that were never required by the software.

This approach implements the principle of least privilege. A localization node needs sensor observations and may publish pose estimates, but it normally has no reason to issue firmware-update commands. A diagnostic process may read system status while requiring no authority over motion commands. An AI inference node may consume images and publish inference results without being permitted to modify navigation parameters. Permission XML turns these architectural distinctions into enforceable middleware rules.

Allow and deny rules provide mechanisms for expressing policy boundaries. An allow rule identifies communication that the participant may perform, whereas a deny rule explicitly prevents matching operations. Policy behavior also depends on the configured default action when no rule matches. Security-sensitive systems generally benefit from a deny-oriented posture in which only required communication is permitted, because newly introduced or unexpected interfaces do not automatically receive authorization.

Wildcard expressions can simplify policy definitions but must be used carefully. A wildcard may conveniently authorize a family of related topics or namespaces, reducing repetitive configuration in large systems. However, overly broad patterns can unintentionally grant access to future topics that happen to match the same expression. Wildcards should therefore represent intentional security groupings rather than merely serving as a shortcut for avoiding detailed interface analysis.

Namespaces are useful for organizing multi-robot ROS 2 graphs, but namespace separation by itself is not an authorization mechanism. Robots such as /robot1\ and /robot2\ may have logically separated interfaces while still sharing network and DDS infrastructure. Permissions can reinforce this architecture by limiting a robot-specific enclave to communication associated with its intended interfaces. This becomes particularly important when many robots operate within shared fleet infrastructure.

Security enclaves provide the identity context against which these permissions are enforced. Multiple nodes may share an enclave when they intentionally belong to the same trust boundary, while security-sensitive components can be assigned separate enclaves with narrower privileges. The appropriate granularity depends on process composition, deployment architecture, performance, and threat assumptions. Combining unrelated components into one broadly privileged enclave can weaken the isolation that node-level policy is intended to provide.

Permissions documents must be protected against unauthorized modification. DDS Security therefore relies on cryptographic signatures so participants can verify that authorization information originates from a trusted authority and has not been altered. Editing an XML file after it has been signed is not equivalent to updating a valid policy; the modified artifact must pass through the appropriate signing process again. Policy generation and signing should consequently be managed as a controlled deployment workflow.

Governance and permissions play different but complementary roles. Governance configuration defines broader security requirements for DDS domains and communication categories, such as whether authentication or cryptographic protection is required. Permissions define what a particular authenticated identity may do within those constraints. A deployment can therefore have strong domain-level security requirements while assigning different communication privileges to perception, navigation, control, diagnostics, fleet services, and operator interfaces.

Policy versioning becomes important as ROS 2 software evolves. Adding a new topic, changing a namespace, introducing a service, or restructuring an action interface can cause existing permissions to reject communication that previously worked. Security policy should therefore be treated as part of the software interface contract and maintained alongside application changes. Version-controlled policy sources also make it possible to review when privileges were introduced, modified, or removed.

Automated policy generation can reduce manual errors, particularly in systems containing many nodes and interfaces. However, generating policies by observing an application that runs with unrestricted privileges can capture unnecessary or temporary communication. Generated policy should therefore be reviewed against the intended architecture rather than accepted automatically. The objective is not merely to reproduce everything observed during testing, but to authorize only the communication required for legitimate operation.

Testing should verify both permitted and prohibited behavior. Positive tests confirm that authorized publishers, subscribers, services, and actions continue to operate when SROS2 enforcement is enabled. Negative tests deliberately attempt operations that the participant should not perform and confirm that the middleware rejects them. Without negative testing, a policy may appear operationally correct while still containing excessive permissions that significantly weaken the security boundary.

Permission failures can resemble ordinary ROS 2 communication problems. A publisher may exist but fail to communicate with a subscriber, or a service client may be unable to reach an apparently available server because the security policy rejects the required DDS endpoint. Diagnostics should therefore distinguish discovery, network, authentication, and authorization failures. Clear security logging greatly reduces troubleshooting time when deploying complex permission sets across multiple computers or robots.

Access control also affects deployment automation. Each robot or subsystem must receive the correct certificate, private key, permissions, governance information, and enclave configuration as a consistent security package. Mixing credentials from one identity with permissions intended for another can cause authentication or authorization failure. Fleet deployment systems should therefore treat security artifacts as identity-specific configuration and verify their consistency before activating a software release.

In multi-robot environments, carefully scoped policies help contain compromised components. If a perception process on one robot is compromised, its permissions should not automatically allow it to command every robot or access unrelated fleet services. Per-robot, per-subsystem, or function-specific identities combined with restrictive policies reduce this potential blast radius. Network segmentation and DDS domain design can then provide additional layers around the SROS2 authorization boundary.

Permission XML should ultimately be viewed as an executable representation of the robot communication architecture. It translates architectural statements such as "perception may publish detections but cannot command motion" into rules enforced by the middleware. Effective SROS2 access control therefore requires more than correct XML syntax: it requires accurate interface modeling, stable identity conventions, least-privilege design, signed policy artifacts, controlled deployment, version management, and continuous positive and negative security validation.

06.04 DDS Security Plugin Configuration [w/Code]

DDS Security provides the middleware-level security foundation used by SROS2 to protect ROS 2 distributed communication. Instead of implementing authentication, authorization, and encryption directly inside ROS 2 application nodes, DDS Security defines standardized plugin interfaces that operate beneath the ROS middleware layer. Configuring these plugins determines how participants establish trust, enforce permissions, protect messages, and securely discover one another within a DDS domain.

The DDS Security architecture separates security responsibilities into several cooperating plugins. The Authentication Plugin verifies participant identities, the Access Control Plugin determines which DDS operations those identities may perform, and the Cryptographic Plugin protects communication through encryption and integrity mechanisms. Additional logging-related capabilities can support security auditing. SROS2 coordinates the configuration artifacts required by these mechanisms so ROS 2 applications can use them without directly implementing cryptographic protocols.

The Authentication Plugin establishes whether a discovered DDS participant represents a trusted identity. Participants present identity certificates issued by a trusted Certificate Authority and demonstrate possession of the corresponding private keys. The authentication process verifies certificate chains and cryptographic evidence before protected communication proceeds. This mechanism prevents simple network connectivity or DDS discovery alone from being sufficient to participate as a trusted member of the secured ROS 2 system.

Authentication configuration therefore depends on correctly deployed identity artifacts. Each security enclave requires an identity certificate, private key, and trusted CA certificate appropriate to its security environment. These files must correspond to one another and remain accessible to the DDS implementation at runtime. Incorrect paths, mismatched certificates and keys, invalid certificate chains, or expired credentials can cause authentication failure even when the underlying ROS 2 network and DDS discovery mechanisms are otherwise functioning correctly.

The Access Control Plugin operates after identity has been established and evaluates whether the authenticated participant is authorized to perform specific DDS operations. Its behavior is governed primarily by signed governance and permissions documents. Governance defines security requirements that apply broadly to domains and communication categories, while permissions associate participant identities with allowed or denied operations. Together they transform authenticated membership into controlled communication authority.

Governance configuration determines important domain-level security behavior. It can specify whether participant authentication is required and what protection should apply to discovery information or user data. Different communication categories may therefore receive different security treatment depending on operational requirements. Governance should be designed as a system-wide security policy because inconsistent expectations between participants can prevent communication or create unintended differences in protection across the distributed system.

Permissions configuration provides finer-grained authorization for individual identities or enclaves. Rules can restrict publication, subscription, domains, partitions, and communication associated with ROS 2 interfaces. SROS2 translates ROS-oriented policy definitions into artifacts understood by DDS Security. A control enclave can therefore receive authority required for motion interfaces while a diagnostic enclave receives only monitoring-related privileges. This realizes least privilege at the middleware communication boundary.

The Cryptographic Plugin provides confidentiality and integrity protection for DDS communication according to the configured security policy. Encryption can prevent unauthorized observers from interpreting protected payloads, while message authentication and integrity mechanisms help detect unauthorized modification. Cryptographic processing is applied within DDS rather than requiring each ROS 2 node to implement its own encryption scheme, allowing security behavior to remain consistent across compatible middleware participants.

Cryptographic configuration should reflect the sensitivity and timing characteristics of robot data. Control commands, operational credentials, maps, perception information, diagnostic data, and high-bandwidth sensor streams may have different confidentiality and integrity requirements. Applying maximum protection indiscriminately can introduce unnecessary computational and bandwidth cost, while insufficient protection can expose critical information. Security architecture should therefore connect data classification, threat analysis, and performance requirements to DDS protection settings.

DDS discovery also requires careful security treatment because discovery exchanges reveal participants and communication endpoints before normal application traffic begins. Secured discovery allows participants to authenticate one another and establish protected communication relationships dynamically. However, authentication handshakes and cryptographic operations add work to participant startup. Systems containing many nodes or robots should therefore evaluate discovery behavior under realistic secured deployment conditions rather than extrapolating from unsecured ROS 2 tests.

SROS2 runtime configuration connects ROS 2 processes to these DDS Security plugins and their artifacts. The runtime environment must enable ROS security, identify the appropriate keystore or enclave, and specify how failures should be handled. When security enforcement is enabled, missing or invalid artifacts should cause communication to fail rather than silently reverting to unsecured operation. This fail-secure behavior is important because an unnoticed fallback could leave a production robot communicating without the expected protection.

The relationship between SROS2 and the ROS middleware implementation must also be considered. ROS 2 can operate through different DDS-based RMW implementations, and the practical configuration details and supported security behavior may vary between middleware products and versions. Security validation should therefore be performed using the exact RMW implementation intended for deployment. A configuration verified with one DDS implementation should not automatically be assumed to behave identically with another.

Security plugin configuration should be integrated with ROS 2 launch and deployment architecture. Nodes running in separate processes may use distinct security enclaves, while composed nodes can share process-level security context depending on deployment design. Containers introduce another boundary because credentials and security artifacts must be supplied securely at runtime. The selected enclave structure should therefore reflect actual process isolation, application responsibilities, and desired least-privilege boundaries.

File and directory protection remains essential even though DDS Security provides strong communication protection. Identity private keys, CA material, permissions files, and other security artifacts should be readable only by authorized users and processes. Private credentials should not be embedded carelessly into source repositories, generic container images, or shared filesystem locations. Communication encryption cannot compensate for an attacker obtaining the private keys used to establish trusted identities.

Configuration consistency is particularly important in distributed robot systems. Certificates, governance rules, permissions, enclave names, domain identifiers, and runtime settings must form a coherent security configuration across communicating participants. A small mismatch can manifest as discovery failure, rejected endpoints, or apparently missing ROS 2 topics and services. Automated deployment should therefore validate artifact identity, signatures, paths, validity periods, and policy versions before starting secured applications.

Security logging provides the observability required to diagnose these failures. Authentication rejection, permission denial, invalid signatures, certificate expiration, cryptographic negotiation problems, and configuration errors should be distinguishable from ordinary packet loss or network connectivity failures. Logs should contain enough context to identify the security stage that failed while never exposing private keys or other sensitive credential material. Centralized logging becomes especially valuable in multi-robot deployments.

Performance evaluation must be performed with the complete DDS Security configuration enabled. Authentication affects participant startup and discovery, encryption consumes CPU resources, integrity protection adds processing, and security metadata can increase network traffic. The effect varies with message size, publication frequency, processor capability, middleware implementation, and network topology. Camera and LiDAR streams may exhibit different overhead characteristics from low-rate control or diagnostic messages.

Real-time ROS 2 systems require additional attention because average latency alone does not describe security impact. Engineers should measure latency distributions, jitter, CPU utilization, scheduling interference, discovery time, and communication behavior under load. Security operations should be tested together with PREEMPT_RT, executor configuration, memory management, and the intended DDS QoS policies when those mechanisms form part of the production architecture. Security and real-time performance cannot be validated independently.

Failure-mode testing should intentionally exercise incorrect configurations. Tests can use invalid certificates, mismatched keys, expired credentials, modified governance files, unauthorized publishers, incorrect enclave assignments, or incompatible security settings and verify that DDS Security rejects them predictably. These negative tests demonstrate that plugin enforcement actually protects the communication boundary instead of merely confirming that correctly configured participants can communicate successfully.

Multi-robot deployments increase both configuration scale and security consequences. Each robot may contain multiple enclaves while also communicating with fleet managers, operator stations, edge computers, and external gateways. Reusing unrestricted identities across the fleet simplifies configuration but increases the impact of compromise. Per-robot and function-specific identities, restrictive permissions, network segmentation, and appropriate DDS domain boundaries can collectively reduce the accessible attack surface.

Security configuration should therefore be maintained as version-controlled infrastructure associated with each software release. Policy sources, governance definitions, enclave mappings, deployment scripts, and validation procedures can be reviewed and reproduced, while private keys remain outside ordinary source control. Changes to ROS interfaces should trigger corresponding security-policy review because a newly introduced topic, service, or action may require explicit authorization before it can operate in the secured system.

DDS Security Plugin configuration ultimately transforms SROS2 policy and PKI artifacts into active runtime protection. Authentication determines who may establish trusted participation, access control determines what that identity may communicate, and cryptographic mechanisms determine how protected information is exchanged. Reliable ROS 2 security emerges when these plugins are configured as one coordinated system and combined with protected credentials, controlled deployment, diagnostics, performance validation, and continuous security testing.

06.05 ROS2 Communication Encryption Performance Impact

Source:https://dev.to/richard_minsoogo/robot-middleware-and-ros2-ch06-ros2-security-en-5gab