blob: 2996954cf8a6e9f8ba53c1e9c042dc541988fd9f [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001module ietf-x509-cert-to-name {
2 namespace "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name";
3 prefix x509c2n;
4
5 import ietf-yang-types {
6 prefix yang;
7 }
8
9 organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
10 contact
11 "WG Web: <http://tools.ietf.org/wg/netmod/>
12 WG List: <mailto:netmod@ietf.org>
13
14 WG Chair: David Kessens
15 <mailto:david.kessens@nsn.com>
16
17 WG Chair: Juergen Schoenwaelder
18 <mailto:j.schoenwaelder@jacobs-university.de>
19
20 Editor: Martin Bjorklund
21 <mailto:mbj@tail-f.com>
22
23 Editor: Juergen Schoenwaelder
24 <mailto:j.schoenwaelder@jacobs-university.de>";
25 description
26 "This module contains a collection of YANG definitions for
27 extracting a name from a X.509 certificate.
28
29 The algorithm used to extract a name from a X.509 certificate
30 was first defined in RFC 6353.
31
32 Copyright (c) 2013 IETF Trust and the persons identified as
33 authors of the code. All rights reserved.
34
35 Redistribution and use in source and binary forms, with or
36 without modification, is permitted pursuant to, and subject
37 to the license terms contained in, the Simplified BSD License
38 set forth in Section 4.c of the IETF Trust's Legal Provisions
39 Relating to IETF Documents
40 (http://trustee.ietf.org/license-info).
41
42 This version of this YANG module is part of RFC XXXX; see
43 the RFC itself for full legal notices.";
44 reference
45 "RFC6353: Transport Layer Security (TLS) Transport Model for
46 the Simple Network Management Protocol (SNMP)";
47
48 revision 2013-03-26 {
49 description
50 "Initial revision.";
51 reference "RFC XXXX: A YANG Data Model for SNMP Configuration";
52 }
53
54 typedef tls-fingerprint {
55 type yang:hex-string {
56 pattern "([0-9a-fA-F]){2}(:([0-9a-fA-F]){2}){0,254}";
57 }
58 description
59 "A fingerprint value that can be used to uniquely reference
60 other data of potentially arbitrary length.
61
62 An tls-fingerprint value is composed of a 1-octet hashing
63 algorithm identifier followed by the fingerprint value. The
64 first octet value identifying the hashing algorithm is taken
65 from the IANA TLS HashAlgorithm Registry (RFC 5246). The
66 remaining octets are filled using the results of the hashing
67 algorithm.";
68 reference "SNMP-TLS-TM-MIB.SnmpTLSFingerprint";
69 }
70
71 identity cert-to-name {
72 description
73 "Base identity for algorithms to derive a name from a
74 certificate.";
75 }
76
77 identity specified {
78 base cert-to-name;
79 description
80 "Directly specifies the name to be used for the certificate.
81 The value of the leaf 'name' in 'cert-to-name' list is used.";
82 reference "SNMP-TLS-TM-MIB.snmpTlstmCertSpecified";
83 }
84
85 identity san-rfc822-name {
86 base cert-to-name;
87 description
88 "Maps a subjectAltName's rfc822Name to a name. The local part
89 of the rfc822Name is passed unaltered but the host-part of the
90 name must be passed in lowercase. This mapping results in a
91 1:1 correspondence between equivalent subjectAltName
92 rfc822Name values and name values except that the host-part
93 of the name MUST be passed in lowercase. For example, the
94 rfc822Name field FooBar@Example.COM is mapped to name
95 FooBar@example.com.";
96 reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANRFC822Name";
97 }
98
99 identity san-dns-name {
100 base cert-to-name;
101 description
102 "Maps a subjectAltName's dNSName to a name after first
103 converting it to all lowercase (RFC 5280 does not specify
104 converting to lowercase so this involves an extra step).
105 This mapping results in a 1:1 correspondence between
106 subjectAltName dNSName values and the name values.";
107 reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANDNSName";
108 }
109
110 identity san-ip-address {
111 base cert-to-name;
112 description
113 "Maps a subjectAltName's iPAddress to a name by
114 transforming the binary encoded address as follows:
115
116 1) for IPv4, the value is converted into a
117 decimal-dotted quad address (e.g., '192.0.2.1').
118
119 2) for IPv6 addresses, the value is converted into a
120 32-character all lowercase hexadecimal string
121 without any colon separators.
122
123 This mapping results in a 1:1 correspondence between
124 subjectAltName iPAddress values and the name values.";
125 reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANIpAddress";
126 }
127
128 identity san-any {
129 base cert-to-name;
130 description
131 "Maps any of the following fields using the corresponding
132 mapping algorithms:
133
134 +------------+-----------------+
135 | Type | Algorithm |
136 |------------+-----------------|
137 | rfc822Name | san-rfc822-name |
138 | dNSName | san-dns-name |
139 | iPAddress | san-ip-address |
140 +------------+-----------------+
141
142 The first matching subjectAltName value found in the
143 certificate of the above types MUST be used when deriving
144 the name. The mapping algorithm specified in the
145 'Algorithm' column MUST be used to derive the name.
146
147 This mapping results in a 1:1 correspondence between
148 subjectAltName values and name values. The three sub-mapping
149 algorithms produced by this combined algorithm cannot produce
150 conflicting results between themselves.";
151 reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANAny";
152 }
153
154 identity common-name {
155 base cert-to-name;
156 description
157 "Maps a certificate's CommonName to a name after converting
158 it to a UTF-8 encoding. The usage of CommonNames is
159 deprecated and users are encouraged to use subjectAltName
160 mapping methods instead. This mapping results in a 1:1
161 correspondence between certificate CommonName values and name
162 values.";
163 reference "SNMP-TLS-TM-MIB.snmpTlstmCertCommonName";
164 }
165
166 grouping cert-to-name {
167 description
168 "Defines nodes for mapping certificates to names. Modules
169 that uses this grouping should describe how the resulting
170 name is used.";
171 list cert-to-name {
172 key "id";
173 description
174 "This list defines how certificates are mapped to names.
175 The name is derived by considering each cert-to-name
176 list entry in order. The cert-to-name entry's fingerprint
177 determines whether the list entry is a match:
178
179 1) If the cert-to-name list entry's fingerprint value
180 matches that of the presented certificate, then consider
181 the list entry as a successful match.
182
183 2) If the cert-to-name list entry's fingerprint value
184 matches that of a locally held copy of a trusted CA
185 certificate, and that CA certificate was part of the CA
186 certificate chain to the presented certificate, then
187 consider the list entry as a successful match.
188
189 Once a matching cert-to-name list entry has been found, the
190 map-type is used to determine how the name associated with
191 the certificate should be determined. See the map-type
192 leaf's description for details on determining the name value.
193 If it is impossible to determine a name from the cert-to-name
194 list entry's data combined with the data presented in the
195 certificate, then additional cert-to-name list entries MUST
196 be searched looking for another potential match.
197
198 Security administrators are encouraged to make use of
199 certificates with subjectAltName fields that can be mapped to
200 names so that a single root CA certificate can allow all
201 child certificate's subjectAltName to map directly to a name
202 via a 1:1 transformation.";
203 reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNEntry";
204 leaf id {
205 type uint32;
206 description
207 "The id specifies the order in which the entries in the
208 cert-to-name list are searched. Entries with lower
209 numbers are searched first.";
210 reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNID";
211 }
212 leaf fingerprint {
213 type x509c2n:tls-fingerprint;
214 mandatory true;
215 description
216 "Specifies a value with which the fingerprint of the
217 certificate presented by the peer is compared. If the
218 fingerprint of the certificate presented by the peer does
219 not match the fingerprint configured, then the entry is
220 skipped and the search for a match continues.";
221 reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNFingerprint";
222 }
223 leaf map-type {
224 type identityref {
225 base cert-to-name;
226 }
227 mandatory true;
228 description
229 "Specifies the algorithm used to map the certificate
230 presented by the peer to a name.
231
232 Mappings that need additional configuration objects should
233 use the 'when' statement to make them conditional based on
234 the 'map-type'.";
235 reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNMapType";
236 }
237 leaf name {
238 when "../map-type = 'x509c2n:specified'";
239 type string;
240 mandatory true;
241 description
242 "Directly specifies the NETCONF username when the
243 'map-type' is 'specified'.";
244 reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNData";
245 }
246 }
247 }
248}