IP blacklist

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
User avatar
moccha
Posts: 114
Joined: 13 Feb 2014, 16:09

IP blacklist

Post by moccha »

Hello,

I have methods to detect login abuse with LoginAssistantComponent. I would like to add the attacker's IP address automatically to the server IP blacklist or to the "Banned Ip Address" section.

I can't use banUser because when the user is logging in I can only access the LoginData which doesn't has a user value even though I know what the IP is using session.getAddress. Is there or will there be a way to add banned IPs automatically from server code? Maybe I can do it somehow with getBannedUserManager?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IP blacklist

Post by Lapo »

Hi,
there isn't a way to ban users at login time because, as you mentioned, a User object doesn't exist yet.
You could listen for the USER_JOIN_ZONE event and ban the player at that time, since you do get a User object with that event.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
moccha
Posts: 114
Joined: 13 Feb 2014, 16:09

Re: IP blacklist

Post by moccha »

ok thank you. I made it work by setting session var isMarkedForEvicton in the pre-login function and on the login event like you suggested check for the flag and then ban user.

I want to let you team know that most website documentation leads to an error page, in bing and google searches. Ex - https://docs2x.smartfoxserver.com/api-d ... ssion.html

I see this message - Drat! We could not find the page you have requested. and it says my https connection is not secure as well. please put a priority on fixing this because it may scare new customers.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IP blacklist

Post by Lapo »

Thanks, we're going to deploy an SSL cert. for the doc website soon to fix the problem.
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply