application rule based firewall, any recommendations?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
JaguarNight
Level 3
Level 3
Posts: 121
Joined: Sat Feb 19, 2011 3:06 pm

application rule based firewall, any recommendations?

Post by JaguarNight »

Hi all,

I coded a simple script for command line email sending ( sendemail app ) and was a bit shocked
to find out that it sent out an email without FireStarter firewall giving me any outbound connection alerts,
what the heck is that thing for then ? :o

Anyway I figured that I need application based firewall that would give me alerts on
mint apps/scripts connecting out as well as regular ip/port firewall protection, did a search and
came up with 2 reasonable firewall apps:

1. Linux-org firewall
http://www.linux-firewall.org
looks pretty good
2. TuxGuardian firewall
http://tuxguardian.sourceforge.net/index.php
looks a little dated and

The rest of apps I found were either too simple or discontinued development.

Question: can anybody confirm and recommend either one of these or any other application rule based firewall ?

Regards.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Elisa

Re: application rule based firewall, any recommendations?

Post by Elisa »

Both are dead :|
Think about iptables rules or jail if u need jail, it could help more or fit your needs.
JaguarNight
Level 3
Level 3
Posts: 121
Joined: Sat Feb 19, 2011 3:06 pm

Re: application rule based firewall, any recommendations?

Post by JaguarNight »

I think jail is a different function, it guards apps from messing with file system,
whereas what's needed is a firewall that keeps track of applications connecting out...
Typical linux firewall is only ip/port based, that covers about 50% of it
as fars as controlling applications/connections there ain't nothing there, it's wide open...
Meaning anybody plants a trojan on a more or less standard linux machine, with standard security - they own the machine
from that point on :-)

I will test out both of these and see if any of them work with mint
Linux-org firewall looks suspicious - there is no source code for it...
TuxGuard is more known out there but looking less developed.

Regards.
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: application rule based firewall, any recommendations?

Post by AlbertP »

Gufw is a good firewall included, and can add some registered applications.

But an application rule based firewall is not really needed on Linux. Just set your program to use a fixed port and allow that port in the Gufw firewall which is installed by default (Guarddog for KDE users).
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
DrHu

Re: application rule based firewall, any recommendations?

Post by DrHu »

JaguarNight wrote:The rest of apps I found were either too simple or discontinued development.
You might or might not need an application based firewall, however if you did, then the IPTABLES facility can provide that function..
http://www.symantec.com/connect/article ... ng-support
  • The latter "know" the application-level protocols such as telnet, HTTP or SMTP and can inspect the protocol payloads and verify the commands. This comes at a significant performance penalty since packets have to be processed higher in the network protocol stack in application layer. For each inspected protocol a new proxy should be written. The packet filters, on the other hand, can usually only inspect source and target addresses and ports, TCP/IP flags and have to totally ignore higher-layer protocol payloads. Due to that reason, they are usually much faster than proxy firewalls (3-10 times). Thus proxies are used for more granular security while packet filters are used on higher bandwidth lines for higher throughput.
If you want a particular type of GUI based firewall with enough of those easy to use features, shorewall is a well known one..
http://www.shorewall.net/
Elisa

Re: application rule based firewall, any recommendations?

Post by Elisa »

AlbertP wrote:...Just set your program to use a fixed port and allow that port in the Gufw...
I'm afraid of that it's not such easy...
How you wanna absolutely set an app port to use? What if the app another (not known to you) thread will try to make a connection and wannabe sending any info from your pc, how u wanna guide all 'possible' processes, known&uknown of an app?
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: application rule based firewall, any recommendations?

Post by AlbertP »

By default the firewall is turned off, and that's why you can send/receive things without notice. Just turning the firewall on (allowing outbound, denying inbound) is OK. If inbound is denied, you are safe against hackers and malware.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
JaguarNight
Level 3
Level 3
Posts: 121
Joined: Sat Feb 19, 2011 3:06 pm

Re: application rule based firewall, any recommendations?

Post by JaguarNight »

Some more points:

- Firestarter: I set Outbound traffic policy = restrictive
it basically kill my internet out connections, browser stopped working, etc...
It didn't even ask me if I wanted to connect out using the browser :)
The script I used to test the firewall could not connect out, however the script is not that stupid
it will continue to run in background and wait till you get a hole out, all it needs is 1 second and it sends out ...
Firestarter gave me absolutely no warning on anything trying to connect out, not a script not a browser, no other app
From what I could gather, Firestarter and majority of the rest of firewalls are simply ip/port type firewalls,
overly simplistic. What's needed is a smart firewall that will check outbound as well as inbound per application,
warn on in and out app/ip/port and allow to setup the rules per app/script/prog anyway you wanna call it...

