1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
global
#log /dev/log local0
#log /dev/log local1 notice
log 127.0.0.1 len 8096 local2
log-send-hostname
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
# log-format {\"haproxy_clientIP\":\"%ci\",\"haproxy_clientPort\":\"%cp\",\"haproxy_dateTime\":\"%t\",\"haproxy_frontendNameTransport\":\"%ft\",\"haproxy_backend\":\"%b\",\"haproxy_serverName\":\"%s\",\"haproxy_Tw\":\"%Tw\",\"haproxy_Tc\":\"%Tc\",\"haproxy_Tt\":\"%Tt\",\"haproxy_bytesRead\":\"%B\",\"haproxy_terminationState\":\"%ts\",\"haproxy_actconn\":%ac,\"haproxy_FrontendCurrentConn\":%fc,\"haproxy_backendCurrentConn\":%bc,\"haproxy_serverConcurrentConn\":%sc,\"haproxy_retries\":%rc,\"haproxy_srvQueue\":%sq,\"haproxy_backendQueue\":%bq,\"haproxy_backendSourceIP\":\"%bi\",\"haproxy_backendSourcePort\":\"%bp\",\"haproxy_statusCode\":\"%ST\",\"haproxy_serverIP\":\"%si\",\"haproxy_serverPort\":\"%sp\",\"haproxy_frontendIP\":\"%fi\",\"haproxy_frontendPort\":\"%fp\",\"haproxy_capturedRequestHeaders\":\"%hr\",\"haproxy_httpRequest\":\"%r\"}
mode http
# option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend http-in
bind *:80
mode http
# acl is-blocked-ip src -f /etc/haproxy/blocklisted.ips
# http-request deny if is-blocked-ip
# acl is-allowed-ip src -f /etc/haproxy/allowed.ips
# tcp-request content accept if is-allowed-ip
# tcp-request content reject
acl gitlab url_beg /gitlab
use_backend servers_gitlab if gitlab
acl swjEqGender url_beg /swjEqGender
use_backend servers_swjEqGender if swjEqGender
acl pwntpcbs url_beg /pwntpcbs
use_backend servers_pwntpcbs if pwntpcbs
acl pwntpc url_beg /pwntpc
use_backend servers_pwntpc if pwntpc
acl centos url_beg /centos
use_backend servers_centos if centos
acl phpipam url_beg /phpipam
use_backend servers_phpipam if phpipam
acl sonarqube path_beg /sonarqube
use_backend servers_sonarqube if sonarqube
frontend rdp
mode tcp
bind *:7788
tcp-request inspect-delay 2s
tcp-request content accept if RDP_COOKIE
default_backend rdp_jameschang
frontend fe_ssh
mode tcp
bind *:22
default_backend ssh_gitlab
timeout client 1h
backend ssh_gitlab
mode tcp
server Server 192.168.56.5:22
backend servers_centos
mode http
server Server 192.168.56.228:80
backend rdp_jameschang
mode tcp
server Server 192.168.56.2:3389 check
backend servers_swjEqGender
http-response set-header Content-Security-Policy "script-src 'unsafe-inline' 'strict-dynamic' 'nonce-15d6c15b0f00a08' 'unsafe-inline' http: https:";"object-src 'none'";"base-uri 'none'";
balance source
server server1 127.0.0.1:8889
backend servers_pwntpcbs
http-response set-header Content-Security-Policy "script-src 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' 'nonce-2fa40fcd2b12e' https://cdn.datatables.net https://code.jquery.com https://maxcdn.bootstrapcdn.com https://fonts.googleapis.com https://www.google.com https://www.youtube.com https://www.facebook.com https://cdnjs.cloudflare.com https://connect.facebook.net https://www.googletagmanager.com https://www.google-analytics.com https://stats.g.doubleclick.net https://apis.google.com https://static.xx.fbcdn.net https://static.xx.fbcdn.net ;object-src 'none';base-uri 'none';";
balance source
server server1 127.0.0.1:8892
backend servers_pwntpc
http-response set-header Content-Security-Policy "script-src 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' 'nonce-2fa40fcd2b12e' https://cdn.datatables.net https://code.jquery.com https://maxcdn.bootstrapcdn.com https://fonts.googleapis.com https://www.google.com https://www.youtube.com https://www.facebook.com https://cdnjs.cloudflare.com https://connect.facebook.net https://www.googletagmanager.com https://www.google-analytics.com https://stats.g.doubleclick.net https://apis.google.com https://static.xx.fbcdn.net https://static.xx.fbcdn.net ;object-src 'none';base-uri 'none';";
balance source
server server1 127.0.0.1:8893
backend servers_gitlab
mode http
server server1 192.168.56.5:81 check
backend servers_phpipam
mode http
server server1 192.168.56.1:8802 check
backend servers_sonarqube
http-request set-header X-Forwarded-Proto https if { ssl_fc }
server server1 127.0.0.1:9000 check
listen stats
bind 0.0.0.0:1936
stats enable
stats hide-version
stats refresh 10s
stats show-node
stats auth admin:admin
stats uri /stats
|