1 .\" Copyright (c) 2020 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
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.
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.
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
36 .Nd Authentication Bridge for Bearer tokens, Kerberos, and PKIX
42 .Op Fl d | Fl Fl daemon
44 .Op Fl Fl no-allow-GET
45 .Op Fl Fl csrf-protection-type= Ns Ar CSRF-PROTECTION-TYPE
46 .Op Fl Fl csrf-header= Ns Ar HEADER-NAME
47 .Op Fl Fl csrf-key-file= Ns Ar FILE
48 .Op Fl Fl reverse-proxied
49 .Op Fl p Ar port number (default: 443)
50 .Op Fl Fl cache-dir= Ns Ar DIRECTORY
51 .Op Fl Fl cert= Ns Ar HX509-STORE
52 .Op Fl Fl private-key= Ns Ar HX509-STORE
53 .Op Fl t | Fl Fl thread-per-client
55 .Fl Fl verbose= Ns Ar run verbosely
59 Serves RESTful (HTTPS) GETs of
64 .Ar /get-negotiate-token ,
65 end-points that implement various experimental Heimdal features:
66 .Bl -bullet -compact -offset indent
68 .Li an online CA service over HTTPS,
70 .Li a kinit-over-HTTPS service, and
72 .Li a Negotiate token over HTTPS service.
77 service can be used for checking service status.
93 Expected audience(s) of bearer tokens (i.e., acceptor name).
97 If given, then HTTP GET will be allowed for the various
100 Otherwise only HEAD and POST will be allowed.
101 By default GETs are allowed, but this will change soon.
105 If given then HTTP GETs will be rejected for the various
106 end-points other than
109 .Fl Fl csrf-protection-type= Ns Ar CSRF-PROTECTION-TYPE
112 .Ar CSRF-PROTECTION-TYPE
114 .Bl -bullet -compact -offset indent
124 This may be given multiple times.
125 The default is to require CSRF tokens for POST requests, and to
126 require neither a non-simple header nor a CSRF token for GET
130 .Sx CROSS-SITE REQUEST FORGERY PROTECTION .
132 .Fl Fl csrf-header= Ns Ar HEADER-NAME
134 If given, then all requests other than to the
136 service must have the given request
138 set (the value is irrelevant).
141 must be a request header name such that a request having it makes
144 request (see the Cross-Origin Resource Sharing specification).
148 .Fl Fl csrf-key-file= Ns Ar FILE
150 If given, this file must contain a 16 byte binary key for keying
151 the HMAC used in CSRF token construction.
156 Detach from TTY and run in the background.
158 .Fl Fl reverse-proxied
160 Serves HTTP instead of HTTPS, accepting only looped-back
163 .Fl p Ar port number (default: 443)
167 .Fl Fl cache-dir= Ns Ar DIRECTORY
169 Directory for various caches.
170 If not specified then a temporary directory will be made.
172 .Fl Fl cert= Ns Ar HX509-STORE
174 Certificate file path (PEM) for HTTPS service.
175 May contain private key as well.
177 .Fl Fl private-key= Ns Ar HX509-STORE
179 Private key file path (PEM), if the private key is not stored
180 along with the certificiate.
183 .Fl Fl thread-per-client
185 Uses a thread per-client instead of as many threads as there are
189 .Fl Fl verbose= Ns Ar run verbosely
194 All HTTP APIs served by this program accept POSTs, with all
195 request parameters given as URI query parameters and/or as
196 form data in the POST request body, in either
197 .Ar application/x-www-form-urlencoded
199 .Ar multipart/formdata .
200 If request parameters are given both as URI query parameters
201 and as POST forms, then they are merged into a set.
203 If GETs are enabled, then request parameters must be supplied
204 only as URI query parameters, as GET requests do not have request
207 URI query parameters must be of the form
208 .Ar param0=value¶m1=value...
210 Some request parameters can only have one value.
211 If multiple values are given for such parameters, then either an
212 error will be produced, or only the first URI query parameter
213 value will be used, or the first POST form data parameter will be
215 Other request parameters can have multiple values.
217 .Sh CROSS-SITE REQUEST FORGERY PROTECTION
219 of the resources service by this service are intended to be
220 executed by web pages.
222 All the resources provided by this service are
224 in the sense that they do not change server-side state besides
225 logging, and in that they are idempotent, but they are
228 the requesting party is trusted to see the response.
229 Since none of these resources are intended to be used from web
230 pages, it is important that web pages not be able to execute them
232 observe the responses.
234 In a web browser context, pages from other origins will be able
235 to attempt requests to this service, but should never be able to
236 see the responses because browsers normally wouldn't allow that.
237 Nonetheless, anti cross site request forgery (CSRF) protection
240 This service provides the following CSRF protection features:
241 .Bl -tag -width Ds -offset indent
242 .It requests are rejected if they have a
244 (except the experimental /get-negotiate-token end-point)
245 .It the service can be configured to require a header that would make the
246 request not Dq simple
247 .It GETs can be disabled (see options), thus requiring POSTs
248 .It GETs can be required to have a CSRF token (see below)
249 .It POSTs can be required to have a CSRF token
253 .Ar /get-negotiate-token
254 end-point, however, always accepts
258 To obtain a CSRF token, first execute the request without the
259 CSRF token, and the resulting error
260 response will include a
264 To execute a request with a CSRF token, first obtain a CSRF token
265 as described above, then copy the token to the request as the
266 value of the request's
269 .Sh ONLINE CERTIFICATION AUTHORITY HTTP API
270 This service provides an HTTP-based Certification Authority (CA).
271 CA credentials and configuration are specified in the
276 The protocol consists of a
280 with the base-63 encoding of a DER encoding of a PKCS#10
281 .Ar CertificationRequest
282 (Certificate Signing Request, or CSR) in a
284 required request parameter.
285 In a successful request, the response body will contain a PEM
286 encoded end entity certificate and certification chain.
292 as this used to be called.
294 Authentication is required.
295 Unauthenticated requests will elicit a 401 response.
297 Authorization is required.
298 Unauthorized requests will elicit a 403 response.
300 Subject Alternative Names (SANs) and Extended Key Usage values
301 may be requested, both in-band in the CSR as a requested
302 extensions attribute, and/or via optional request parameters.
304 Supported request parameters:
305 .Bl -tag -width Ds -offset indent
306 .It Li csr = Va base64-encoded-DER-encoded-CSR
307 .It Li dNSName = Va hostname
308 .It Li rfc822Name = Va email-address
309 .It Li xMPPName = Va XMPP-address
310 .It Li krb5PrincipalName = Va Kerberos-principal-name
311 .It Li ms-upn = Va UPN
313 .It Li lifetime = Va lifetime
316 More than one name or EKU may be requested.
318 Certificate lifetimes are expressed as a decimal number and
319 an optional unit (which defaults to
322 .Sh NEGOTIATE TOKEN HTTP API
323 This service provides an HTTP-based Negotiate token service.
324 This service requires a certification authority (CA) issuer
325 credential as it impersonates client principals to the KDC using
326 PKINIT client certificates it issues itself.
328 The protocol consists of a
331 .Ar /get-negotiate-token
333 .Ar target = Ar service@host
336 In a successful request, the response body will contain a
337 Negotiate token for the authenticated client principal to the
340 Authentication is required.
341 Unauthenticated requests will elicit a 401 response.
343 Subject Alternative Names (SANs) and Extended Key Usage values
344 may be requested, both in-band in the CSR as a requested
345 extensions attribute, and/or via optional request parameters.
347 Supported request parameters:
348 .Bl -tag -width Ds -offset indent
349 .It Li target = Va service@hostname
350 .It Li redirect = Va URI
353 If a redirect URI is given and a matching
355 header is included in the request, then the response will be a
356 redirect to that URI with the Negotiate token in an
358 header that the user-agent should copy to the redirected request.
360 The certification authority configuration is the same as for the
362 end-point, but as configured in the
367 This service provides an HTTP-based "kinit" service.
368 This service requires a certification authority (CA) issuer
369 credential as it impersonates client principals to the KDC using
370 PKINIT client certificates it issues itself.
372 The protocol consists of a
377 Supported request parameters:
378 .Bl -tag -width Ds -offset indent
379 .It Li cname = Va principal-name
380 .It Li address = Va IP-address
381 .It Li lifetime = Va relative-time
384 In a successful request, the response body will contain a TGT and
385 its session key encoded as a "ccache" file contents.
387 Authentication is required.
388 Unauthenticated requests will elicit a 401 response.
390 Authorization is required, where the authorization check is the
393 by the authenticated client principal to get a certificate with
394 a PKINIT SAN for itself or the requested principal if a
396 request parameter was included.
398 Unauthorized requests will elicit a 403 response.
400 Requested IP addresses will be added to the issued TGT if
402 The IP address of the client will be included if address-less
403 TGTs are not allowed.
409 The certification authority configuration is the same as for the
411 end-point, but as configured in the
415 .Sh BATCH TGT HTTP API
416 Some sites may have special users that operate batch jobs systems
417 and that can impersonate many others by obtaining TGTs for them,
420 credentials for those users in their credentials caches.
421 To support these sytems, a
427 request parameters will return those principals' TGTs (if the
428 caller is authorized).
430 This is similar to the
432 end-point, but a) multiple
434 request parameter values may be given, and b) the caller's
435 principal name is not used as a default for the
442 request parameters are honored.
446 the response body is a sequence of JSON texts each of which is a
447 JSON object with two keys:
448 .Bl -tag -width Ds -offset indent
450 with a base64-encoded FILE-type ccache;
452 the name of the principal whose credentials are in that ccache.
455 A future release may split all these end-points into separate
466 Configuration parameters are specified in
469 .It Pa /etc/krb5.conf
473 See logging section of