tnodir / fort

Fort Firewall for Windows
GNU General Public License v3.0
1.1k stars 96 forks source link

Allow/block the path by command line argument #231

Closed tnodir closed 2 months ago

tnodir commented 2 months ago

It's possible now to use FortFirewall.exe -c prog add <PATH> to open a Program Edit dialog.

Also add ability to allow/block a path by not opening the dialog: FortFirewall.exe -c prog {allow|block} <PATH>.

WGZero05 commented 2 months ago

It's possible now to use FortFirewall.exe -c prog add <PATH> to open a Program Edit dialog.

Also add ability to allow/block a path by not opening the dialog: FortFirewall.exe -c prog {allow|block} <PATH>.

This is so cool then. Please do it. The sooner the better. I too want to block programs with no gui window. Only in silent mode. 🙏🏻 Thanks! 🙇🏻‍♂️

WGZero05 commented 2 months ago

Please also include how to block ip addresses without opening the fort firewall. thanks!

e.g: FortFirewall.exe -c prog {allow|block} <172.0.0.1>

tnodir commented 2 months ago

Please also include how to block ip addresses without opening the fort firewall.

Sorry, it's out of scope for now.

I'm adding ability to set Rules for Programs (address/ports/etc) at the moment. But addresses will be assigned to Rule, not Program.

tnodir commented 2 months ago

BTW, why do you need allow/block addresses for an app without opening a window?

WGZero05 commented 2 months ago

Please also include how to block ip addresses without opening the fort firewall.

Sorry, it's out of scope for now.

I'm adding ability to set Rules for Programs (address/ports/etc) at the moment. But addresses will be assigned to Rule, not Program.

sorry ma bad. I mean blocking ip adresses in rule and not in program. Same as in Windows Firewall inbound and outbound. I had blocked ip adresses in my windows firewall 2 months ago and I've decided to block them as well with ur amazing app.

Emi-Emi-Emi commented 2 months ago

This is working great, nice addition!

I used it with PowerToys Run and it was nice not to have to open the UI just to allow or block a program for few seconds.

But terminal makes it easier to manage programs, with scripts and all that, so the more CMD support the better, especially since Windows started supporting OpenSSH out of the box, where editing the DB through terminal was not the easiest thing to manually add programs and all that.

is it possible to do this with wildcard programs too?

tnodir commented 2 months ago

is it possible to do this with wildcard programs too?

Let me see, what can I do..

tnodir commented 2 months ago

@Emi-Emi-Emi Please check the v3.12.3-test07.

Emi-Emi-Emi commented 2 months ago

@tnodir how do you deal with wildcard programs that have multiple programs on it? seems to work when single path wildcard programs when you add the wildcard character paths, but how to handle the multiple paths wildcard programs?

tnodir commented 2 months ago

but how to handle the multiple paths wildcard programs?

Adding and editing the multiple paths is only via UI.

But you can still allow/block a Program entry with multiple wildcard paths via workaround:

For example:

Emi-Emi-Emi commented 2 months ago

@tnodir oh nice workaround! I usually add comments in my wildcard programs, but didn't test that. Using comments also helps to workaround wildcard programs with variables paths too if anything.

Thanks, amazing feature as always! 👍

tnodir commented 2 months ago

I usually add comments in my wildcard programs, but didn't test that.

You have to re-save wildcard programs to populate a "path" column of "app" table in DB.

Emi-Emi-Emi commented 2 months ago

Oh I see, I get what Fort is doing now! I went ahead and re-saved all wildcard apps, so I can see even variable paths work and all .👍; and then comments just make it easier to handle wildcard programs. Thanks again!

tnodir commented 2 months ago

Implemented in v3.12.3.

tnodir commented 2 months ago

Got a request via email to send commands directly to Service.

Now the commands are processed by UI process, because of security reasons.

I plan to allow it to connect directly to Service, when no password is set.