This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modSecurityLog="./logs/modsec_audit.log" | |
securityString1="POST /activfoundation/login/oauth/facebook/callback" | |
securityString2="HTTP/1.1 400 Bad Request" | |
detailString="CF-Connecting-IP:" | |
modsecLogFile="./logs/modsec_audit.log" | |
$/ = "-Z--\n"; ## Input Record Seperator to create chunk | |
iparray = [] | |
timeary = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
################################################################## | |
## modruby - a tools for parsing the modsecurity audit logs and ## | |
## taking action. ## | |
################################################################## | |
$modSecurityLog="./logs/modsec_audit.log" | |
$securityString1="POST /activfoundation/login/oauth/facebook/callback" | |
$securityString2="HTTP/1.1 400 Bad Request" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chunk.each_line do |line| | |
if line =~ /CF-Connecting-IP: (\d+.\d+.\d+.\d+)/ | |
cfConntingIp = line.split("CF-Connecting-IP: ", 2) | |
puts cfConntingIp | |
end | |
end |