Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
804ebfca
Commit
804ebfca
authored
Nov 19, 2020
by
david
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ban
parent
ee988af7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
script/sign_up_abuse_new.pl
script/sign_up_abuse_new.pl
+4
-4
No files found.
script/sign_up_abuse_new.pl
View file @
804ebfca
...
...
@@ -28,7 +28,7 @@ use warnings;
## open the log file. we are using the system binary tail which is smart enough
## to follow rotating logs. We could have used File::Tail, but tail is easier.
open
(
LOG
,"
/usr/bin/tail -
90
000000
$log
|
")
||
die
"
ERROR: could not open log file.
\n
";
open
(
LOG
,"
/usr/bin/tail -
1
000000
$log
|
")
||
die
"
ERROR: could not open log file.
\n
";
while
(
<
LOG
>
)
{
## process the log line if it contains one of these error codes
...
...
@@ -36,7 +36,7 @@ use warnings;
{
## Whitelisted ips. This is where you can whitelist ips that cause errors,
if
(
$_
!~
m/^(
66\.249
\.|192\.168\.)/
)
if
(
$_
!~
m/^(
127\.0
\.|192\.168\.)/
)
{
## extract the ip address from the log line and get the current unix time
...
...
@@ -54,8 +54,8 @@ use warnings;
if
(
$abusive_ips
{
$ip
}
->
{
'
errors
'
}
>=
3
)
{
print
"
abuse from ip
$ip
username
$username
\n
";
print
"
fail2ban-client set manban banip
$ip
\n\n
"
;
print
"
abuse from ip
$ip
username
$username
, trigged manban with fail2ban
\n
";
system
("
fail2ban-client set manban banip
$ip
")
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment