Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : statistics collected with ELK #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions files/conf.maldet
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,28 @@ inotify_verbose="0"
# [ string length in characters, default = 150000 ]
string_length_scan="0" # [ 0 = disabled, 1 = enabled ]
string_length="150000" # [ max string length ]

##
# [ STATISTICAL ELK COLLECT ]
##

# Enable statistic to bring it into ELK stack
# Before enable it, you should verify your firewall settings
# with nc $elk_host $elk_port
# to avoid timeout
enable_statistic="0"

# The host definition for the TCP input
# Must be define if enable_statistic=1
# Example : 192.168.1.1
elk_host=""

# The port definition for the TCP input
# Must be define if enable_statistic=1
# Example : 12345
elk_port=""

# The timeout of the TCP sender
# via netcat
# Example : 1
nc_timeout="1"
7 changes: 7 additions & 0 deletions files/internals/scan.etpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ if [ ! "$tot_hits" == "0" ]; then
if [ -f "$hitlist_file" ]; then
echo "FILE HIT LIST:" >> $tmpf
cat $hitlist_file | column -t >> $tmpf
if [ "$enable_statistic" == "1" ]; then
export IFS=$(echo -en "\n\b")
for showhit in `cat $hitlist_file`; do
echo $showhit|awk -v date=$(date +%s) -v hostname=$(hostname) '{print "{\"date\" : \""date"\", \"hit\" : \""$1"\", \"file\" : \""$3"\", \"hostname\" : \""hostname"\"}"}'|nc $elk_host $elk_port -w $nc_timeout
done
export IFS=' '
fi
fi
fi

Expand Down