Skip to content

NotYourRootUser/secure-aws-network-architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Secure Network Architecture: ALB, Bastion Host, and Private EC2

Summary

This project focused on building and securing a three-tier AWS network architecture using an Application Load Balancer (ALB), a Bastion Host, and a private EC2 web instance. The environment was configured with public and private subnet separation, restricted security group rules, and controlled administrative access. During the lab, I also worked through IAM, SSH, and AWS Systems Manager (SSM) recovery issues before restoring secure end-to-end connectivity and validating the final architecture.


Architecture Overview

  • Public Subnet
    • Application Load Balancer (ALB)
    • Bastion Host
  • Private Subnet
    • Web Instance (private-web)
  • Routing
    • Public route table connected to an Internet Gateway
    • Private route table limited to local routing only
  • Access Control
    • Bastion Host allows SSH from my IP only
    • ALB allows HTTP from the internet on port 80
    • Private web instance allows:
      • HTTP from the ALB security group
      • SSH from the Bastion Host security group
  • Administration
    • Used AWS Systems Manager Session Manager for secure management access
    • Injected a temporary SSH key through the AWS CLI when instance access needed to be recovered

VPC Overview

AWS VPC Overview


Network Diagram

AWS Secure Network Architecture

Three-tier AWS network with an ALB, Bastion Host, private EC2 instance, and SSM-based administration.


Troubleshooting Notes

This lab involved several recovery and troubleshooting steps before the architecture worked as intended:

  • Initial SSH attempts from the Bastion Host to the private instance failed with Permission denied (publickey)
  • The IAM role attached for SSM access was missing AmazonSSMManagedInstanceCore, causing send-command operations to fail
  • The private instance became stuck in a stopping state and had to be force-stopped before recovery
  • After attaching the correct IAM policy, I used aws ssm send-command to inject a temporary key into /home/ec2-user/.ssh/authorized_keys
  • File permissions and ownership then had to be corrected using chmod 600 and chown ec2-user:ec2-user
  • Once permissions, IAM access, and security group rules were corrected, SSH access through the Bastion Host to the private instance worked successfully

One of the key lessons from this lab was understanding that the private instance needed SSH access allowed from the Bastion Host security group, not directly from my public IP.


Evidence

# Description Screenshot
01 VPC routes showing Internet Gateway access for the public subnet and local-only routing for the private subnet vpc_routes_20251024
02 Bastion Host running in the public subnet bastion_details_20251024
03 Bastion Host security group restricted to my IP bastion_sg_rules_20251024
04 SSM Session Manager access to the Bastion Host during recovery bastion_session_manager_20251024
05 Private web instance running without a public IP address private_instance_20251024
06 Private instance security group allowing SSH from Bastion SG and HTTP from ALB SG private_sg_rules_20251024
07 Successful SSH chain from Bastion Host to private instance ssh_chain_success_20251025
08 ALB active with listener configured on port 80 alb_overview_20251024
09 ALB security group allowing inbound HTTP from the internet alb_sg_rules_20251024
10 Target group showing a healthy registered instance alb_target_health_20251024
11 HTTP 200 response confirmed through the ALB DNS endpoint alb_http_test_20251024

Verification Summary

Test Command / Evidence Result
ALB Connectivity curl -I http://sp4-alb-454520712.ap-southeast-2.elb.amazonaws.com HTTP 200 OK
Bastion Access AWS Systems Manager Session Manager login Connected securely
Private Isolation No public IP and security group restricted to ALB and Bastion access only Verified
Target Health ALB target group health check Verified
Routing Public subnet via Internet Gateway and private subnet limited to local routing Verified

Reflection

This was one of the most challenging AWS labs I have completed so far because of the number of connected components and the way small configuration mistakes could break the entire access chain. It gave me practical experience with layered AWS security controls, IAM troubleshooting, Session Manager recovery, and secure administrative access design.

Working through the recovery process also reinforced the importance of validating security group relationships carefully, especially when controlling traffic between instances and services inside a VPC.


Next Steps

  • Add HTTPS using ACM certificates
  • Enable CloudWatch monitoring and logging
  • Attach AWS WAF for additional application-layer protection
  • Rebuild the architecture using Terraform
  • Extend the design with KMS encryption and least-privilege IAM hardening

Outcome

Successfully built and validated a three-tier AWS network architecture that uses an Application Load Balancer for public traffic, a Bastion Host for controlled administration, and a private EC2 instance for internal application hosting. The project also included real troubleshooting and recovery work involving IAM, SSM, SSH permissions, and security group design, making it a practical exercise in secure AWS networking.

About

Secure AWS network architecture with ALB, bastion host, private EC2, SSM recovery, and layered access control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors