Accueil → WINDEV 23 → [WB23] - Adding a Firewall Rule
[WB23] - Adding a Firewall Rule
Débuté par JP, 04 aoû. 2018 10:10 - 4 réponses
Posté le 04 août 2018 - 10:10
Hi All

To prevent a person from endless attempts to log into a website I though a good solution would be to add a blocking rule to the Windows firewall after NN failed attempts. This would just block the person for some time and stop wasting server resources. Does anyone know how to do this in WebDev?

I have code for adding rules to Windows firewall but it must run with Admin privileges. How does one do that in WebDev from on the server?

Posté le 04 août 2018 - 14:57

what firewall? The server firewall? the Client firewall?

If it's the client, I doubt it will be possible, as a browser session will never have the provileges needed.
If it's the server, you coiuld have a windev program running on the server with admin privileges, and in the webdev session just write what you need done somewhere (text file, DB)... the windev exe will read that every x seconds and do what is needed.

Best regards
Posté le 04 août 2018 - 18:46
Hi Fabrice

Server firewall. Yes, this is what I did - another app running looking for firewall requests generated by the WebDev site. Works fine. Was just wondering if it were all possible by WebDev itself in server code but I guess it's a rights issue. Anyway, have a solution.

Posté le 06 août 2018 - 13:53

your answer is inside your question... Yes, of course, it's possible from webdev server code -IF- you give the appropriate permissions to the internet User (iUser, generally)...

It could also probably be a VERY BAD IDEA, security wise.

Best regards
Posté le 06 août 2018 - 23:47
Fabrice, yes agree. Not a good idea to give iuser admin privileges :) My solution works just fine; too many failed attempts and the site creates a file with the IP address to block and the external app running as admin manages both the creation of the temporary firewall rule and the removal of it after a certain time period has elapsed. All good. Cheers.