[AAI] Reintegrate AAI OOM charts in main repo
[oom.git] / kubernetes / aai / resources / config / haproxy / haproxy.cfg
1 # Copyright © 2018 Amdocs, Bell Canada, AT&T
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 global
16         log /dev/log    local0
17         stats socket /usr/local/etc/haproxy/haproxy.socket mode 660 level admin
18         stats timeout 30s
19         daemon
20         #################################
21         # Default SSL material locations#
22         #################################
23         ca-base /etc/ssl/certs
24         crt-base /etc/ssl/private
25
26         # Default ciphers to use on SSL-enabled listening sockets.
27         # For more information, see ciphers(1SSL). This list is from:
28         # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
29         # An alternative list with additional directives can be obtained from
30         # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
31         tune.ssl.default-dh-param 2048
32
33 defaults
34         log     global
35         mode    http
36         option  httplog
37         option  ssl-hello-chk
38         option  httpchk GET /aai/util/echo HTTP/1.1\r\nHost:\ aai\r\nX-TransactionId:\ haproxy-0111\r\nX-FromAppId:\ haproxy\r\nAccept:\ application/json\r\nAuthorization:\ Basic\ QUFJOkFBSQ==
39         default-server init-addr none
40 #       option  dontlognull
41 #       errorfile 400 /etc/haproxy/errors/400.http
42 #       errorfile 403 /etc/haproxy/errors/403.http
43 #       errorfile 408 /etc/haproxy/errors/408.http
44 #       errorfile 500 /etc/haproxy/errors/500.http
45 #       errorfile 502 /etc/haproxy/errors/502.http
46 #       errorfile 503 /etc/haproxy/errors/503.http
47 #       errorfile 504 /etc/haproxy/errors/504.http
48
49         option  http-server-close
50         option forwardfor except 127.0.0.1
51         retries 6
52         option redispatch
53         maxconn 50000
54         timeout connect 50000
55         timeout client  480000
56         timeout server  480000
57         timeout http-keep-alive 30000
58
59
60 frontend IST_8443
61         mode http
62         bind 0.0.0.0:8443 name https ssl crt /etc/ssl/private/aai.pem
63 #       log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ {%[ssl_c_verify],%{+Q}[ssl_c_s_dn],%{+Q}[ssl_c_i_dn]}\ %{+Q}r
64         log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC \ %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
65         option httplog
66         log global
67         option logasap
68         option forwardfor
69         capture request header  Host len 100
70         capture response header Host len 100
71         option log-separate-errors
72         option forwardfor
73         http-request set-header X-Forwarded-Proto https if { ssl_fc }
74         http-request set-header X-AAI-Client-SSL TRUE if { ssl_c_used }
75         http-request set-header X-AAI-SSL                       %[ssl_fc]
76         http-request set-header X-AAI-SSL-Client-Verify         %[ssl_c_verify]
77         http-request set-header X-AAI-SSL-Client-DN             %{+Q}[ssl_c_s_dn]
78         http-request set-header X-AAI-SSL-Client-CN             %{+Q}[ssl_c_s_dn(cn)]
79         http-request set-header X-AAI-SSL-Issuer                %{+Q}[ssl_c_i_dn]
80         http-request set-header X-AAI-SSL-Client-NotBefore      %{+Q}[ssl_c_notbefore]
81         http-request set-header X-AAI-SSL-Client-NotAfter       %{+Q}[ssl_c_notafter]
82         http-request set-header X-AAI-SSL-ClientCert-Base64   %{+Q}[ssl_c_der,base64]
83         http-request set-header X-AAI-SSL-Client-OU             %{+Q}[ssl_c_s_dn(OU)]
84         http-request set-header X-AAI-SSL-Client-L              %{+Q}[ssl_c_s_dn(L)]
85         http-request set-header X-AAI-SSL-Client-ST             %{+Q}[ssl_c_s_dn(ST)]
86         http-request set-header X-AAI-SSL-Client-C              %{+Q}[ssl_c_s_dn(C)]
87         http-request set-header X-AAI-SSL-Client-O              %{+Q}[ssl_c_s_dn(O)]
88         reqadd X-Forwarded-Proto:\ https
89         reqadd X-Forwarded-Port:\ 8443
90
91 #######################
92 #ACLS FOR PORT 8446####
93 #######################
94
95         acl is_Port_8446_generic path_reg -i ^/aai/v[0-9]+/search/generic-query$
96         acl is_Port_8446_nodes path_reg -i ^/aai/v[0-9]+/search/nodes-query$
97         acl is_Port_8446_version path_reg -i ^/aai/v[0-9]+/query$
98         acl is_dsl path_reg -i ^/aai/v[0-9]+/dsl$
99         acl is_named-query path_beg -i /aai/search/named-query
100         acl is_search-model path_beg -i /aai/search/model
101         use_backend IST_AAI_8446 if is_Port_8446_generic or is_Port_8446_nodes or is_Port_8446_version or is_named-query or is_search-model or is_dsl
102
103         default_backend IST_Default_8447
104
105
106 #######################
107 #DEFAULT BACKEND 847###
108 #######################
109
110 backend IST_Default_8447
111         balance roundrobin
112         http-request set-header X-Forwarded-Port %[src_port]
113         http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
114         server aai-resources.{{.Release.Namespace}} aai-resources.{{.Release.Namespace}}.svc.cluster.local:8447 resolvers kubernetes check check-ssl port 8447 ssl verify none
115
116
117 #######################
118 # BACKEND 8446#########
119 #######################
120
121 backend IST_AAI_8446
122         balance roundrobin
123         http-request set-header X-Forwarded-Port %[src_port]
124         http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
125         server aai-traversal.{{.Release.Namespace}} aai-traversal.{{.Release.Namespace}}.svc.cluster.local:8446 resolvers kubernetes check check-ssl port 8446 ssl verify none
126