Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write a firewall in python?

Is it possible to write a firewall in python? Say it would block all traffic?

like image 511
Jake Avatar asked Jul 06 '10 18:07

Jake


People also ask

Can we create a firewall using Python?

Because implementing a system is the best way to understand its underpinnings. we have implemented a firewall using Python and some Netfilter tools. Before going into the details of our implementation, we should give some background on TCP, the Netfilter project, ​pythonnetfilterqueue​, and IPTables.

What programming language is used for firewall?

The firewall algorithm was implemented using Java programming language, which was based on java security architecture. It also utilizes the concept of socket programming which enables network communication over the internet.

Does Linux has a firewall?

The Linux kernel includes the Netfilter subsystem, which is used to manipulate or decide the fate of network traffic headed into or through your server. All modern Linux firewall solutions use this system for packet filtering.


Video Answer


1 Answers

I'm sure in theory you could achieve what you want, but I believe in practice your idea is not doable (if you wonder why, it's because it's too hard to "interface" a high level language with the low level kernel).

What you could do instead is some Python tool that controls the firewall of the operating system so you could add rules, delete , etc. (in a similar way to what iptables does in Linux).

like image 173
Unknown Avatar answered Sep 21 '22 05:09

Unknown