- TuxGuardian developer responded quickly to my email, said it's paused but not abandoned...
He said he never tested it in Mint...
Here is a link to discussion on Ubuntu forums
http://ubuntuforums.org/showthread.php?t=1591340

- linux-org firewall ( looks best but no source, strange ) - no email response...

- Taking a word that one does no need to be concerned about Linux security is same as disregarding the issue...
Anybody smart enough to plant a trojan by app download or through media or machine access or though a hole
from then on pretty much owns your machine...
It looks like the amount of malware for linux is low because simply linux user base is low, so far...
But in actuality planting/penetrating linux machine would probably be easier since there aren't many protection tools yet :D
where as in windows one can install multiple levels of various protection tools that the offender has to figure out how to bypass...
Any linux machine even has all the tools need to compile the ware in background, it ain't funny...
http://ubuntuforums.org/showthread.php? ... ll&page=14
http://www.neowin.net/news/a-history-of ... s-on-linux
http://en.wikipedia.org/wiki/Linux_malware
may have to go commercial here :(

- GUFW/ufw - has only 6 apps in it's list programs and 10 for services, not sure why it's limited...
and there are no on the fly rule creation with alerts, but it's better than firestarter which is only ip/port type rules...
Still better than nothing and better than Firestarter I think.
Regards.
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: application rule based firewall, any recommendations?

Post by AlbertP »

It's not needed to set outbound to restrictive, I think. Linux is very safe so it's enough to block inbound traffic (except some necessary ports).
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
JaguarNight
Level 3
Level 3
Posts: 121
Joined: Sat Feb 19, 2011 3:06 pm

Re: application rule based firewall, any recommendations?

Post by JaguarNight »

You think?
You've downloaded some third party app, installed it with from root, from that point on anything can happen,
the app could install root level script that runs and connects OUT periodically, or it can install user level
script that runs with popular apps already installed in linux and does same thing... :D

It's probably true that penetration from outside is less likely in linux than in windows.
However penetration from inside: download/run, social engineering, direct access or through media is
more likely and once it's in, the only way to find it by catching the OUT connection, standard procedure
and try to catch something that takes under 1 second to run :-)

Anyway,
here is the list of commercial antivirus soft for linux, Panda and Kaspersky
are the only those that have firewall, but OS version is lagging behind +
lack of 64 bit:
some of this commercial soft is free:
http://free.avg.com/us-en/download.prd-alf
http://www.avira.com/en/support-downloa ... ner-scancl
http://www.bitdefender.com/business/ant ... nices.html
http://www.eset.eu/products/nod32-for-linux
http://linux.softpedia.com/get/Security ... 9337.shtml
http://www.pandasecurity.com/lithuania/ ... ons/linux/
http://www.sophos.com/en-us/products/en ... linux.aspx
http://service1.symantec.com/support/en ... 0716014248
http://esupport.trendmicro.com/en-us/sm ... Linux.aspx
http://www.kaspersky.com/linux

Looks like the last one is the best fit..

Regards.
gosa
Level 4
Level 4
Posts: 317
Joined: Mon Nov 01, 2010 5:12 am
Location: Spain

Re: application rule based firewall, any recommendations?

Post by gosa »

Sorry for waking up an old thread (well, not that old) but I wouldn't mind having a firewall that - like for example how my Internet Security Suite from Avira does it...

"Application **** is trying to establish a connection... What do you want to do?"
sanda

Re: application rule based firewall, any recommendations?

Post by sanda »

These links (posted by folks back in 2009, and 2005!) accurately reflect my outlook:
http://www.linuxquestions.org/questions ... ns-710407/
http://askubuntu.com/questions/19346/ho ... plications
=======================

Anyhow, here's some GREAT news:
LeopardFlower APPLICATION-based Firewall for Linux:
http://sourceforge.net/projects/leopardflower/

Personal firewall for Linux OS (based on libnetfilter_queue) which allows to allow or deny Internet access on a per-application basis rather than on a port/protocol basis.


from the README file:

----Leopard Flower 0.4 (released Oct 2011)----

Leopard Flower (LPFW) gives the user control over which applications are allowed to use the network. It consist of a backend/daemon and a graphical frontend.

