gRPC operations
gRPC operations are a set of remote procedure calls that enable clients to interact with Cisco IOS XR devices for configuration and operational data retrieval.
-
They support configuration retrieval and modification.
-
They provide access to operational and model data.
-
They allow CLI-based and structured output retrieval.
These operations are essential for automating and managing network devices programmatically using gRPC clients.
Manageability service gRPC operations
This table defines the manageability service gRPC operations for Cisco IOS XR.
|
gRPC Operation |
Description |
|---|---|
|
GetConfig |
Retrieves the configuration from the router. |
|
GetModels |
Gets the supported Yang models on the router |
|
MergeConfig |
Merges the input config with the existing device configuration. |
|
DeleteConfig |
Deletes one or more subtrees or leaves of configuration. |
|
ReplaceConfig |
Replaces part of the existing configuration with the input configuration. |
|
CommitReplace |
Replaces all existing configuration with the new configuration provided. |
|
GetOper |
Retrieves operational data. |
|
CliConfig |
Invokes the input CLI configuration. |
|
ShowCmdTextOutput |
Returns the output of a show command in the text form |
|
ShowCmdJSONOutput |
Returns the output of a show command in JSON form. |
gRPC operation to Get configuration
The gRPC example shows how a gRPC GetConfig request works for feature.
The client initiates a message to get the current configuration of running on the router. The router responds with the current configuration.
|
gRPC request (Client to Router) |
gRPC response (Router to Client) |
|---|---|
|
|
gRPC authentication modes
A gRPC authentication mode is a security mechanism for gRPC communication that
- provides different methods to verify the identity of clients and servers,
- supports both metadata-based and certificate-based approaches for authentication, and
- enables compliance with varying security requirements through configurable settings such as TLS, Mutual TLS, and non-TLS options.
This section details the authentication modes supported by gRPC to secure communication and ensure authorized access to services.
gRPC supports multiple authentication modes to secure communication between clients and servers. These modes ensure that only authorized entities can access gRPC services such as gNOI, gRIBI, and P4RT. Upon receiving a gRPC request, the device authenticates the user and performs authorization checks.
The following table lists the authentication types and their configuration requirements:
| Type |
Authentication Method |
Authorization Method |
Configuration Requirement |
Requirement From Client |
|---|---|---|---|---|
|
Metadata with TLS |
username, password |
username |
grpc |
username, password, and CA |
|
Metadata without TLS |
username, password |
username |
grpc no-tls |
username, password |
|
Metadata with Mutual TLS |
username, password |
username |
grpc tls-mutual |
username, password, client certificate, client key, and CA |
|
Certificate based Authentication |
client certificate's common name field |
username from client certificate's common name field |
grpc tls-mutual and grpc certificate authentication |
client certificate, client key, and CA |
Certificate-based authentication
In Extensible Manageability Services (EMS) gRPC, certificates play a vital role in ensuring secure and authenticated communication. The EMS gRPC utilizes these certificates for authentication:
/misc/config/grpc/ems.pem
/misc/config/grpc/ems.key
/misc/config/grpc/ca.cert
![]() Note |
For clients to use the certificates, ensure to copy the certificates from /misc/config/grpc/ |
Generation of certificates
These certificates are typically generated using a Certificate Authority (CA) by the device. The EMS certificates, including the server certificate (ems.pem ), public key (ems.key ), and CA certificate (ca.cert ), are generated with specific parameters like the common name ems.cisco.com to uniquely identify the EMS server and placed in the /misc/config/grpc/ location.
The default certificates that are generated by the server are Server-only TLS certificates and by using these certificates you can authenticate the identity of the server.
Usage of certificates
These certificates are used for enabling secure communication through Transport Layer Security (TLS) between gRPC clients and the EMS server. The client should use ems.pem and ca.cert to initiate the TLS authentication.
To update the certificates, ensure to copy the new certificates that have been generated earlier to the location and restart the server.
Custom certificates
If you want to use your own certificates for EMS gRPC communication, then you can follow a workflow to generate custom certificates with the required parameters and then configure the EMS server to use these custom certificates. This process involves replacing the default EMS certificates with the custom ones and ensuring that the gRPC clients also trust the custom CA certificate. For more information on how to customize the common-name , see Certificate Common-Name For Dial-in Using gRPC Protocol.
Configure authentication for gRPC services
This task explains how to configure different types of authentication for gRPC services, including TLS and AAA-based authentication.
Before you begin
Ensure that the router supports gRPC and that you have access to the CLI in configuration mode. TLS and AAA configurations must be available if required by the authentication method.
Procedure
|
Step 1 |
Configure your preferred authentication method:
|
|
Step 2 |
Verify the configuration. Example:
|
The gRPC service is configured with the selected authentication method and is ready to accept secure client connections.
What to do next
Verify the gRPC connection and monitor authentication logs to ensure proper access control.
gRPC servers with TLS version 1.3 support
gRPC servers with TLS version 1.3 support are network security solutions that
-
provide end-to-end encrypted communication between clients and servers,
-
use modern cryptographic protocols for stronger security and performance, and
-
allow administrators to configure minimum and maximum TLS versions for compliance and interoperability.
|
Feature Name |
Release Information |
Description |
|---|---|---|
|
gRPC Server TLS Version 1.3 Support |
Release 24.4.1 |
You can now enhance the security of your network connections with stronger protection against vulnerabilities by enabling TLS 1.3 support over gRPC services. This update improves performance with faster connection times and reduced latency by reducing the number of round trips required to establish a connection and removing outdated ciphers. Additionally, it complies with internal security mandates, providing a more robust and future-proof solution for your network management needs. Previously, gRPC server supported TLS version 1.2. The feature introduces these changes: CLI: |
Security benefits of TLS 1.3
The gRPC Remote Procedure Calls (gRPC) server Transport Layer Security (TLS) version 1.3 support is a security feature that:
-
Provides end-to-end communications security over networks
-
Prevents unauthorized access and eavesdropping
-
Protects against tampering and message forgery
The TLS private key is encrypted before being stored on the disk. For more details on SSL or TLS version certificates, keys, and communication parameters, see Manage certificates using Certz.proto.
Guidelines and limitations for TLS configuration
TLS version configuration limitations
-
Ensure that the
tls-min-versionvalue is not greater than thetls-max-versionvalue. -
Starting in Release 2.4.4.1, the
tlsv1-disablecommand is deprecated. Avoid using this command in new configurations. -
If you use the
tlsv1-disablecommand, do not use thetls-min-versionortls-max-versioncommands. -
If you use the
tls-min-versionandtls-max-versioncommands, do not use thetlsv1-disablecommand.
Best practice for disabling TLS 1.0
To disable TLS version 1.0, set the tlsv1-disable command. Alternatively, you can set the tls-min-version to a value greater than 1.0.
Configure gRPC TLS version
Configuring gRPC TLS version enables you to control which TLS protocol versions are permitted for secure gRPC communication between the router and clients. This can be important for maintaining compatibility and achieving desired security standards.
Before you begin
-
Verify that gRPC is enabled on the router.
-
Determine which TLS versions (1.0, 1.1, 1.2, or 1.3) your environment and clients require.
Procedure
|
Step 1 |
Configure gRPC TLS minimum, maximum, or both versions. Example:
|
|
Step 2 |
Verify the gRPC TLS minimum and maximum versions. Example:
The TLS 1.3 cipher suites are not configurable, they are either fixed or static. |
After completing this task, the router will use the specified TLS version for gRPC communication.
Example
For example, enabling only TLS 1.3 ensures that gRPC connections use the most secure protocol version supported by the router.
What to do next
After configuring the TLS version, verify the gRPC server status and test connectivity using a gRPC client to ensure compatibility.
SPIFFE ID-based authentication and authorization services for gRPC services
A SPIFFE ID (Secure Production Identity Framework for Everyone) based authentication and authorization service is a standardized framework that:
- enables secure identification and authorization of services communicating over gRPC,
- provides interoperability for authentication and access control across diverse and distributed environments, and
- leverages SPIFFE IDs and Verifiable Identity Documents (SVIDs) to enforce mutual TLS (mTLS) and authorization policies.
SPIFFE ID-Based authentication and authorization services for gRPC services uses SPIFFE IDs and SPIFFE Verifiable Identity Documents (SVIDs) to authenticate and authorize gRPC traffic. This is especially useful in distributed systems where workloads span multiple platforms.
-
Authentication: Performed via mutual TLS (mTLS) using SVIDs
-
Authorization: Based on mapping SPIFFE IDs to XR usernames
-
Identity format: SVIDs can be encoded as X.509 certificates or JWTs
-
Integration: Enables EMS and gRPC services to enforce access control
Workflow for SPIFFE ID-based authentication and authorization for gRPC services
Mapping initialization and configuration
-
The EMS starts searching for the spiffe-user-map.json file at the location /misc/config/grpc/gnsi/credentialz/spiffe-user-map.json.
-
If the file exists, it is parsed, and the mapping is stored globally in the aaa/auth package.
-
If the file does not exist or parsing is unsuccessful, the mapping will be empty.
-
The EMS registers with the configuration manager to receive updates for the
aaaconfiguration.
Authentication and authorization Flow
-
When processing requests in the Authentication interceptor, the spiffe-user mapping API checks for the SPIFFE ID mapping.
-
If the mapping exists, the API responds with the corresponding username.
-
If the mapping does not exist but the
aaaconfiguration exists, the API responds with the configured username. -
If neither the mapping nor the
aaaconfiguration is present, the API responds with an empty string. -
Upon a client connecting to the server, the server interceptor extracts the SPIFFE ID from the client's certificate and uses the mapping stored in the aaa/auth package to find the corresponding username.
-
The username identifies it and then includes the metadata into the context.
-
gRPC services that require XR Authorization will later verify the access rights for the username identified in the previous step when handling the request.
-
If the mapping is unsuccessful, the request is passed to the relevant service, such as gNMI, which then decides whether to grant or deny access based on its authorization requirements.
Authenticate and authorize gRPC service requests using the SPIFFE standard
This task describes how to authenticate and authorize gRPC service requests using the SPIFFE standard by mapping SPIFFE IDs to usernames and evaluating authorization policies.
Before you begin
Before authenticating and authorizing gRPC service requests using the SPIFFE standard, ensure the following prerequisites are met:
-
Enable mutual TLS authentication with the
tls-mutualcommand. -
Enable certificate authentication with the
certificate-authenticationcommand to facilitate SPIFFE ID recognition. For more information, see Configure authentication for gRPC services. -
Configure the gNSI Authz policy by setting the principal to the SPIFFE-ID for service-level authorization (gNSI AuthZ).
After establishing the connection, the gRPC server extracts the SPIFFE ID from the client's certificate.
To authenticate and authorize gRPC service requests using the SPIFFE standard, follow these steps:
Procedure
|
Step 1 |
Configure the username in the system. Example:
|
||
|
Step 2 |
Map the SPIFFE ID to a username using the aaa map-to username command. This command assigns a default username to any SPIFFE ID.
|
||
|
Step 3 |
Evaluate the client's SPIFFE ID against the service-level authorization policy (gNSI AuthZ). |
The gRPC service request is authenticated and authorized using the SPIFFE ID mapped to a system username and evaluated against the gNSI AuthZ policy.
Example
For example, after mapping the SPIFFE ID to the username cisco, the system uses this identity to authorize access based on the configured gNSI AuthZ policy.
What to do next
After completing this task:
-
Monitor gRPC logs to verify successful authentication and authorization events using SPIFFE IDs.

Feedback