Logo

dev-resources.site

for different kinds of informations.

VPC Flow Logs Setup

Published at
8/20/2024
Categories
vpc
flowlog
cloudwatch
Author
mahpara_jabbar_0521a5b816
Categories
3 categories in total
vpc
open
flowlog
open
cloudwatch
open
Author
25 person written this
mahpara_jabbar_0521a5b816
open
VPC Flow Logs Setup

In the VPC Flow Logs Setup lab, we will configure VPC Flow Logs in AWS to monitor and analyze network traffic within a Virtual Private Cloud (VPC). we will create a VPC with public and private subnets, launch EC2 instances, and enable Flow Logs to capture traffic data, which is then sent to CloudWatch Logs for analysis. This lab provides hands-on experience in using VPC Flow Logs for security monitoring, troubleshooting, and gaining insights into network activity in AWS.

Summary:

  • Create a VPC
  • Create a VPC
  • Create an Internet Gateway
  • Configure Route Tables
  • Launch EC2 Instances
  • Enable VPC Flow Logs
  • Analyze Flow Logs

Create a VPC

  • Login to AWS Management Console.
  • Navigate to VPC under the Networking & Content Delivery section.
  • Click on Create VPC.
  • Name tag: vpc-flowlog-lab
  • IPv4 CIDR block: 10.0.0.0/24
  • Leave the rest of the settings as default and click Create VPC.

Image description

Create Subnets
In your VPC, create two subnets:

Public Subnet:

  • Name tag: PublicSubnet
  • Availability Zone: Choose any available one
  • IPv4 CIDR block: 10.0.0.0/25

Private Subnet:

  • Name tag: PrivateSubnet
  • Availability Zone: Same as the public subnet
  • IPv4 CIDR block: 10.0.0.128/25

Image description

Create an Internet Gateway

  • Navigate to Internet Gateways.
  • Click Create internet gateway.
  • Name tag: vpc-flowlog-igw
  • Attach this Internet Gateway to your VPC.

Configure Route Tables

Public Route Table:

  • Name tag: PublicRouteTable
  • Associate it with the Public Subnet.
  • Edit routes: Add a route with the destination 0.0.0.0/0 and the target as the Internet Gateway.

Image description

Private Route Table:

  • Name tag: PrivateRouteTable
  • Associate it with the Private Subnet.
  • No need to add any routes to the Internet Gateway.

Launch EC2 Instances

Public EC2 Instance:

  • Launch an EC2 instance in the Public Subnet.
  • Instance Type: t2.micro
  • Security Group: Allow inbound SSH (22) and HTTP (80) traffic.

Private EC2 Instance:

  • Launch another EC2 instance in the Private Subnet.
  • Instance Type: t2.micro
  • Security Group: Allow inbound SSH (22) only from the Public EC2 instance's private IP.

Enable VPC Flow Logs

  • Navigate to the VPC Dashboard.
  • Select Flow Logs under Your VPCs.
  • Click Create flow log.
  • Filter: Choose All to capture all traffic (you can also choose Reject or Accept depending on your needs).
  • Destination: Choose Send to CloudWatch Logs.
  • Log Group Name: Create a new log group (e.g., vpc-flowlog-lab-logs).
  • IAM Role: If you don’t have a role, create one with the necessary permissions (the IAM role should allow VPC Flow Logs to publish to CloudWatch Logs).
  • Click Create flow log.

Analyze Flow Logs

  • Navigate to CloudWatch Logs.
  • Find your Log Group and click on it.
  • View the log streams to see the VPC traffic information.
  • You can filter and analyze the logs to see traffic details, such as source/destination IPs, traffic accept/reject status, etc.

Test Traffic Between Instances

  • SSH into the public instance.
  • From the public instance, try to ping the private instance using its private IP.
  • Observe the Flow Logs in CloudWatch to see the traffic being logged.
cloudwatch Article's
30 articles in total
Favicon
Monitoring AWS Infrastructure: Building a Real-Time Observability Dashboard with Amazon CloudWatch and Prometheus
Favicon
A Simple Guide to AWS Monitoring Tools
Favicon
Config AWS Cloudwatch Application Signals Transaction Search with CDK
Favicon
Quickly and easily filter your Amazon CloudWatch logs using Logs Insights
Favicon
Forward logs to Cloudwatch for an EC2 instance running a custom Linux AMI
Favicon
AWS CloudWatch: Implementing Data Protection Policy for Sensitive Log Data!
Favicon
Config AWS Cloudwatch Application Signals for NodeJs Lambda with CDK
Favicon
AWS CloudWatch Logging and Live Tail using AWS CLI!
Favicon
AWS CloudWatch Logging and Live Tail using Python/Boto3 SDK!
Favicon
A Beginner’s Guide to Amazon CloudWatch: Monitoring Your Cloud Like a Pro
Favicon
Automatização de Reboots de Instâncias EC2 com CloudWatch, EventBridge e Lambda
Favicon
Streaming of Desktop Applications Securely on Web Browser Using Amazon AppStream 2.0
Favicon
How to Use Send AWS CloudWatch Metrics to GreptimeCloud by Grafana Alloy
Favicon
AWS CloudWatch Logging and Live Tail!
Favicon
Understanding Logging in Kubernetes - From Containers to Nodes
Favicon
AWS CloudWatch Observability Solutions: Game-Changer or Just a Glossy Wrapper? Honest First Impressions!
Favicon
AWS Lambda Log Aggregation Using CloudWatch Custom Log Group & Logs Insights!
Favicon
AWS Logging, Monitoring & Auditing with AWS CloudWatch and CloudTrail!
Favicon
Amazon CloudWatch Internet Monitor from Amazon Network Load balancer
Favicon
AWS Monitoring - Part 1: AWS CloudWatch
Favicon
AWS Database Migration Service now includes enhanced monitoring dashboard for your DMS tasks
Favicon
CloudWatch CPU Utilization Monitoring with SNS Alert
Favicon
VPC Flow Logs Setup
Favicon
Transfer of Data Across Accounts from S3 to S3 Using AWS DataSync
Favicon
Real-Time Incident Recovery with Event-Driven Microservices Architecture and Early Monitoring
Favicon
Implementing SLO Error Budget Monitoring with AWS Services Only
Favicon
Gerenciamento de alta latência com AWS CloudWatch e AWS Systems Manager
Favicon
Creating Recommended Alarms for Amazon OpenSearch Service with Terraform
Favicon
Automate EC2 Instance Management with AWS Lambda
Favicon
Deep Dive on AWS Clean Rooms with Integration to AWS Glue

Featured ones: