/[smecontribs]/rpms/smeserver-xt_geoip/contribs10/smeserver-xt_geoip-1.3.1-logfiles_changes.patch
ViewVC logotype

Annotation of /rpms/smeserver-xt_geoip/contribs10/smeserver-xt_geoip-1.3.1-logfiles_changes.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Mar 17 06:51:58 2021 UTC (3 years, 7 months ago) by michel
Branch: MAIN
CVS Tags: smeserver-xt_geoip-1_3_1-08_el7_sme, smeserver-xt_geoip-1_3_1-10_el7_sme, smeserver-xt_geoip-1_3_1-20_el7_sme, smeserver-xt_geoip-1_3_1-21_el7_sme, smeserver-xt_geoip-1_3_1-16_el7_sme, smeserver-xt_geoip-1_3_1-13_el7_sme, smeserver-xt_geoip-1_3_1-18_el7_sme, smeserver-xt_geoip-1_3_1-15_el7_sme, smeserver-xt_geoip-1_3_1-12_el7_sme, smeserver-xt_geoip-1_3_1-14_el7_sme, smeserver-xt_geoip-1_3_1-11_el7_sme, smeserver-xt_geoip-1_3_1-09_el7_sme, smeserver-xt_geoip-1_3_1-07_el7_sme, smeserver-xt_geoip-1_3_1-17_el7_sme, smeserver-xt_geoip-1_3_1-19_el7_sme, HEAD
make: « clog » est à jour.

1 michel 1.1 diff -urN smeserver-xt_geoip-1.3.1.old/root/usr/share/xt_geoip/geoip_stats smeserver-xt_geoip-1.3.1/root/usr/share/xt_geoip/geoip_stats
2     --- smeserver-xt_geoip-1.3.1.old/root/usr/share/xt_geoip/geoip_stats 2020-06-07 23:12:41.000000000 +0400
3     +++ smeserver-xt_geoip-1.3.1/root/usr/share/xt_geoip/geoip_stats 2021-03-16 23:40:49.839000000 +0400
4     @@ -11,14 +11,14 @@
5     PREF="ssh"
6     LOGDIR="/var/log/sshd"
7     CMD1='cat'
8     - CMD2=' | /usr/local/bin/tai64nlocal | grep'
9     + CMD2=' | grep -i '
10     CMD3=' | grep -E "(Failed password|Invalid user \w+ from)" | sed -e "s/^.*from //" -e "s/ port.*$//" >> $RESFILE'
11     ;;
12     "ipt")
13     PREF="ipt"
14     LOGDIR="/var/log/iptables"
15     - CMD1='cat'
16     - CMD2=' | /usr/local/bin/tai64nlocal | grep '
17     + CMD1='zcat -f '
18     + CMD2=' | grep -i '
19     CMD3=' | grep "GeoIP BAN" | sed -e "s/^.*SRC=//" -e "s/ DST=.*$//" >> $RESFILE'
20     ;;
21     *)
22     @@ -26,6 +26,8 @@
23     exit 1
24     ;;
25     esac
26     +
27     +
28     # files of the day
29     RESFILE="$STATDIR/${PREF}_ip.lst"
30     RES2FILE="$STATDIR/${PREF}_country.lst"
31     @@ -35,6 +37,8 @@
32     # tempo
33     TMPFILE=$(mktemp $STATDIR/xt_${PREF}.XXXXXXX)
34     # Day - 1
35     +MONTH=$(date --date '1 day ago' +%B)
36     +LOGDAY="${MONTH:0:3} $(date --date '1 day ago' +%d)"
37     DATE=$(date --date '1 day ago' '+%Y-%m-%d')
38    
39     cd $EXECDIR
40     @@ -54,8 +58,8 @@
41     # All logfiles update for 2 days, not empty
42     for file in $(find $LOGDIR/* -type f -mtime -2 -size +50c)
43     do
44     - #echo $(echo $CMD1 $file $CMD2 "$DATE" $CMD3)
45     - eval $(echo $CMD1 $file $CMD2 "$DATE" $CMD3)
46     +# echo $(echo $CMD1 $file $CMD2 "'^$LOGDAY'" $CMD3)
47     + eval $(echo $CMD1 $file $CMD2 "'^$LOGDAY'" $CMD3)
48     done
49    
50     # number of incidents by IP, sorted by IP
51     @@ -85,4 +89,3 @@
52     echo "parse $LOGDIR for $PREF events"
53     cat $RES2FILE
54     fi
55     -

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed