Hello, I am struggling with this assignment. I have a Ubuntu VM built out in AWS and i got a firewall shell script built out and ran on the server. But this instructor calls for testing inbound connection, like web, email, etc. How do I test this if it's just a plain Ubuntu build, no desktop? After that he wants us to modify the script to allow just SSH, HTTP and HTTPS and test those connections TO the machine. How do I do this? Did I set this firewall script up correctly? And how do I test steps 2 and 3 for just a plain jane Ubuntu command line only server?   Install and configure a Linux operating system (e.g. Ubuntu, Fedora, Debian) on a virtual machine or physical machine. --> You can use an EC2 instance in AWS or DigitalOcean. Install the iptables firewall tool using the package manager of the Linux operating system you installed in step 1 (e.g. sudo apt-get install iptables for Ubuntu). 1. Create a firewall script that blocks all incoming traffic except for incoming SSH connections --> You need to research this part. Save the firewall script and make it executable (e.g. chmod +x firewall.sh). 2. Run the firewall script to activate the firewall and confirm that the firewall is working by attempting to connect to the machine using various services (e.g. web, email, etc.). --> Need to document testing this step 3. Modify the firewall script to allow incoming traffic for specific services (e.g. HTTP, HTTPS) and confirm that these services are now accessible from the Internet --> Need to document testing this step. FIREWALL.SH script: #!/usr/bin/bash # Flush all current iptables rules iptables -F # Set default policies to drop all incoming and forward traffic iptables -P INPUT DROP iptables -P FORWARD DROP # Allow all outgoing traffic iptables -P OUTPUT ACCEPT # Allow incoming SSH traffic iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT # Allow incoming HTTP traffic iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT # Allow incoming HTTPS traffic iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT # Save the new iptables rules iptables-save > /etc/iptables/rules.v4

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello,

I am struggling with this assignment. I have a Ubuntu VM built out in AWS and i got a firewall shell script built out and ran on the server. But this instructor calls for testing inbound connection, like web, email, etc. How do I test this if it's just a plain Ubuntu build, no desktop? After that he wants us to modify the script to allow just SSH, HTTP and HTTPS and test those connections TO the machine. How do I do this? Did I set this firewall script up correctly? And how do I test steps 2 and 3 for just a plain jane Ubuntu command line only server?

 

Install and configure a Linux operating system (e.g. Ubuntu, Fedora, Debian) on a virtual machine or physical machine. --> You can use an EC2 instance in AWS or DigitalOcean. Install the iptables firewall tool using the package manager of the Linux operating system you installed in step 1 (e.g. sudo apt-get install iptables for Ubuntu).

1. Create a firewall script that blocks all incoming traffic except for incoming SSH connections --> You need to research this part.

Save the firewall script and make it executable (e.g. chmod +x firewall.sh).

2. Run the firewall script to activate the firewall and confirm that the firewall is working by attempting to connect to the machine using various services (e.g. web, email, etc.). --> Need to document testing this step

3. Modify the firewall script to allow incoming traffic for specific services (e.g. HTTP, HTTPS) and confirm that these services are now accessible from the Internet --> Need to document testing this step.

FIREWALL.SH script:

#!/usr/bin/bash

# Flush all current iptables rules
iptables -F

# Set default policies to drop all incoming and forward traffic
iptables -P INPUT DROP
iptables -P FORWARD DROP

# Allow all outgoing traffic
iptables -P OUTPUT ACCEPT

# Allow incoming SSH traffic
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT

# Allow incoming HTTP traffic
iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT

# Allow incoming HTTPS traffic
iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT

# Save the new iptables rules
iptables-save > /etc/iptables/rules.v4

 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Network Protocols
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education