Question: in rust programming language Process: The syntax for rules for iptables is provided in detail on the man pages for iptables. Various versions of the
in rust programming language
Process:
The syntax for rules for iptables is provided in detail on the man pages for iptables. Various versions of the man page are available at:
https://manpages.debian.org/unstable/iptables/iptables.8.en.htmlLinks to an external site.
https://linux.die.net/man/8/iptablesLinks to an external site.
https://man7.org/linux/man-pages/man8/iptables.8.htmlLinks to an external site.
or on any Linux system with man pages installed.
For this lab, limit support to the lowest number of options and features needed to support the rules listed below, or additional rules you choose to support.
Based on the syntax, create a set of production rules.
Select a rust parser generator.
Choices include:
https://docs.rs/peg/latest/peg/Links to an external site.
https://pest.rs/book/intro.htmlLinks to an external site.
Create rules based on your determined production rules.
Create a rust program using the parser you generated to validate the given set of rules, as well as invalid versions of the rules (at least twice as many as the given set) and any additional rules you may desire to test.
(Extra Credit) Validate NAT rules. Be sure to use example valid and invalid rules.
Submit a report in the standard format.
Rules to validate:
iptables -A INPUT -s 1.2.3.4 -j DROP
iptables -A INPUT -s 192.168.0.0/24 -j DROP
iptables -A INPUT -i eth1 -s 192.168.0.0/24 -j DROP
iptables -A INPUT -i eth1 -p tcp --dport 80 -j DROP
iptables -A OUTPUT -d 192.168.1.0/24 -j DROP
iptables -A OUTPUT -p tcp -d 69.171.224.0/19 -j DROP
iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
iptables -A INPUT -m state --state NEW -p tcp --dport 25 -j ACCEPT
iptables -A OUTPUT -p tcp -d 192.168.40.0/24 --dport 22 -j ACCEPT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
