
Boost your defense by mastering attack detection, analyzing attack vectors, and implementing web firewall protection with AWS WAF and CloudWatch, plus practical tips to reduce cyber risk.
About me and cyber security experience
Build a simple Flask API, implement robust exceptions and logging for security, then deploy on AWS with Terraform, configuring WAF and CloudWatch for real-time threat detection and analysis.
Learn to run a Flask task API locally with Docker Compose and a Unicorn server, inspect the Dockerfile and requirements, and verify the app on port 5000.
Explains custom exceptions in a Flask app, featuring an abstract error class and specific errors such as unauthorized, bad request, and not found resource, aligned with RFC 9110.
Learn robust logging and error handling in Flask app using custom and critical exception handlers, with development versus production controls and detailed logs including request IDs for AWS CloudWatch monitoring.
Initialize the Terraform backend with S3 and DynamoDB state, then configure a VPC with public and private subnets, security groups, and bastion access.
Deploy an application load balancer using a real domain, configure Route 53 hosted zone and DNS records, obtain an SSL certificate with AWS Certificate Manager, and provision via Terraform.
Build a Docker image and push it to AWS ECR using prepared bash scripts, configure the repository and environment, and verify image presence in the AWS Console.
Deploy a flask application on EC2 with Terraform using an autoscaling group and launch template, running a Docker container from ECR and sending logs to CloudWatch.
Apply terraform to add an EC2 instance running a Flask app to an AWS application load balancer target group, configure health checks, and route traffic via AWS WAF and DNS.
Discover how AWS WAF protects web applications from XSS, SQL injections, and bot traffic by acting as a reverse proxy and using managed and custom rules.
Explore AWS WAF managed rules as a practical starting point for securing web apps, covering core rule sets including OWASP top ten, capacity considerations, and balancing false positives with customization.
Learn how to log every AWS WAF event to an S3 bucket using a Terraform Web ACL, generate mock requests (including xss and sql injections), and review detailed processing logs.
learn to analyze waf logs with Amazon Athena and S3, set up an Athena results bucket, and create a logs table schema with partition projection for AWS WAF logs.
Analyze waf log data with athena queries by organizing into rule groups, using an excel template, and validating false positives in a test environment.
Follow the AWS WAF managed rules methodology, using a flowchart to select suitable rule groups. Deploy in block mode, reduce false positives, and analyze logs with Athena for version fixes.
Learn how to configure AWS WAF managed rules in blocking mode, applying common rule set exclusions and monitoring results with WAF logs and Athena queries for practical threat detection.
Learn to implement white and black lists in AWS WAF using IP sets and regex pattern sets, with Terraform-driven whitelist and blacklist rules.
Explore how to use AWS WAF custom regex pattern sets to create a MYAPP cookie allow rule and refine a cross-site scripting rule, with notes on managed rules and whitelists.
Discover how AWS WAF rate based rules protect web apps from floods by tracking requests per IP in five-minute windows, implementing blanket, group, and URL-level limits.
Calculate rate thresholds for rate-based rules with Athena and ALB logs, building an ALB logs table and five-minute buckets to reveal peak client IP activity.
Test rate-based rules in practice using Apache Benchmark to simulate high traffic, observe WAF and CloudWatch alarms, review metrics, and reinforce defense with IP blocking and logs analysis.
Understand AWS WAF priority, ordering whitelist, blacklist, rate rules, reputational lists, and OWASP top threats to block HTTP floods and DoS efficiently with regex and specialized rules.
Explore how to use CloudWatch logs to monitor application activity, navigate log groups and streams, and filter for errors and specific events with custom descriptions and Athena queries.
Explore how to use AWS CloudWatch Logs Insights to run queries, filter log messages, and count errors, then visualize them in dashboards and set alarms.
Create custom CloudWatch metrics and alarms to detect abnormal application behavior by counting not found errors and other security events, using Terraform and CloudWatch.
Learn to analyze a cyber attack using WAF and application logs, set a time window around alarms, and identify attacker IP addresses through Athena queries on blocked requests and errors.
Define a time window to group IPs, filter 404/403 events, deduplicate, and blacklist suspects in WAF. Export to CSV and analyze in Excel, continuing the cyber threat analysis next lecture.
Analyze cyber threat data in Excel to identify SQL injection attempts and blocked requests, filtering by status codes and focusing on get requests to separate benign from malicious activity.
What you'll learn:
How exceptions and logging should be organized at web application to become a security defensive tool
How to secure Web application at AWS Cloud
How to configure AWS WAF
How to use AWS WAF managed rules
How to use AWS WAF custom black and white list
How to use AWS WAF custom rate rules
How to configure WAF alarms
How to use CloudWatch as detector of abnormal hacker's behavior
How to build custom CloudWatch filters and alerts upon it
How to use Athena to analyse WAF and application logs
Cyber thread analysis basics using Athena and Excel
Requirements:
Active AWS account
Some active web domain
Basic knowledge at using docker and web programming
Short description:
Current course is about how to secure Web Application against hacker's attacks with AWS cloud solutions using application level, centralized log system and firewall protection. You will also learn a lot about how to provide effective cyber thread analysis during hacker's attack and after it.
COURSE STRUCTURE:
The course starts from creating a very small API application. For that purpose I will use the Python programming language and Flask framework. If you are not aware of current technologies, don't worry, you should not. Believe me, the application would be extremely simple, so anyone, even a child, can understand how it works.
While creating according application I will concentrate at next essential aspects:
Custom exceptions
Logging
I will explain why it is so essential to have those both things at any application and how to make it properly in order it would be helpful from a security defense perspective.
The principles which I will show you are extremely simple and can be easily propagated at any existing web application. You will see the real power of properly done exceptions and logging at your own eyes when we will make real hacker’s attacks simulations at our application after deploying it at AWS cloud
Generally speaking, deploying - it is 2nd essential part of our learning. Together we will deploy our test API application at AWS using Terraform. And again, if you have never used current technology, don’t worry. I will show you step by step, how to run according terraform scripts.
At 1st we will prepare the AWS network, after that we will deploy AWS ALB with WAF, and finally, at the last step, we will deploy our application at EC2 using an auto scaling group. Current pattern of deployment can be easily used by you at production as it is rather cost effective and almost a HA solution. Though as every solution it also has some limitations, which I will discover during Terraform lectures
At deployment section I will speak a lot about different AWS Services, that would be used for creating security defense mechanisms
IAM policies and Security groups as restriction mechanisms to our resources
S3 as place for keeping our ALB and WAF logs
CloudWath as centralized log storage and alarm system
SNS - as mechanism for sending alarm notifications during security attacks detection
I will also touch a little bit Route 53 and Certificate manager services
The deployed Falsk application and all AWS infrastructure around it would be intensively used as a lab environment for imitating different hacker’s attacks and providing a cyber security learning process. That will allow you to perform real practice training and try different security tools and tricks with your own hands. That is why, as for me, it is so essential to have it to be done.
In the third section we will speak about AWS WAF. We will discuss in details:
What resources can we attach WAF at - ALB, API gateway, CloudFront
How properly to configure it
Why correct configurationof AWS WAF is so time consuming process
How to set up AWS WAF managed rules and custom blocking policies
How to analyse WAF and ALB logs using Athena
Why WAF is not silver bullet that can’t protect web app against all possible threats
At current section I will also show you some examples of real attacks that were blocked by WAF taken from my commercial experience, in order you could feel how powerful WAF is as a security defense tool
At 4th section we will discuss deeply AWS CloudWatch service, especially:
how to use our application logs as security detector
how to build custom CloudWatch filters
how to raise alerts in case web application is under the hacker’s attack
how you can be aware of attack even before WAF will detect it, or when WAF could not deal with the problem
In the 5th section we will speak about cyber threat analysis using Atena and Excel after a hacker's attack. We will discuss how to gather all required data using Athena and how to verify if the hacker's actions had any success.
At last section we will make a short summary of all passed practice materials, by creating effective security defense framework, that can be used at any cloud or even at on-premise solutions
Who this course is for:
Anyone who is interested at cyber security or who is responsible for Web resources:
Software engineer
DevOps
Admin
CTO
CEO