mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2915] [Feature Request] log the duration of each connecttion #2325
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2325
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @berlin2123 on GitHub (Apr 27, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2915
Describe the feature request
If the duration of each connecttion is loged, we can check if that is a Brute_Force_Attack connections by fail2ban in frps server.
most Brute_Force_Attack connections remains in a short time. So that, we can Identify it by its duration and repetition.
Describe alternatives you've considered
I am unfamiliar with go, so just a sample:
need change file server/proxy/proxy.go
The expect log output like this
It may not be loged for http connections, if it can be Identified.
To reduce log file size, I recommend outputting this connection_duration log as xl.Info.
Affected area
@fatedier commented on GitHub (Apr 28, 2022):
I'm not inclined to this change. There are already timestamps in log info.
But adding connection addresses in
join closedis ok.@berlin2123 commented on GitHub (Apr 28, 2022):
The timestamps now, are indistinguishable for muti-connections at the same time.
such as:
or
All connection is at the same time. And there is no distinguishable ID for each connection. How could you Identify which one is the start and end time of each connecttion.
At the same time, if there has a distinguishable ID for each connection, it will still be hard (need to write another script file, instead of just a few lines in fail2ban conf) to read and analyze out the duration.
However, it will be much easy to log it as a line in log file by the frps.
@berlin2123 commented on GitHub (Apr 28, 2022):
The PR #2916 is added to achieve this Feature now.
@github-actions[bot] commented on GitHub (May 29, 2022):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.