Notification when a connection is established
-
Is it possible to setup a notification that a TCP connection has been established? If so please explain which package I would use or point me in the right direction.
Example:
I setup a port forward to access a camera from the outside of my network to the inside. When a connection is made, I would like the firewall to email me to let me know a connection has been established from X.X.X.X (remote client's public IP) going to Y.Y.Y.Y (My camera's private IP)
Thanks in advance.
-
@mikeisfly Using a VPN to connect to your camera would give you instant notification that you're connected...
-
@NollipfSense I'm not trying to connect to the camera remotely I want to be notified when someone else connects to the camera remotely and I don't want to have to log into the firewall and keep refreshing the state table to see if that's done.
-
@mikeisfly That's why you use VPN. Is this your personal camera? Do you give out access to this camera to others?
-
@NollipfSense I know what the purpose of a VPN is. I'm working with a engineer to see if I can get greater compatibility between their software and my cameras. What I'm looking for specifically is the feature I'm asking about. It may not be possible but I think it could be a good diagnostic/information tool. I could look at the logs of the camera, I could refresh the state table of the firewall but this isn't what I'm asking for. I don't want to pull the information I want a notification pushed to me when a event happens (TCP connection to my camera). I can access the camera fine from outside my network.
-
@mikeisfly I am sure you should be able to accomplish the task with a script. You could search if there is such a script or one that you modify to your use. You could also consider may be posting a bounty
-
@mikeisfly : VPN is/was mentioned, because normally, devices like cameras are not accessible 'by the public' from the outside.
I'm using myself a dedicated VPN access set on my home devices and Phone so I can access the companies network, which enables my to launch the app that let's me see all the connected cameras.
By local law (France), I am allowed to use 'snapshots' on our web site (although the first camera is showing our clients up-close ... oops).
With a simple scripts I do receive mails when some one is using a camera VPN access.
I know, really public web cams exist. But imagine : these can be hit by really a lot of IP's (hit by a robot ?) : be ready to send out huge number of mails ...
A solution might be : use a firewall (NAT) pass rule and have it log.
Set up the logging to an external syslog server, and have something like fail2ban to analyse it. fail2ban could ban (not needed here) and also send a mail when a rule hits the criteria (visiting the IP of the camera).pfSense, by itself : you'll be in for some basic shell (bash or Python) scripting.
-
@Gertjan said in Notification when a connection is established:
I know, really public web cams exist. But imagine : these can be hit by really a lot of IP's (hit by a robot ?)
Security cameras are not just put on a network by themselves. There is a recorder, which the cameras connect to. Those cameras should be on their own network, with only the recorder reachable from elsewhere. Many recorders will have 2 network connections for that reason.
-
@JKnott said in Notification when a connection is established:
There is a recorder, which the cameras connect to
That's what I use : a stack of big boxes ( [these](https://www.dahuasecurity.com/products/productDetail/28297 - sorry for the publicity) ) with all the cameras and screens connected to it.
But a typical SOHO camera these days has a Wifi interface, and are used as a local LAN autonomous device. -
I have four Hikvision cameras on my network; so, I was looking at them to see whether the camera could notify...the events doesn't cover network access...only what the camera sees. Also, any robust firewall setup would not include access to LAN without the LAN device initiates the contact.
-
@NollipfSense what about a port forward. If you set that up then the camera will accept connection from the outside provided you have a strong username and password at the end device. Again I'm just looking for a particular functionality pfSense.
-
@mikeisfly Port forward would work if your intent is to give a few accesses to the camera...you might able to may be use Radius and script to email you when that happens. If the intent is to see whether anyone access the camera from the outside well a robust firewall would not allow that.
-
@mikeisfly said in Notification when a connection is established:
Again I'm just looking for a particular functionality pfSense.
There is no such built-in functionality within pfSense (nor any other firewall that I am aware of). The way to do this is to send all logs to an external server or SIEM and then parse the logs there and fire alerts on specific traffic from tools on that external server.
There are many options in the external logging and SIEM world from free to $100,000 USD and more.
-
@bmeeks said in Notification when a connection is established:
@mikeisfly said in Notification when a connection is established:
Again I'm just looking for a particular functionality pfSense.
There is no such built-in functionality within pfSense (nor any other firewall that I am aware of). The way to do this is to send all logs to an external server or SIEM and then parse the logs there and fire alerts on specific traffic from tools on that external server.
There are many options in the external logging and SIEM world from free to $100,000 USD and more.
Thank you. Maybe this is something the development team may want to look at to make the product stand out even more. Not sure who is looking for the feature but it occurred to me a few weeks ago, that it would be nice to have.
-
So like an alert-on-match option maybe?
This is the first time I've seen it requested so there may not be much drive but I could see that being useful.
Steve
-
@stephenw10 said in Notification when a connection is established:
So like an alert-on-match option maybe?
This is the first time I've seen it requested so there may not be much drive but I could see that being useful.
Steve
Yes, that would be awesome.
-
@bmeeks said in Notification when a connection is established:
@mikeisfly said in Notification when a connection is established:
Again I'm just looking for a particular functionality pfSense.
There is no such built-in functionality within pfSense (nor any other firewall that I am aware of). The way to do this is to send all logs to an external server or SIEM and then parse the logs there and fire alerts on specific traffic from tools on that external server.
There are many options in the external logging and SIEM world from free to $100,000 USD and more.
+1 on what Bill said. I can personally recommend an ELK setup which you can send the pfSense logs to. I believe you can then setup alerts on a particular event. ELK is free and can be easily setup on Linux since it's very well documented (even I was able to do it). I've never used ELK for alerting, but I might eventually. Right now it's only for super fast log searches and nice visuals to quickly see things.
-
@mikeisfly said in Notification when a connection is established:
Maybe this is something the development team may want to look at to make the product stand out even more.
I can see this been useful on the camera as part of the camera's event monitoring...just not on a firewall. The day I get that notification is the day the firewall goes in the trash bin. I even block my cameras from going out to check for firmware update.
-
@NollipfSense said in Notification when a connection is established:
@mikeisfly said in Notification when a connection is established:
Maybe this is something the development team may want to look at to make the product stand out even more.
I can see this been useful on the camera as part of the camera's event monitoring...just not on a firewall. The day I get that notification is the day the firewall goes in the trash bin. I even block my cameras from going out to check for firmware update.
Not sure why getting a notification about a event that happened from a connection you explicitly allowed would be a bad thing? I'm looking for this functionality as more of a tracking tool. Like with any service the development team might implement you don't have to use it.
-
@Raffi_ said in Notification when a connection is established:
@bmeeks said in Notification when a connection is established:
@mikeisfly said in Notification when a connection is established:
Again I'm just looking for a particular functionality pfSense.
There is no such built-in functionality within pfSense (nor any other firewall that I am aware of). The way to do this is to send all logs to an external server or SIEM and then parse the logs there and fire alerts on specific traffic from tools on that external server.
There are many options in the external logging and SIEM world from free to $100,000 USD and more.
+1 on what Bill said. I can personally recommend an ELK setup which you can send the pfSense logs to. I believe you can then setup alerts on a particular event. ELK is free and can be easily setup on Linux since it's very well documented (even I was able to do it). I've never used ELK for alerting, but I might eventually. Right now it's only for super fast log searches and nice visuals to quickly see things.
Thanks for the suggestion.