forked from Merit-Research/AMON
-
Notifications
You must be signed in to change notification settings - Fork 2
/
autoconfig
executable file
·121 lines (101 loc) · 2.45 KB
/
autoconfig
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/perl
sub trim
{
$input = shift;
$input =~ s/^\s+//;
$input =~ s/\s+$//;
return $input;
}
$prologue="# Configuration file. If you remove a parameter the code may not work
# properly. Run amon-senss.configure to generate this file through a
# dialogue\n\n";
open(my $fh, '>', 'as.config');
print $fh $prologue;
print "Welcome to AMON-SENSS configuration. We will ask you a few questions\n";
print "to customize parameters to your needs. You can input new values or\n";
print "press ENTER to keep default values.\n\n";
print "How often (in seconds) should detection process run? (default = 1) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "interval=1\n";
}
else
{
print $fh "interval=" . trim($input) . "\n";
}
print "How much time (in seconds) does each of your input files cover? (default = 3600 or 1h) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "file_interval=3600\n";
}
else
{
print $fh "file_interval=" . trim($input) . "\n";
}
print "What is the shortest attack (in seconds) you want to detect? (default = 30) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "attack_low=30\n";
}
else
{
print $fh "attack_low=" . trim($input) . "\n";
}
print "How long should attack be dormant (in seconds) until we signal its end? (default = 60) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "attack_high=60\n";
}
else
{
print $fh "attack_high=" . trim($input) . "\n";
}
print "How long should we train (in seconds) to learn normal traffic trends? (default = 3600 or 1h) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "min_train=3600\n";
}
else
{
print $fh "min_train=" . trim($input) . "\n";
}
print "How many stdevs around the mean are considered normal range? (default = 5) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "numstd=5\n";
}
else
{
print $fh "numstd=" . trim($input) . "\n";
}
print "What fraction of anomalous traffic should signature cover (0-1, default = 0.25) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "filter_thresh=0.25\n";
}
else
{
$r = trim($input);
print $fh "filter_thresh=" . $r . "\n";
}
print "What is the smallest attack (in pps) you want to detect (>1, default = 1000) ";
$input = <STDIN>;
if (trim($input) eq "")
{
print $fh "min_oci=1000\n";
}
else
{
$r = trim($input);
print $fh "min_oci=" . $r . "\n";
}
print $fh "cusum_thresh=30\n";
print "\n\nConfiguration complete!\n";
close($fh);