AWS WAF for Beginners

Beginner
10 min read
Updated: Nov 2026
4 steps
No coding required

What Is AWS WAF?

AWS WAF means Web Application Firewall. Think of it as a door guard for your website.

Every time someone opens a page or calls your API, a request arrives. WAF can look at that request and decide:

  • Allow — let it in.
  • Block — stop it.
  • Count — note it, but still let it in (safe for learning).

You write these choices as rules. A group of rules is called a web ACL (say it like “web A-C-L”). Then you attach that web ACL to the service that faces the internet—often CloudFront or an Application Load Balancer.

Beginner tip.

You do not need to write code for this tutorial. You click in the AWS console.

In Simple Words

What problem does it solve?

Your site is public. Anyone on the internet can send requests. Most requests are fine. Some try to break your app (for example by sending strange text in a form). WAF helps catch many of those bad patterns early.

Is WAF the same as a password?

No. Login and passwords are for who the user is. WAF is about what the request looks like—IP address, URL, headers, and body text.

When should a beginner use it?

After your site already loads with HTTPS. Learn CloudFront or an ALB first. Then add WAF as an extra safety layer.

A tiny traffic picture

Visitor → WAF check → CloudFront or load balancer → your app. If WAF blocks the request, your app never has to handle it.

Golden rule for beginners.

Use Count first. Watch for a while. Switch to Block only when you trust the rule.

Want the official page?

AWS explains the product at aws.amazon.com/waf and in the WAF developer guide.

Words You Will See

Do not memorize these. Just come back when the console shows a new word.

WordPlain meaning
Web ACLYour list of security rules for the website door
RuleOne check, like “if this looks like an attack, Count it”
Managed rulesReady-made rule packs written by AWS (good starting point)
AllowLet the request continue
BlockStop the request
CountLog a match but do not stop the user yet
Default actionWhat happens if no rule makes a decision (usually Allow for public sites)
AssociateConnect the web ACL to CloudFront, an ALB, or another supported service

What You Need First

Before you click Create, have these ready:

  • An AWS account you can sign in to.
  • A working public site on CloudFront or an Application Load Balancer.
  • A normal page URL you can open in a browser to test that the site still works after WAF is attached.
Practice on a test site if you can.

Do not learn Block mode on your only production homepage.

Step-by-Step

Four small steps. After each step, your site should still open in the browser.

Step 1 — Create an Empty Web ACL

This is only the empty rule book. Nothing is blocked yet.

  1. Sign in to the AWS console.
  2. Search for WAF & Shield and open it.
  3. Choose Web ACLs, then Create web ACL.
  4. Choose where it will be used:
    • CloudFront distributions if users hit CloudFront first.
    • Regional resources if users hit an ALB (or similar) first.
  5. Give it a clear name, like my-site-waf.
  6. For a normal public website, set the default action to Allow.
  7. Continue through the wizard. You can add rules in the next step.

How It Works

  1. You created the rule book, not the lock yet.
  2. CloudFront and ALB need different scopes. Pick the one that matches your door.
  3. Default Allow means: if no rule says otherwise, the visitor can still enter.
  4. Your live site is unchanged until you associate this ACL in Step 3.

Step 2 — Add Ready-Made Rules (Count Mode)

AWS already wrote good starter rules. Turn them on gently.

  1. In your web ACL, open Rules.
  2. Choose Add rules → Add managed rule groups.
  3. Enable a common pack (often named like Core rule set / common rule set).
  4. Set the action to Count while you learn.
  5. Save the rules.

How It Works

  1. Managed rules are AWS’s starter checklist for common web attacks.
  2. Count is practice mode: AWS notes matches, users still get the page.
  3. You are not blocking anyone yet, so this step is low risk.
  4. Later you can flip Count to Block for rules you trust.
Do not jump to Block on day one.

Some normal forms and admin pages can look “suspicious” to strict rules. Count first.

Step 3 — Attach the Web ACL to Your Door

Now connect the rule book to CloudFront or your load balancer.

  1. Open your web ACL.
  2. Find Associated AWS resources (wording can vary slightly).
  3. Choose Add AWS resources.
  4. Select your CloudFront distribution or your ALB.
  5. Save, wait a minute or two, then open your site in a browser.
CloudFront screen where you can enable AWS WAF
CloudFront (example)

How It Works

  1. Association means: check every request at this door.
  2. CloudFront attachment filters traffic near visitors (the edge).
  3. ALB attachment filters traffic when visitors talk to the load balancer directly.
  4. If the homepage still loads, the attach step worked and Count rules are not blocking you.

Step 4 — Watch the Matches, Then Tighten

Learn what WAF sees before you change user experience.

  1. Browse your site like a normal user for a while.
  2. In WAF, open the overview or sampled requests for your web ACL.
  3. Look for rules that fire on normal pages. Those may need softer settings later.
  4. When a rule looks trustworthy, change that rule from Count to Block.
  5. Test the site again after each change.

How It Works

  1. Sampled requests are examples of traffic that matched a rule.
  2. Your goal is fewer surprises, not maximum Block on day one.
  3. Change one thing at a time so you know what broke the site if something goes wrong.
  4. Keep a way back: you can switch a rule back to Count or remove the association.

Common Beginner Mistakes

Blocking before watching

Turning on Block immediately can lock out real users. Use Count first.

Wrong door type

A CloudFront web ACL will not show up for an ALB, and the other way around. Create the matching type.

Protecting the wrong place

If visitors use CloudFront, put WAF on CloudFront. Putting it only on a hidden origin often misses the public traffic.

Default Block with no allow rules

For a public site, default Allow is safer while you learn. Default Block can take the whole site offline.

Too many paid extras at once

Start with a small managed pack. Add CAPTCHA or bot packs later when you understand the basics.

Thinking WAF replaces HTTPS

You still need certificates from ACM and a solid HTTPS setup.

Key Takeaways

  • WAF is a door guard for website and API requests.
  • A web ACL holds the rules you attach to CloudFront or an ALB.
  • Count → watch → Block is the safe learning path.
  • You do not need code to complete this beginner setup in the console.

One line: create a web ACL, add managed rules in Count mode, attach it to your public door, then Block only what you trust.

Frequently Asked Questions

AWS WAF is a filter that checks website and API requests and can allow them, block them, or only count them so you can see what would have been blocked.
No. First get your site working on CloudFront or an Application Load Balancer. Add WAF when you want extra protection against common web attacks and noisy bots.
Turn it on at the door users hit first. If people use CloudFront, attach WAF to CloudFront. If people go straight to an Application Load Balancer, attach WAF there.
Count means: notice the request and write it down, but still let it through. Use Count while you learn, so you do not lock out real users by mistake.
No. It helps against many common web attacks, but it is one layer. You still need good app code, HTTPS certificates, and careful access settings.
Yes. You usually pay for the web ACL, the rules, and each request WAF checks. Start with a few rules. Check the current AWS WAF pricing page before you use it on a busy site.

Next: Amazon API Gateway

Learn the managed front door for APIs—another place WAF can help later.

API Gateway overview →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful