Lab 11 2 AWS VPC NACLs - nicolas-tullio/Tech-Journal GitHub Wiki

Deliverables

Take Screenshots (2) showing Public Instance webpage from workstation browser on port 80 and 8080

image

image

Curl from Private instance to Public Instance webpage on port 80 and 8080

image

cosmosweb FTP banner from Private Instance

image

Blocked port 8080 to Public Instance Web from your workstation

image

Successful port 8080 curl from Private Instance

image

Blocked/Timed out nc on port 21 from Private Instance to cosmosweb.champlain.edu

image

Public NACL rules

image

image

Private NACL rules

image

image

Steps

You should set up two instances on your Public subnet - one will be a Jump Box-Bastion Host, the other we will use as a web server

image

image

SSH into the instance to be web server

ssh -i nicolas.pem [email protected]

image

Install apache

sudo yum install httpd

Create a text file as /var/www/html/index.html and out your name, class name, and other identifying info (this will be the home page)

image

Edit /etc/httpd/conf/httpd.conf - find "Listen 80" and add a new line that says "Listen 8080" so that your server will listen on both ports

  • Should look like:
Listen 80
Listen 8080

Start the httpd service

sudo systemctl start httpd

Jump Box

SSH into your public instance to be used as a Bastion Host

image

Make sure you can ssh into the other Public Instance from the NAT Instance

image

Make sure you can ssh into the Private instance from the NAT Instance

image

Security Groups Update

Public-Web instance should allow port 80 and 8080 inbound and all outbound

image

Public-Bastion should allow SSH inbound from All and all outbound

image

Private-Instance should allow SSH Inbound from all and all traffic outbound

image

  • NOTE: MAKE SURE TO ASSIGN GROUPS

Test access to your web server, should be able to access

  • Webpage from workstation browser on port 80 and 8080

image

image

  • Curl from Private instance on port 80 and 8080

image

Test FTP access from Private instance

  • Run "nc cosmosweb.champlain.edu 21" from terminal
  • This opens a direct TCP/21 socket to the FTP server
  • Take Screenshot of banner

image

NACLs

In VPC console, create 2 NACLs (Public and Private)

image

image

Public Subnet:

  • Allow Internet access to port 80 on your Public Instance (web server)
  • Allow Private Subnet access to port 8080 on your Public Instance (web server)
  • Block Internet access to port 8080 on your Public Instance (web server)
  • Allow all other inbound access
  • Allow outbound Internet access

image

image

Private Subnet:

  • Allow inbound SSH to your Private Instance from your Bastion-Jump Box Only
  • Allow all other inbound access
  • Block outbound access to FTP (port 21) from Private subnet
  • Allow all other outbound access from the Private subnet

image

image

Update subnet associations for new NACLs