2 回答

TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個(gè)贊
通過將 ssl_fc_cipher 設(shè)置為haproxy.cfg中的自定義 HTTP 標(biāo)頭,我能夠在 Tomcat 的訪問日志中獲取 SSL 密碼:
frontend web_applications
mode http
option httplog
option forwardfor
capture request header Referer len 2000
capture request header User-Agent len 250
capture request header Host len 100
capture request header X-Forwarded-For len 50
reqadd X-Forwarded-Proto:\ https
default_backend web_applications
bind *:443 ssl crt /etc/haproxy/certs/cert.pem ciphers AES256
http-request set-header X-SSL-Cipher %[ssl_fc_cipher]
backend web_applications
mode http
balance roundrobin
server web_applications webappserver.net:80 check
在 AccessLog Valve 中捕獲 X-SSL-Cipher 自定義標(biāo)頭:
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/var/cps"
prefix="access_log"
suffix=".txt"
locale="en_US"
rotatable="false"
maxLogMessageBufferSize="512"
pattern="%{X-Forwarded-For}i %a %{begin:yyyy-MM-dd-HH:mm:ss.SSSZ}t %{end:yyyy-MM-dd-HH:mm:ss.SSSZ}t "%r" %s %b %X-SSL-Cipher}i" />

TA貢獻(xiàn)1820條經(jīng)驗(yàn) 獲得超10個(gè)贊
在 haproxy 中,您可以使用自定義日志記錄功能來指定記錄密碼信息。有關(guān)自定義日志記錄,請(qǐng)參閱haproxy 文檔。
'%sslc' - ssl_ciphers (ex: AES-SHA)
一個(gè)示例自定義日志字符串,包括密碼日志記錄:
defaults 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 %sslc"
添加回答
舉報(bào)