These instructions apply specifically to Ubuntu 10.10 but are very likely to work on other Linux distributions.

The following packaged must be installed for lpfw to work:
libnetfilter-queue
libnetfilter-conntrack
libnfnetlink

SIMPLE CONFIGURATION:
1. Make sure files lpfw and lpfwgui are in the same folder
2. In a terminal window launch "lpfw" as root
3. In a terminal window of an X session launch "lpfw --gui" as a regular user (not root). You will see the graphical frontend.
4. Is you prefer to use a command line frontend instead of the graphical one, issue "lpfw --cli" in a terminal window of an X session.




ADVANCED CONFIGURATION:
1. If you don't want lpfw to look for lpfwcli/lpfwgui in the same folder, you can pass to lpfw a command line option --cli-path=/--gui-path= followed by a path to lpfwcli/lpfwgui
2. If you want lpfw to start upon system boot-up, lpfw.conf is an upstart script which should be placed into /etc/init.(If your distro doen't use upstart, then the script should be adjusted to your distro's needs). This script expects to find lpfw in /usr/sbin
3. 30-lpfw.conf can be placed into /etc/rsyslog.d if you want logs to go to syslog
4. Assuming lpfw was launched either by upstart or manually as root, in a terminal window of an X session launch "lpfw --cli"/"lpfw --gui" as a regular user (not root). You will see an ncurses-based/graphical frontend.(By default lpfwcli uses zenity popups. If you don't want to use zenity run ./lpfw --cli --no-zenity)




COMMANDLINE ARGUMENTS:
These can be also seen with "lpfw --help".

--rules-file=
File to which rules are commited (default: /etc/lpfw.rules)

--logging_facility=
Where to write logs. Possible values stdout(default), file, syslog

--log-file=
If --logging_facility=file, then this is the file to which to write logging information. Default /tmp/lpfw.log

--pid-file=
Pidfile which prevents two instances of lpfw being launched at the same time. Default /var/log/lpfw.pid

--cli-path=
Path to lpfwcli ncurses frontend. It will be launched in xterm window. Default: in the same folder as lpfw

--gui-path=
Path to a standalone graphical frontend. Default: in the same folder as lpfw

--guipy-path
Path to python-based graphical frontend lpfwgui.py. It will be launched in python. Default: in the same folder as lpfw

--log-info=
--log-traffic=
--log-debug=
Enables different levels of logging. Possible values 1 or 0 for yes/no. Default: all three 1.

To invoke a frontend, issue the following;
lpfw --cli Ncurses
lpfw --gui Standalone
lpfw --guipy Python-based




KNOWN ISSUES:
1. lpfwcli can be invoked only from within X session, it can't work under pure tty(for security reasons).
2. Only one program can send ICMP packets simultaneously, if more than one does, LPFW blocks both.
3. Only IPv4 is supported, IPv6 support is underway.
4. A combination of exceptionally large executables(20Mb+) + slow CPU may result in a 2+ seconds delay when an application connects to the web for the first time, due to heavy calculations performed by sha512 checksumming function.
5. Only TCP, UDP, ICMP (partly, see above) protocols are supported. If your system happens to use any other transport protocol besides TCP/UDP/ICMP and you don't want those packets discarded by lpfw, consider adding a rule to iptables something like: >>> iptables -I OUTPUT 1 -p udplite -j ACCEPT <<< This rule should preceed NFQUEUE rule.
6. Access to network filesystems like NFS, CIFS, SMB an others or to in-kernel servers like khttpd will not be detected by LPFW since such access doesn't create user-space sockets. You will have to manually add iptables rules for such services.
7. If LPFW crashes, the user will have to issue "iptables -F" as root to be able to access the internet without restarting computer.
8. After going to sleep and waking up the PC, LPFW doesn't work properly, it has to be restarted.
9. Albeit lpfwgui is a simple frontend, it consumes 30+ Mb of memory. An attempt to reduce memory consumption is underway.





THE REST OF THIS FILE'S CONTENTS IS TECHNICAL INFORMATION FOR SYSTEM ADMINISTRATORS AND ADVANCED USERS:


HEADLESS MODE - WITHOUT FRONTEND:
If you want to run LPFW without the frontend, you may want to edit the rulesfile manually
By default rules are written to /etc/lpfw.rules in the following blocks of text:

full path to the executable file <new line character>
ALLOW ALWAYS or DENY ALWAYS <new line character>
executable file's size in bytes <new line character>
executable file's sha512 sum in hexadecimal representation <new line character>
(optional line) additional options like [CPUHOG] <new line character>
the block ends with a <new line character>

Example:
--------------------------------------------------
/usr/bin/wget
ALLOW ALWAYS
333356
083c1c88f8ded3cc1d6f83687e3092efab938d6a18ad5f95728189861e9d7bb145651a3a0b7846df69f02f10c50e45361880d4ea2549615a655643ed0bd20fa9
[CPUHOG]

/home/wwwwww/apps/browsers/opera-11.10-2048.i386.linux/lib/opera/opera
ALLOW ALWAYS
16634040
7c4f6bd7c742c4bb8096e18fea5f92c6eade14152cf0ccdd36934b61ce1f578553e65be377408d34727c9aabed4ab3842f8cbbe776cd156d75f160925bea8c9f

---------------------------------------------------------





ARCHITECTURE

LeopardFlower (LPFW) utilizes a facility provided by netfilter whereby all outgoing and incoming packets which initiate a new connection are delivered to LPFW for decision on whether to drop them or accept them. LPFW sets up a rule with iptables similar to
iptables -A OUTPUT -j NFQUEUE --queue-num 11220
and installs a callback (using libnetfilter_queue) which is notified whenever a packet hits the NFQUEUE (NFQ). The fact that LPFW doesn't need to process every single packet but only those which initiate new connections, significantly decreases LPFW's CPU consumption.

Upon start up, LPFW read a rules file (if any was created in the previous session) which contains internet access permissions per application. Based upon these rules, whenever a new packet hits NFQ, LPFW decides whether to allow or deny internet access or whether to ask the user what to do if no rule for the application in question has yet been defined.

In order to establish a correlation between a packet which hit nfq and the application which sent it, LPFW does the following:
1. for an outgoing packet - extract source port (for an incoming packet - extract destination port) and look up in /proc/net/tcp to see which socket corresponds to the port.
2. Having found the socket, scan /proc/<PID>/fd to see which process owns the socket
3 Finally extract the application name from /proc/<PID>/exe

LPFW sets a unique netfilter mark on all connections of a specific app. This enables LPFW to instantly halt all app's internet activity if user chooses so. In order to set such a netfilter mark, LPFW uses libnetfilter_conntrack library.
.

I'm still searching for a linux analogue to the Proxomitron (for browser-agnostic, on-the-fly, blocklist maintenance)
this --------} http://findik.sourceforge.net/d/?q=node/4 seems to the the best (only) candidate
MarkX

