Skip to content

Commit cd1ab77

Browse files
committed
Whitelist ISP
1 parent 946d10b commit cd1ab77

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Zolian.Server.Base/Network/Server/BadActor.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public static bool ClientOnBlackList(string remoteIp)
6363
var abuseConfidenceScore = ipdb?.Data?.AbuseConfidenceScore;
6464
var tor = ipdb?.Data?.IsTor;
6565
var usageType = ipdb?.Data?.UsageType;
66+
var isp = ipdb?.Data?.Isp;
6667

6768
// Block if using tor, potentially malicious
6869
if (tor == true)
@@ -72,7 +73,7 @@ public static bool ClientOnBlackList(string remoteIp)
7273
}
7374

7475
// Block if an unauthorized usage type
75-
if (IsBlockedUsageType(usageType))
76+
if (IsBlockedUsageType(usageType) && IsBlockedIsp(isp))
7677
{
7778
LogBlockedType(remoteIp, $"using {usageType}");
7879
return true;
@@ -149,6 +150,15 @@ private static bool IsBlockedUsageType(string usageType)
149150
};
150151
}
151152

153+
private static bool IsBlockedIsp(string isp)
154+
{
155+
return isp switch
156+
{
157+
"Erisco LLC" => false,
158+
_ => true
159+
};
160+
}
161+
152162
public static void ReportMaliciousEndpoint(string remoteIp, string comment)
153163
{
154164
var keyCode = ServerSetup.Instance.KeyCode;

0 commit comments

Comments
 (0)