Skip to content

Instantly share code, notes, and snippets.

@AbdullahGhani1
Created October 22, 2020 20:34
Show Gist options
  • Save AbdullahGhani1/72b0295a943909171cebfb247c8d3948 to your computer and use it in GitHub Desktop.
Save AbdullahGhani1/72b0295a943909171cebfb247c8d3948 to your computer and use it in GitHub Desktop.
Application Security - KodeKloud

Application Security

We have a backup management application UI hosted on Nautilus's backup server in Stratos DC. That backup management application code is deployed under Apache on the backup server itself, and Nginx is running as a reverse proxy on the same server. Apache and Nginx ports are 8086 and 8095, respectively. We have iptables firewall installed on this server. Make the appropriate changes to fulfill the requirements mentioned below: We want to open all incoming connections to Nginx's port and block all incoming connections to Apache's port. Also make sure rules are permanent.

Click on ✔ and Do Task Again

Solution:-

Login to backup server and add these two rules

sudo iptables -A INPUT -p tcp --dport 8099 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 6300 -m conntrack --ctstate NEW -j REJECT

Then save it by typing following command

sudo iptables-save > /etc/sysconfig/iptables

Now, check if the rules are added or not

cat /etc/sysconfig/iptables

@SRG89
Copy link

SRG89 commented Dec 22, 2023

I am wondering how u end up getting 8099 as port for nginx service???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment