roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 1 | module ietf-ssh-common { |
| 2 | yang-version 1.1; |
| 3 | namespace "urn:ietf:params:xml:ns:yang:ietf-ssh-common"; |
| 4 | prefix sshcmn; |
| 5 | |
| 6 | import iana-ssh-encryption-algs { |
| 7 | prefix sshea; |
| 8 | reference |
| 9 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 10 | } |
| 11 | |
| 12 | import iana-ssh-key-exchange-algs { |
| 13 | prefix sshkea; |
| 14 | reference |
| 15 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 16 | } |
| 17 | |
| 18 | import iana-ssh-mac-algs { |
| 19 | prefix sshma; |
| 20 | reference |
| 21 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 22 | } |
| 23 | |
| 24 | import iana-ssh-public-key-algs { |
| 25 | prefix sshpka; |
| 26 | reference |
| 27 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 28 | } |
| 29 | |
| 30 | import ietf-crypto-types { |
| 31 | prefix ct; |
| 32 | reference |
| 33 | "RFC AAAA: YANG Data Types and Groupings for Cryptography"; |
| 34 | } |
| 35 | |
| 36 | import ietf-keystore { |
| 37 | prefix ks; |
| 38 | reference |
| 39 | "RFC CCCC: A YANG Data Model for a Keystore"; |
| 40 | } |
| 41 | |
| 42 | organization |
| 43 | "IETF NETCONF (Network Configuration) Working Group"; |
| 44 | |
| 45 | contact |
| 46 | "WG Web: https://datatracker.ietf.org/wg/netconf |
| 47 | WG List: NETCONF WG list <mailto:netconf@ietf.org> |
| 48 | Author: Kent Watsen <mailto:kent+ietf@watsen.net> |
| 49 | Author: Gary Wu <mailto:garywu@cisco.com>"; |
| 50 | |
| 51 | description |
| 52 | "This module defines a common features and groupings for |
| 53 | Secure Shell (SSH). |
| 54 | |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 55 | Copyright (c) 2023 IETF Trust and the persons identified |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 56 | as authors of the code. All rights reserved. |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 57 | Redistribution and use in source and binary forms, with |
| 58 | or without modification, is permitted pursuant to, and |
| 59 | subject to the license terms contained in, the Revised |
| 60 | BSD License set forth in Section 4.c of the IETF Trust's |
| 61 | Legal Provisions Relating to IETF Documents |
| 62 | (https://trustee.ietf.org/license-info). |
| 63 | |
| 64 | This version of this YANG module is part of RFC EEEE |
| 65 | (https://www.rfc-editor.org/info/rfcEEEE); see the RFC |
| 66 | itself for full legal notices. |
| 67 | |
| 68 | The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', |
| 69 | 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', |
| 70 | 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document |
| 71 | are to be interpreted as described in BCP 14 (RFC 2119) |
| 72 | (RFC 8174) when, and only when, they appear in all |
| 73 | capitals, as shown here."; |
| 74 | |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 75 | revision 2023-04-17 { |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 76 | description |
| 77 | "Initial version"; |
| 78 | reference |
| 79 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 80 | } |
| 81 | |
| 82 | // Features |
| 83 | |
| 84 | feature ssh-x509-certs { |
| 85 | description |
| 86 | "X.509v3 certificates are supported for SSH."; |
| 87 | reference |
| 88 | "RFC 6187: X.509v3 Certificates for Secure Shell |
| 89 | Authentication"; |
| 90 | } |
| 91 | |
| 92 | feature transport-params { |
| 93 | description |
| 94 | "SSH transport layer parameters are configurable."; |
| 95 | } |
| 96 | |
| 97 | feature public-key-generation { |
| 98 | description |
| 99 | "Indicates that the server implements the |
| 100 | 'generate-public-key' RPC."; |
| 101 | } |
| 102 | |
| 103 | // Groupings |
| 104 | |
| 105 | grouping transport-params-grouping { |
| 106 | description |
| 107 | "A reusable grouping for SSH transport parameters."; |
| 108 | reference |
| 109 | "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol"; |
| 110 | container host-key { |
| 111 | description |
| 112 | "Parameters regarding host key."; |
| 113 | leaf-list host-key-alg { |
| 114 | type identityref { |
| 115 | base sshpka:public-key-alg-base; |
| 116 | } |
| 117 | ordered-by user; |
| 118 | description |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 119 | "Acceptable host key algorithms in order of decreasing |
| 120 | preference. |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 121 | |
| 122 | If this leaf-list is not configured (has zero elements) |
| 123 | the acceptable host key algorithms are implementation- |
| 124 | defined."; |
| 125 | reference |
| 126 | "RFC EEEE: YANG Groupings for SSH Clients and SSH Servers"; |
| 127 | } |
| 128 | } |
| 129 | container key-exchange { |
| 130 | description |
| 131 | "Parameters regarding key exchange."; |
| 132 | leaf-list key-exchange-alg { |
| 133 | type identityref { |
| 134 | base sshkea:key-exchange-alg-base; |
| 135 | } |
| 136 | ordered-by user; |
| 137 | description |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 138 | "Acceptable key exchange algorithms in order of decreasing |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 139 | preference. |
| 140 | |
| 141 | If this leaf-list is not configured (has zero elements) |
| 142 | the acceptable key exchange algorithms are implementation |
| 143 | defined."; |
| 144 | } |
| 145 | } |
| 146 | container encryption { |
| 147 | description |
| 148 | "Parameters regarding encryption."; |
| 149 | leaf-list encryption-alg { |
| 150 | type identityref { |
| 151 | base sshea:encryption-alg-base; |
| 152 | } |
| 153 | ordered-by user; |
| 154 | description |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 155 | "Acceptable encryption algorithms in order of decreasing |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 156 | preference. |
| 157 | |
| 158 | If this leaf-list is not configured (has zero elements) |
| 159 | the acceptable encryption algorithms are implementation |
| 160 | defined."; |
| 161 | } |
| 162 | } |
| 163 | container mac { |
| 164 | description |
| 165 | "Parameters regarding message authentication code (MAC)."; |
| 166 | leaf-list mac-alg { |
| 167 | type identityref { |
| 168 | base sshma:mac-alg-base; |
| 169 | } |
| 170 | ordered-by user; |
| 171 | description |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 172 | "Acceptable MAC algorithms in order of decreasing |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 173 | preference. |
| 174 | |
| 175 | If this leaf-list is not configured (has zero elements) |
| 176 | the acceptable MAC algorithms are implementation- |
| 177 | defined."; |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | // Protocol-accessible Nodes |
| 183 | |
| 184 | rpc generate-public-key { |
| 185 | if-feature "public-key-generation"; |
| 186 | description |
| 187 | "Requests the device to generate an public key using |
| 188 | the specified key algorithm."; |
| 189 | input { |
| 190 | leaf algorithm { |
| 191 | type sshpka:public-key-algorithm-ref; |
| 192 | mandatory true; |
| 193 | description |
| 194 | "The algorithm to be used when generating the key."; |
| 195 | } |
| 196 | leaf bits { |
| 197 | type uint16; |
| 198 | description |
| 199 | "Specifies the number of bits in the key to create. |
| 200 | For RSA keys, the minimum size is 1024 bits and |
| 201 | the default is 3072 bits. Generally, 3072 bits is |
| 202 | considered sufficient. DSA keys must be exactly 1024 |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 203 | bits as specified by FIPS 186-6. For ECDSA keys, the |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 204 | 'bits' value determines the key length by selecting |
| 205 | from one of three elliptic curve sizes: 256, 384 or |
| 206 | 521 bits. Attempting to use bit lengths other than |
| 207 | these three values for ECDSA keys will fail. ECDSA-SK, |
| 208 | Ed25519 and Ed25519-SK keys have a fixed length and |
| 209 | the 'bits' value, if specified, will be ignored."; |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 210 | reference |
| 211 | "FIPS 186-6: Digital Signature Standard (DSS)"; |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 212 | } |
| 213 | choice private-key-encoding { |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 214 | mandatory true; |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 215 | description |
| 216 | "A choice amongst optional private key handling."; |
| 217 | case cleartext { |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 218 | if-feature "ct:encrypted-private-keys"; |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 219 | leaf cleartext { |
| 220 | type empty; |
| 221 | description |
| 222 | "Indicates that the private key is to be returned |
| 223 | as a cleartext value."; |
| 224 | } |
| 225 | } |
| 226 | case encrypt { |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 227 | if-feature "ct:encrypted-private-keys"; |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 228 | container encrypt-with { |
| 229 | description |
| 230 | "Indicates that the key is to be encrypted using |
| 231 | the specified symmetric or asymmetric key."; |
| 232 | uses ks:encrypted-by-choice-grouping; |
| 233 | } |
| 234 | } |
| 235 | case hide { |
roman | 7fdc84d | 2023-06-06 13:14:53 +0200 | [diff] [blame] | 236 | if-feature "ct:hidden-private-keys"; |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 237 | leaf hide { |
| 238 | type empty; |
| 239 | description |
| 240 | "Indicates that the private key is to be hidden. |
| 241 | |
| 242 | Unlike the 'cleartext' and 'encrypt' options, the |
| 243 | key returned is a placeholder for an internally |
| 244 | stored key. See the 'Support for Built-in Keys' |
| 245 | section in RFC CCCC for information about hidden |
| 246 | keys."; |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | output { |
| 252 | uses ct:asymmetric-key-pair-grouping; |
| 253 | } |
| 254 | } // end generate-public-key |
| 255 | |
| 256 | } |