我能采取哪些最佳实践或方法来防止某些数据(例如密码)被logging到mod-security的日志文件中?
我们有一个呼叫进入我们的Apache服务器(并在Karaf后端),似乎偶尔触发一个mod安全规则。 此调用包含一个密码作为URL参数之一。
如何获得mod-security来报告规则,但从日志中抑制某些信息? 显然我想知道规则已经被触发,但是我担心把敏感数据留在日志中。
这是一个例子(狡猾的位在第二行): –
--0a6bf76f-C-- userName=fred.bloggs%40whatever.com&password=SHOULDNTBEHERE&%3Asubmit=1 --0a6bf76f-F-- HTTP/1.1 200 OK Ajax-Location: ./home Content-Type: text/xml;charset=ISO-8859-1 Expires: Thu, 01 Jan 1970 00:00:00 GMT Pragma: no-cache Cache-Control: no-cache, no-store Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sat, 18-Apr-2015 08:06:08 GMT Strict-Transport-Security: max-age=15768000 Vary: Accept-Encoding Content-Encoding: gzip Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Transfer-Encoding: chunked --0a6bf76f-E-- <ajax-response><redirect><![CDATA[./home]]></redirect></ajax-response> --0a6bf76f-H-- Message: Warning. Pattern match "(.*?)=(?i)(?!.*secure.*)(.*$)" at RESPONSE_HEADERS:Set-Cookie. [file "/etc/modsecurity/activated_rules/modsecurity_crs_55_application_defects.conf"] [line "99"] [id "981185"] [msg "AppDefect: Missing Secure Cookie Flag for rememberMe."] [tag "WASCTC/WASC-15"] [tag "MISCONFIGURATION"] [tag "http://websecuritytool.codeplex.com/wikipage?title=Checks#cookie-not-setting-secure-flag"] Message: Warning. Pattern match "(.*?)=(?i)(?!.*httponly.*)(.*$)" at RESPONSE_HEADERS:Set-Cookie. [file "/etc/modsecurity/activated_rules/modsecurity_crs_55_application_defects.conf"] [line "83"] [id "981184"] [msg "AppDefect: Missing HttpOnly Cookie Flag for rememberMe."] [tag "WASCTC/WASC-15"] [tag "MISCONFIGURATION"] [tag "http://websecuritytool.codeplex.com/wikipage?title=Checks#cookie-not-setting-httponly-flag"] Apache-Handler: proxy-server Stopwatch: 1429430768382701 63597 (- - -) Stopwatch2: 1429430768382701 63597; combined=13093, p1=317, p2=11903, p3=242, p4=130, p5=395, sr=110, sw=106, l=0, gc=0 Response-Body-Transformed: Dechunked Producer: ModSecurity for Apache/2.6.3 (http://www.modsecurity.org/); OWASP_CRS/2.2.5. Server: Apache WebApp-Info: "default" "-" "" --0a6bf76f-Z--
这是在Ubuntu 12.04上运行的Apache 2.2。
谢谢。
你应该build立一个净化规则:
https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#sanitiseArg
5k将密码写入请求体C节。 哪个是POST请求的密码。 我同意你不应该通过GET请求在URLS中使用它们(在这种情况下,它们应该在审计日志的B部分)。
您可以configurationmod_security以禁用logging请求URL。 这是我从下面的configuration中删除的字母B.
SecAuditLogParts ACIFHZ
你可以在这里阅读更多: http : //resources.infosecinstitute.com/analyzing-mod-security-logs/
但是,更大的问题是您要在URL中发送明文密码。 我对Karaf并不熟悉,但如果他们没有更安全的authentication方式,我会感到惊讶。