1- Name
2- ====
1+ # Name
32
43haproxy-cloudflare-jwt-validator - JSON Web Token validation for haproxy
54
6- Description
7- ===========
5+ # Description
86
97This was tested & developed with HAProxy version 1.8.25 & Lua version 5.3.
108This library provides the ability to validate JWT headers sent by Cloudflare Access.
119
12- Installation
13- ============
10+ # Installation
1411
1512Install the following dependencies:
13+
1614* [ haproxy-lua-http] ( https://github.com/haproxytech/haproxy-lua-http )
1715* [ rxi/json] ( https://github.com/rxi/json.lua )
1816* [ wahern/luaossl] ( https://github.com/wahern/luaossl )
1917
2018Extract base64.lua & jwtverify.lua to the same directory like so:
2119
22- ```
20+ ``` shell
2321git clone
[email protected] :kudelskisecurity/haproxy-cloudflare-jwt-validator.git
2422sudo cp haproxy-cloudflare-jwt-validator/src/* /usr/local/share/lua/5.3
2523```
2624
27- Version
28- =======
29- 0.1.0
30-
25+ # Version
3126
32- Usage
33- =====
27+ 0.1.0
3428
35- ###Configuration:
29+ # Usage
3630
3731JWT Issuer: ` https://test.cloudflareaccess.com ` (replace with yours in the config below)
3832
3933Add the following settings in your ` /etc/haproxy/haproxy.cfg ` file:
4034
4135Define a HAProxy backend, DNS Resolver, and ENV variables with the following names:
36+
4237```
4338global
4439 lua-load /usr/local/share/lua/5.3/jwtverify.lua
@@ -59,7 +54,7 @@ resolvers dnsresolver
5954 hold valid 10s
6055```
6156
62- Obtain your Application Audience (AUD) Tag from cloudflare and define your backend with JWT validation:
57+ Obtain your Application Audience (AUD) Tag from Cloudflare and define your backend with JWT validation:
6358
6459```
6560backend my_jwt_validated_app
@@ -69,4 +64,4 @@ backend my_jwt_validated_app
6964 http-request lua.jwtverify
7065 http-request deny unless { var(txn.authorized) -m bool }
7166 server haproxy 127.0.0.1:8080
72- ```
67+ ```
0 commit comments