Re: application rule based firewall, any recommendations?

Post by MarkX »

I can not believe what I am reading. Oh "Linux is very safe" "you only need to block inbound".......really, is this forum full of obtuse new Linux users....really? Let's have a little security lesson. I'll use that wonderful BSD UNIX base OS X. A good example that effect a mass number of users that think their OS is totaly secure. Go to the app store.....view lion....29.99. Download lion from some source other than the app store. Go back to app store, view Lion, installed. Delete Lion, 29.99. Move Lion to an internal raid (not the OS drive) go back to app store ...installed. Delete Lion....29.99. copy lion to another raid (external but connected to computer) go back....installed. This is all made possible by a "trusted" app from Apple. This app scans your entire computer and information is collected by apple. Easy to prove with an app firewall called Little Snitch. Install Little Snitch block the connection problem solved.


SO NOW by the logic in this forum, many users here absolutly trust without question the apps they install. The Generic answer is well I know what I install.....in many cases..NO YOU DO NOT. Ubuntu does something similar to the Apple app store and it is well documented. The stated reason is so they can suggest apps to you that you may want, based on what you have installed.

Frankly it is no ones business what, programs, music, movies, documents etc.... that I have on my computer or the source of these files.

No I don't trust apps even from a well know source. Advertisers are paying way to much money to programes these days. Information is vital and they want yours. But then again most of these people saying linux is completely secure are probably facebook users and post everytime they go out, or get coffe and what the address is of their coffee house.....ooooo...cool. Plus anyone that thinks any OS is totaly secure is totaly nuts.
sanda

Re: application rule based firewall, any recommendations?

Post by sanda »

No I don't trust apps even from a well know source. Advertisers are paying way to much money to programes these days. Information is vital and they want yours.
I hear ya, loud and clear.
Example:

While distrohopping, I've learned that few distros support my soundcard, so...

