Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 471  / 2 Years ago, sun, november 14, 2021, 6:44:27

The guy who wrote ufw is too smart for me. Is there any documentation for any of the python code?


Some things I'm trying to do are:



  • Allow/close ports by number

  • Get the currently set rules

  • Remove rules


Edit:


My question wasn't specific enough. Everyone here is assuming that I somehow want to reinvent my own interface to iptables, or make some kind of firewall application, when really, I'm just creating a simple ui for ufw that fits into my current application. However, the current state of the ufw python code base makes this a lot harder than it needs to be.


More From » python

 Answers
5

This illustrated tutorial has the answers to the three bulleted points in your question, but it doesn't answer the part of your question about about documentation for any of the Python code. Below is a screenshot of the gufw application from the default Ubuntu repositories that shows how easy it is to get the currently set rules in gufw. Gufw is a graphical front-end to ufw which is itself a front-end to iptables.



enter image description here



If you really want to get down to the code level with ufw, then you're ready to consider using iptables in order to get exactly what firewall rules you want by running commands in the terminal.


[#29934] Monday, November 15, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;