File: modsecurity_crs_16_authentication_tracking.conf

package info (click to toggle)
modsecurity-crs 2.2.9-1+deb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 3,064 kB
  • ctags: 219
  • sloc: perl: 1,002; ansic: 727; ruby: 69; makefile: 18
file content (38 lines) | stat: -rw-r--r-- 2,116 bytes parent folder | download | duplicates (2)
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
# ---------------------------------------------------------------
# Core ModSecurity Rule Set ver.2.2.9
# Copyright (C) 2006-2012 Trustwave All rights reserved.
#
# The OWASP ModSecurity Core Rule Set is distributed under 
# Apache Software License (ASL) version 2
# Please see the enclosed LICENCE file for full details.
# ---------------------------------------------------------------


#
# Create an audit log of a successful Authentication.
#                                                                      
# We also set the username in the Session and User collections.  This allows
# for showing the UserID associated with the SESSIONID in any alerts generated.
#
# Must review the ModSecurity audit log data to review what a successful auth attempt
# looks like and then customize this template ruleset for it.
#
#SecRule REQUEST_FILENAME "@streq /path/to/login.jsp" "chain,phase:3,t:none,pass,nolog,auditlog,msg:'Successful Authentication Attempt.',logdata:'Username - %{args.userid}'"
# SecRule REQUEST_METHOD "@streq POST" "chain,t:none"
#  SecRule ARGS:event "@streq LOGON" "chain,t:none"
#   SecRule RESPONSE_STATUS "@streq 302" "chain,t:none"
#    SecRule RESPONSE_HEADERS:Location "@streq http://www.example.com/path/to/login.jsp?event=WELCOME" "chain,t:none"
#     SecRule ARGS:userid ".*" "t:none,setvar:session.username=%{args.userid},setuid:%{args.userid},setvar:session.successful_auth=1"

#
# Create an alert when a user fails authenticating.
#
# Must review the ModSecurity audit log data to review what a failed auth attempt
# looks like and then customize this template ruleset for it.
#
#SecRule REQUEST_FILENAME "@streq /path/to/login.jsp" "chain,phase:3,t:none,pass,log,severity:'2',msg:'Failed Authentication Attempt.',logdata:'Username - %{args.userid}'"
# SecRule REQUEST_METHOD "@streq POST" "chain,t:none"
#  SecRule ARGS:event "@streq LOGON" "chain,t:none"
#   SecRule RESPONSE_STATUS "@streq 302" "chain,t:none"
#    SecRule RESPONSE_HEADERS:Location "@streq http://www.example.com/path/to/login.jsp?event=ERROR&ErrorDesc=Invalid User ID/Password Please try again." "t:none"