Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / o-ran / ru-fh / o-ran-usermgmt@2022-08-15.yang
1 module o-ran-usermgmt {
2   yang-version 1.1;
3   namespace "urn:o-ran:user-mgmt:1.0";
4   prefix "o-ran-usermgmt";
5
6   import ietf-netconf-acm {
7     prefix nacm;
8     reference
9       "RFC 8341: Network Configuration Access Control Model";
10   }
11
12   import o-ran-wg4-features {
13     prefix "feat";
14   }
15
16   organization "O-RAN Alliance";
17
18   contact
19     "www.o-ran.org";
20
21   description
22     "This module defines the user management model for the O-RAN Equipment.
23
24     Copyright 2019 the O-RAN Alliance.
25
26     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
27     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36     POSSIBILITY OF SUCH DAMAGE.
37
38     Redistribution and use in source and binary forms, with or without
39     modification, are permitted provided that the following conditions are met:
40
41     * Redistributions of source code must retain the above copyright notice,
42     this list of conditions and the above disclaimer.
43     * Redistributions in binary form must reproduce the above copyright notice,
44     this list of conditions and the above disclaimer in the documentation
45     and/or other materials provided with the distribution.
46     * Neither the Members of the O-RAN Alliance nor the names of its
47     contributors may be used to endorse or promote products derived from
48     this software without specific prior written permission.";
49
50   revision "2022-08-15" {
51     description
52       "version 10.0.0
53
54       1) introduced SHARED-ORU-MULTI-OPERATOR feature.";
55
56     reference "ORAN-WG4.M.0-v10.00";
57   }
58
59
60   revision "2021-12-01" {
61     description
62       "version 1.3.0
63
64       1) typographical corrections in descriptions";
65
66     reference "ORAN-WG4.M.0-v01.00";
67   }
68
69   revision "2020-12-10" {
70     description
71       "version 1.2.0
72
73       1) updated description for enabled leaf";
74
75     reference "ORAN-WG4.M.0-v01.00";
76   }
77
78   revision "2019-07-03" {
79     description
80       "version 1.1.0
81
82       1) change name leaf to type nacm:user-name-type
83       2) added account-type to qualify when password is required ";
84
85     reference "ORAN-WG4.M.0-v01.00";
86   }
87
88   revision "2019-02-04" {
89     description
90       "version 1.0.0
91
92       1) imported model from xRAN
93       2) changed namespace and reference from xran to o-ran";
94
95     reference "ORAN-WG4.M.0-v01.00";
96   }
97
98   typedef password-type {
99     type string {
100       length "8..128";
101       pattern "[a-zA-Z0-9!$%\\^()\\[\\]_\\-~{}.+]*" {
102         error-message "Password content does not meet the requirements";
103       }
104     }
105     description
106       "The password for this entry. This shouldn't be in clear text
107        The Password must contain at least 2 characters from
108        each of the following groups:
109        a) Lower case alphabetic (a-z)
110        b) Upper case alphabetic (A-Z)
111        c) Numeric 0-9
112        d) Special characters Allowed !$%^()[]_-~{}.+
113        Password must not contain Username.";
114   }
115
116   grouping user-list {
117     description "a user list grouping";
118     list user {
119       key "name";
120       description
121         "The list of local users configured on this device.";
122       leaf name {
123         type nacm:user-name-type;
124         description
125           "The user name string identifying this entry.
126
127           NOTE: o-ran-usermgmt:user-profile/user/name is
128           identical to nacm:nacm/groups/group/user-name
129           but the current schema is preserved for backwards
130           compatibility.";
131       }
132       leaf account-type {
133         type enumeration {
134           enum PASSWORD {
135             description "the user-name is for password based authentication";
136           }
137           enum CERTIFICATE {
138             description "the user-name is for certificate based authentication";
139           }
140         }
141         default "PASSWORD";
142         description "the account type";
143       }
144
145       leaf password {
146         nacm:default-deny-all;
147         type password-type;
148         description
149           "The password for this entry.
150
151           This field is only valid when account-type is NOT set to CERTIFICATE,
152           i.e., when account-type is NOT present or present and set to
153           PASSWORD.";
154       }
155       leaf enabled {
156         type boolean;
157         description
158           "Indicates whether an account is enabled or disabled.
159
160            A NETCONF Server shall reject a configuration that attempts to
161            enable a Password account for an account where the password leaf
162            is not configured.
163
164            This validation statement is included in the YANG description and
165            not in a MUST statement to preserve backwards compatibility.";
166       }
167       leaf-list sro-id {
168         if-feature feat:SHARED-ORU-MULTI-OPERATOR;
169         type string;
170         description
171           "An optional list if Shared Resource Operator identities associated with the
172           user-account. Used to realize enhanced access privileges in a shared O-RU.
173           When an sro-id is configured in the O-RU, the O-RU shall
174           implement additional sro-id based NETCONF access control
175           as specified in O-RAN.WG4.MP.0-v10.00.
176           The O-RU does not further interpret the specific value of sro-id.";
177       }
178     }
179   }
180
181   container users {
182     must "user/enabled='true'" {
183       error-message "At least one account needs to be enabled.";
184     }
185     //TAKE NOTE - any configuration with zero enabled users is invalid.
186     //This will typically be the case when using a simulated NETCONF Server
187     //and so this constraint should be removed when operating in those scenarios
188
189     //The config data base of the O-RAN equipment should ensure that the user
190     //default account is enabled on factory restart
191
192     description "list of user accounts";
193     uses user-list;
194   }
195
196   rpc chg-password {
197     description "the RPC used to change a password";
198     nacm:default-deny-all;
199     input {
200       leaf currentPassword {
201         type password-type;
202         mandatory true;
203         description
204           "provide the current password";
205       }
206       leaf newPassword {
207         type password-type;
208         mandatory true;
209         description
210           "provide a new password";
211       }
212       leaf newPasswordConfirm {
213         type password-type;
214         mandatory true;
215         description
216           "re-enter the new password ";
217       }
218     }
219     output {
220       leaf status {
221         type enumeration {
222           enum "Successful" {
223             value 1;
224             description "change password operation is successful";
225           }
226           enum "Failed" {
227             value 2;
228             description "change password operation failed";
229           }
230         }
231         mandatory true;
232         description
233           "Successful or Failed";
234       }
235       leaf status-message {
236         type string;
237         description
238           "Gives a more detailed reason for success / failure";
239       }
240     }
241   }
242
243 }