The netconf authorization-rule command configures a NETCONF authorization rule for operations and data nodes.
The undo netconf authorization-rule command deletes a NETCONF authorization rule.
No NETCONF authorization rule is configured by default.
netconf authorization-rule rule-name { { deny { rpc-operation rpc-oper-name | schema-path data-node-path } } | { permit { rpc-operation rpc-oper-name | schema-path data-node-path access-operation { read | write | execute } * } } } [ description description-text ]
undo netconf authorization-rule rule-name
Parameter | Description | Value |
---|---|---|
rule-name |
Specifies the name of a NETCONF authorization rule. |
The value is a string of 1 to 15 case-sensitive characters, and it cannot contain spaces. When quotation marks are used around the string, spaces are allowed in the string. |
deny |
Indicates that a NETCONF authorization rule is rejected. |
- |
rpc-operation rpc-oper-name |
Specifies remote procedure call (RPC) operations for NETCONF authorization. |
The value is a string of 1 to 255 characters, and it cannot contain spaces. |
schema-path data-node-path |
Specifies the path of a NETCONF authorization node. |
The value is a string of 1 to 255 characters starting with a slash (/), and it cannot contain spaces. |
permit |
Indicates that the NETCONF authorization rule is permitted, show as Table 1. |
- |
access-operation |
Indicates an operation allowed by a user. |
- |
read |
Indicates the read permission. |
- |
write |
Indicates the write permission. |
- |
execute |
Indicates the execute permission. |
- |
description description-text |
Specifies the description of a NETCONF authorization rule. |
A question mark (?) is not supported. The ASCII codes ranging from 0-31 or 127-255 are not supported. The value is a string of 1 to 63 characters. When quotation marks are used around the string, spaces are allowed in the string. |
Usage Scenario
After a NETCONF session is set up using Secure Shell (SSH), all SSH users can manage session-related devices, which poses security risks. To resolve this problem, run the netconf authorization-rule command to configure a NETCONF authorization rule. NETCONF authorization allows you to authorize specific users to perform NETCONF operations and access NETCONF resources. After NETCONF authorization is configured, run the display netconf authorization command to view related information.
Set of protocol operations that the server supports are as follow.
Prerequisites
To enable a NETCONF component, run the snetconf server enable or protocol inbound ssh port 830 command.
To create a task group, run the task-group task-group-name command.
<HUAWEI> system-view [~HUAWEI] aaa [*HUAWEI-aaa] user-group tg1 [*HUAWEI-aaa-user-group-tg1] netconf authorization-rule rule1 deny rpc-operation edit-config description deny edit-config
<HUAWEI> system-view [~HUAWEI] aaa [*HUAWEI-aaa] task-group tg1 [*HUAWEI-aaa-task-group-tg1] netconf authorization-rule rule2 permit rpc-operation get description permit get operation
<HUAWEI> system-view [~HUAWEI] aaa [*HUAWEI-aaa] task-group tg1 [*HUAWEI-aaa-task-group-tg1] netconf authorization-rule rule3 permit schema-path /snmp access-operation read write execute description permit snmp