tnodir / fort

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

Collect blocked connections setting doesn't work properly if Collect Traffic Statistics is disabled. #75

Closed ghost closed 1 year ago

ghost commented 1 year ago

I noticed when I use Collect blocked connections alone, the way it logs the information doesn't work properly in the blocked connections tabs.

The main issue is how it doesn't really update when a connection is blocked, sometimes I can see the stat-block-wal being written in SystemInformer, but it doesn't go to the DB right away. It only updates after many connections have been blocked.

2023-05-03_13-43-10

I tried to show it in that video, as you can see, I am opening Edge, then I opened Settings, then I opened Store, and closed Edge and it finally updated after Store got so many connections it updated everything at once.

Another problem is in the time, It says 1:21 PM but the time of my test was 1:43 PM so it doesn't even match the time of the computer, and it only gives that time, it doesn't change it.

One of the ways to force the update is by unchecking and checking Collect blocked connections, which will enable the button apply, so when you hit apply somehow even if you are not doing anything for the DB it does and it writes the changes.

2023-05-03_13-48-05

In this video I only opened Edge but somehow included the Store, NVIDIA container and all the other connections it didn't show as blocked when I 'pushed' the changes to the DB.

It updates from time to time, but not when you need it, which is a big problem.

Things work okay when Collect Traffic Statistics is on, the blocked connections update right away.

2023-05-03_13-53-28

Time works okay, it updates right away, the only issue I see is how Skype shows in blocked connection as Old connection blocked on startup, but I don't care about that, since I know skype is allowed.

I wouldn't mind having Collect Traffic Statistics on all the time, but the problem is how it is a non-stop writing to disk when any network connection happens, which can be problematic for a lot of reasons in today's disk technology, and since I am always having some network activity, like even when I sleep, sometimes I fall asleep with a stream on, because I barely shutdown my computer, and then after days of running Fort Firewall like that, I have seen GB of written data, on the same place, because even if it is small amount of data being written it will accumulate over time, and then System Informer will show Fort has written GBs of data after days. I don't know if that can be improved, because while traffic is nice to see, it is not as important to be updated right away, while blocked connections is. And since I know it is going to write too much to disk, I don't mind turning Traffic off, and then use Collect blocked connections checkbox you added to Programs and Program groups, to avoid writing blocked connections in apps I don't care about.

Anyway! this is the issue, a little long for what exactly is this feature, but I wanted to make sure I reported the bug, gave some feedback and see if it can be improved!

Thanks for your work!

tnodir commented 1 year ago

Collect blocked connections feature depends on Collect Traffic Statistics flag in the Driver.

Ok, I'll refactor the Driver to always Collect Traffic Statistics (because it's needed for Traffic Graph anyway), but optionally store the stats to DB depending on the flag.

tnodir commented 1 year ago

Fixed in v3.9.0

ghost commented 1 year ago

Blocked connections logger is working nice, thanks! 👍

I noticed a little tiny nothing bug when testing this, but when you have a program already added in Programs list, and you try to Add Program in blocked connections to update it and allow it (or kill it or whatever), the creat_time in DB goes to 0.

I noticed how the Creation Time column in Programs is sorted by the order when they were created (ID?) and not by the time itself, of course since creat_time can only be modified by SQLite editor then it doesn't matter if the column is not sorted if by the order when they were created or the time itself, but since the time now is blank, and it still has the same order, then it looks weird, like, it doesn't make sense not to all the blank ones at the top or the bottom when ordering by time, to see which ones were updated.

tnodir commented 1 year ago

when you have a program already added in Programs list, and you try to Add Program in blocked connections to update it and allow it (or kill it or whatever), the creat_time in DB goes to 0.

Thanks, fixed in v3.9.1.

ghost commented 1 year ago

You are going to kill me but I have a tiny feedback about this. If adding the Program now updates the time as a new rule, then in that case it would make sense to sort the column by creation time and not by the order/id when they were originally created.

If not this is what Fort would show now, which means it is not ordering by Creation Time. image

tnodir commented 1 year ago

If adding the Program now updates the time as a new rule

Thanks, it should not update the creation time.

tnodir commented 1 year ago

Fixed in v3.9.2.