...upon installing Kubuntu, I immediately mounted my music partition, browsed to find a random mp3 & double-clicked it to check whether I heard sound. Holy-mother-of-anti-privacy ~~ the "handler" preconfigured for that filetype is "Amarok", and it immediately initiated internet connections to nine "partners" (partners of KDE? of the Amarok team? of Kubuntu?). Who the helll is "jamendo.com", and why the frig do I care?!? Hello -- I wasn't presented any sort of warning, nor provided any opportunity to opt-out... and, per the pre-configured settings, the app telegraphed my playlist to CBS-owned last.fm (under the pretense of "enhancing my user experience" by retrieving "album art") :oops:

With the above in mind, there's no way I'm willing to "trust" KDEs "Konquerer" app
(which is designed to both access your filesystem and to handle/initiate web connections)
and I'm uneasy, in general, regarding the potential "dark side" of KDE-enabled apps having the ability to intercommunicate via the KDE-proprietary "Akonadi" bus. Perhaps these interprocess communications are no more vulnerable than than those utilizing D-Bus... but, it seems to me like KDE wants to "own the whole stack" -- a really baaaaad idea. Has no one learned from the decade-long ActiveX fiasco?

On a related note:
KDE, along with Ubuntu and all its spawn (and probably the Mint distros as well) will soon be adopting lightDM as the pre-installed window manager, rather than GDM, KDM etc. Insanity! LightDM, touted as providing a reputed "benefit" (capable of rendering khtml content as splashscreen eyecandy) launches a rooted, runlevel2 instance of Chromium/Konquer. Hey kids -- free with every bootup -- 30Mb additional overhead & inbuilt browser vulnerabilities!
Sammaul

Re: application rule based firewall, any recommendations?

Post by Sammaul »

I also apologize for posting on an old thread, but has anyone heard of Zone Alarm? It is apparently a program just like little snitch but for linux. If it is useful it may be what we are looking for in addition to a basic firewall
sanda

Re: application rule based firewall, any recommendations?

Post by sanda »

(Not specific to any operating system and, no, an "application based FW" isn't a suitable band-aid here)

Hey kids -- free inside Google Chrome browser (and enabled, by default) -- an inbuilt "remote desktop" app.

"3 preference dialogs deep" within Chrome, yes, there's a setting to toggle off this "feature".
How many (few) people wade through every little preferences dialog?
How many dare to question the presence of this "feature", its (non)value to them, its potential exploitability
...and dare to conclude "no thanks, I don't want remote users/bots/sites to have access"

an example of the "spin" (as parroted by myriad "news" sites):
http://www.tomshardware.com/news/google ... 13449.html

an example of user "confooozion":
http://superuser.com/questions/207183/w ... gle-chrome

of the masses, only 6 non-sheeple have bothered to visit chrome dev site to post W.T.F.is.this?!?
http://www.google.com/support/forum/p/C ... 6472&hl=en

On the horizon (per Google's agenda) is NaCL aka "native client".
Sigh. All your filez are belong to us. The cloud ownz joo...
sanda

Re: application rule based firewall, any recommendations?

Post by sanda »

Sammaul wrote:has anyone heard of Zone Alarm? It is apparently a program just like little snitch but for linux. If it is useful it may be what we are looking for in addition to a basic firewall
Lookit:
http://michigantelephone.wordpress.com/ ... firewalls/

OS X {--- Little Snitch
Windows {--- Zone Alarm (et al)
Linux {--- Leopard Flower
Sammaul

Re: application rule based firewall, any recommendations?

Post by Sammaul »

:oops: I knew that...in either case what do you think of this in addition to using a firewall....one reason I shifted to linux(aside from a general dislike of M$ that slowly changed to hate with each new OS and the need to continuously purchase new software) was to get rid of anti-virus and the system lag it generates
JaguarNight
Level 3
Level 3
Posts: 121
Joined: Sat Feb 19, 2011 3:06 pm

Re: application rule based firewall, any recommendations?

Post by JaguarNight »

Basically Leopard Flower is a good start as "Application Firewall" and so far the only one
Not a lot of users yet, but give it a try.
It's got the potential and lead to become the real firewall.

+ for now I use 2 basic firewalls:
GUFW - comes with Linux Mint
and
Firestarter

These two are mostly useless as far as blocking outbound connections per application and are used for feedback and general security.

Let's keep this thread going...

Regards.
PS. the only reliable way you can catch a trojan or any other "funny business" coming from an application/process is to have a firewall
that carefully monitors your outbound connections, else linux ain't secure for ...t and nobody can claim otherwise
Locked

Return to “Software & Applications”