1VMOD_PROXY(3)                                                    VMOD_PROXY(3)
2
3
4

NAME

6       vmod_proxy - Varnish Module to extract TLV attributes from PROXYv2
7

SYNOPSIS

9          import proxy [from "path"] ;
10
11          STRING alpn()
12
13          STRING authority()
14
15          BOOL is_ssl()
16
17          BOOL client_has_cert_sess()
18
19          BOOL client_has_cert_conn()
20
21          INT ssl_verify_result()
22
23          STRING ssl_version()
24
25          STRING client_cert_cn()
26
27          STRING ssl_cipher()
28
29          STRING cert_sign()
30
31          STRING cert_key()
32

DESCRIPTION

34       vmod_proxy   contains   functions   to  extract  proxy-protocol-v2  TLV
35       attributes                as                described                in
36       https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt.
37
38   STRING alpn()
39       Description
40              Extract ALPN attribute.
41
42       Example
43              set req.http.alpn = proxy.alpn();
44
45   STRING authority()
46       Description
47              Extract  authority attribute. This corresponds to SNI from a TLS
48              connection.
49
50       Example
51              set req.http.authority = proxy.authority();
52
53   BOOL is_ssl()
54       Description
55              Report if proxy-protocol-v2 has SSL TLV.
56
57       Example
58              if (proxy.is_ssl()) {
59                set req.http.ssl-version = proxy.ssl_version();
60              }
61
62
63   BOOL client_has_cert_sess()
64       Description
65              Report if the client provided a certificate at least  once  over
66              the TLS session this connection belongs to.
67
68   BOOL client_has_cert_conn()
69       Description
70              Report  if  the  client  provided a certificate over the current
71              connection.
72
73   INT ssl_verify_result()
74       Description
75              Report the SSL_get_verify_result from a  TLS  session.  It  only
76              matters if client_has_cert_sess() is true. Per default, value is
77              set to 0 (X509_V_OK).
78
79       Example
80              if (proxy.client_has_cert_sess() && proxy.ssl_verify_result() == 0) {
81                set req.http.ssl-verify = "ok";
82              }
83
84
85   STRING ssl_version()
86       Description
87              Extract SSL version attribute.
88
89       Example
90              set req.http.ssl-version = proxy.ssl_version();
91
92   STRING client_cert_cn()
93       Description
94              Extract the common name attribute of the client certificate's.
95
96       Example
97              set req.http.cert-cn = proxy.client_cert_cn();
98
99   STRING ssl_cipher()
100       Description
101              Extract the SSL cipher attribute.
102
103       Example
104              set req.http.ssl-cipher = proxy.ssl_cipher();
105
106   STRING cert_sign()
107       Description
108              Extract the certificate signature algorithm attribute.
109
110       Example
111              set req.http.cert-sign = proxy.cert_sign();
112
113   STRING cert_key()
114       Description
115              Extract the certificate key algorithm attribute.
116
117       Example
118              set req.http.cert-key = proxy.cert_key();
119

SEE ALSO

121       · varnishd(1)
122
123       · vsl(7)
124
126          Copyright (c) 2018 GANDI SAS
127          All rights reserved.
128
129          Author: Emmanuel Hocdet <manu@gandi.net>
130
131          Redistribution and use in source and binary forms, with or without
132          modification, are permitted provided that the following conditions
133          are met:
134          1. Redistributions of source code must retain the above copyright
135             notice, this list of conditions and the following disclaimer.
136          2. Redistributions in binary form must reproduce the above copyright
137             notice, this list of conditions and the following disclaimer in the
138             documentation and/or other materials provided with the distribution.
139
140          THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
141          ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
142          IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
143          ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
144          FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
145          DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
146          OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
147          HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
148          LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
149          OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
150          SUCH DAMAGE.
151
152
153
154
155                                                                 VMOD_PROXY(3)
Impressum