s4:torture: Adapt KDC canon test to Heimdal upstream changes
[samba.git] / third_party / heimdal / kdc / bx509d.8
1 .\" Copyright (c) 2020 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .Dd January  2, 2020
32 .Dt BX509 8
33 .Os HEIMDAL
34 .Sh NAME
35 .Nm bx509d
36 .Nd Authentication Bridge for Bearer tokens, Kerberos, and PKIX
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl h | Fl Fl help
40 .Op Fl Fl version
41 .Op Fl H Ar HOSTNAME
42 .Op Fl d | Fl Fl daemon
43 .Op Fl Fl daemon-child
44 .Op Fl Fl reverse-proxied
45 .Op Fl p Ar port number (default: 443)
46 .Op Fl Fl cache-dir= Ns Ar DIRECTORY
47 .Op Fl Fl cert= Ns Ar HX509-STORE
48 .Op Fl Fl private-key= Ns Ar HX509-STORE
49 .Op Fl t | Fl Fl thread-per-client
50 .Oo Fl v \*(Ba Xo
51 .Fl Fl verbose= Ns Ar run verbosely
52 .Xc
53 .Oc
54 .Sh DESCRIPTION
55 Serves RESTful (HTTPS) GETs of
56 .Ar /bx509 and
57 .Ar /bnegotiate ,
58 end-points
59 performing corresponding kx509 and, possibly, PKINIT requests
60 to the KDCs of the requested realms (or just the given REALM).
61 .Pp
62 Supported options:
63 .Bl -tag -width Ds
64 .It Xo
65 .Fl h ,
66 .Fl Fl help
67 .Xc
68 Print usage message.
69 .It Xo
70 .Fl Fl version
71 .Xc
72 Print version.
73 .It Xo
74 .Fl H Ar HOSTNAME
75 .Xc
76 Expected audience(s) of bearer tokens (i.e., acceptor name).
77 .It Xo
78 .Fl d ,
79 .Fl Fl daemon
80 .Xc
81 Detach from TTY and run in the background.
82 .It Xo
83 .Fl Fl reverse-proxied
84 .Xc
85 Serves HTTP instead of HTTPS, accepting only looped-back connections.
86 .It Xo
87 .Fl p Ar port number (default: 443)
88 .Xc
89 PORT
90 .It Xo
91 .Fl Fl cache-dir= Ns Ar DIRECTORY
92 .Xc
93 Directory for various caches.  If not specified then a temporary directory will
94 be made.
95 .It Xo
96 .Fl Fl cert= Ns Ar HX509-STORE
97 .Xc
98 Certificate file path (PEM) for HTTPS service.  May contain private key as
99 well.
100 .It Xo
101 .Fl Fl private-key= Ns Ar HX509-STORE
102 .Xc
103 Private key file path (PEM), if the private key is not stored along with the
104 certificiate.
105 .It Xo
106 .Fl t ,
107 .Fl Fl thread-per-client
108 .Xc
109 Uses a thread per-client instead of as many threads as there are CPUs.
110 .It Xo
111 .Fl v ,
112 .Fl Fl verbose= Ns Ar run verbosely
113 .Xc
114 verbose
115 .El
116 .Sh ONLINE CERTIFICATION AUTHORITY HTTP API
117 This service provides an HTTP-based Certification Authority (CA).
118 CA credentials and configuration are specified in the
119 .Va [bx509]
120 section of
121 .Xr krb5.conf 5 .
122 .Pp
123 The protocol consists of a
124 .Ar GET
125 of
126 .Ar /get-cert
127 with the base-63 encoding of a DER encoding of a PKCS#10
128 .Ar CertificationRequest
129 (Certificate Signing Request, or CSR) in a
130 .Ar csr
131 required query parameter.
132 In a successful query, the response body will contain a PEM
133 encoded end entity certificate and certification chain.
134 .Pp
135 Or
136 .Ar GET
137 of
138 .Ar /bx509 ,
139 as this used to be called.
140 .Pp
141 Authentication is required.
142 Unauthenticated requests will elicit a 401 response.
143 .Pp
144 Authorization is required.
145 Unauthorized requests will elicit a 403 response.
146 .Pp
147 Subject Alternative Names (SANs) and Extended Key Usage values
148 may be requested, both in-band in the CSR as a requested
149 extensions attribute, and/or via optional query parameters.
150 .Pp
151 Supported query parameters (separated by ampersands)
152 .Bl -tag -width Ds -offset indent
153 .It Li csr = Va base64-encoded-DER-encoded-CSR
154 .It Li dNSName = Va hostname
155 .It Li rfc822Name = Va email-address
156 .It Li xMPPName = Va XMPP-address
157 .It Li krb5PrincipalName = Va Kerberos-principal-name
158 .It Li ms-upn = Va UPN
159 .It Li eku = Va OID
160 .It Li lifetime = Va lifetime
161 .El
162 .Pp
163 More than one name or EKU may be requested.
164 .Pp
165 Certificate lifetimes are expressed as a decimal number and
166 an optional unit (which defaults to
167 .Dq day
168 ).
169 .Sh NEGOTIATE TOKEN HTTP API
170 This service provides an HTTP-based Negotiate token service.
171 This service requires a certification authority (CA) issuer
172 credential as it impersonates client principals to the KDC using
173 PKINIT client certificates it issues itself.
174 .Pp
175 The protocol consists of a
176 .Ar GET
177 of
178 .Ar /get-negotiate-token
179 with a
180 .Ar target = Ar service@host
181 query parameter.
182 .Pp
183 In a successful query, the response body will contain a Negotiate
184 token for the authenticated client principal to the requested
185 target.
186 .Pp
187 Authentication is required.
188 Unauthenticated requests will elicit a 401 response.
189 .Pp
190 Subject Alternative Names (SANs) and Extended Key Usage values
191 may be requested, both in-band in the CSR as a requested
192 extensions attribute, and/or via optional query parameters.
193 .Pp
194 Supported query parameters (separated by ampersands)
195 .Bl -tag -width Ds -offset indent
196 .It Li target = Va service@hostname
197 .It Li redirect = Va URI
198 .El
199 .Pp
200 If a redirect URI is given and a matching
201 .Va Referer
202 header is included in the request, then the response will be a
203 redirect to that URI with the Negotiate token in an
204 .Va Authorization
205 header that the user-agent should copy to the redirected request.
206 .Pp
207 The certification authority configuration is the same as for the
208 .Va /get-cert
209 end-point, but as configured in the
210 .Va [get-tgt]
211 section of
212 .Xr krb5.conf 5 .
213 .Sh TGT HTTP API
214 This service provides an HTTP-based "kinit" service.
215 This service requires a certification authority (CA) issuer
216 credential as it impersonates client principals to the KDC using
217 PKINIT client certificates it issues itself.
218 .Pp
219 The protocol consists of a
220 .Ar GET
221 of
222 .Ar /get-tgt .
223 .Pp
224 Supported query parameters (separated by ampersands)
225 .Bl -tag -width Ds -offset indent
226 .It Li cname = Va principal-name
227 .It Li address = Va IP-address
228 .El
229 .Pp
230 In a successful query, the response body will contain a TGT and
231 its session key encoded as a "ccache" file contents.
232 .Pp
233 Authentication is required.
234 Unauthenticated requests will elicit a 401 response.
235 .Pp
236 Authorization is required, where the authorization check is the
237 same as for
238 .Va /get-cert
239 by the authenticated client principal to get a certificate with
240 a PKINIT SAN for itself or the requested principal if a
241 .Va cname
242 query parameter was included.
243 .Pp
244 Unauthorized requests will elicit a 403 response.
245 .Pp
246 Requested IP addresses will be added to the issued TGT if allowed.
247 The IP address of the client will be included if address-less TGTs
248 are not allowed.
249 See the
250 .Va [get-tgt]
251 section of
252 .Xr krb5.conf 5 .
253 .Pp
254 The certification authority configuration is the same as for the
255 .Va /get-cert
256 end-point, but as configured in the
257 .Va [get-tgt]
258 section of
259 .Xr krb5.conf 5 .
260 .Sh ENVIRONMENT
261 .Bl -tag -width Ds
262 .It Ev KRB5_CONFIG
263 The file name of
264 .Pa krb5.conf ,
265 the default being
266 .Pa /etc/krb5.conf .
267 .El
268 .Sh FILES
269 Configuration parameters are specified in
270 .Ar /etc/krb5.conf .
271 .Bl -tag -width Ds
272 .It Pa /etc/krb5.conf
273 .El
274 .\".Sh EXAMPLES
275 .Sh DIAGNOSTICS
276 See logging section of
277 .Nm krb5.conf.5
278 .Sh SEE ALSO
279 .Xr krb5.conf 5
280 .\".Sh STANDARDS
281 .\".Sh HISTORY
282 .\".Sh AUTHORS
283 .\".Sh BUGS