Skip to content

AWS WAF Integration

Block malicious IPs using AWS Web Application Firewall (WAF) IP sets.

  • AWS account
  • AWS WAF v2 configured
  • IAM credentials with WAF permissions
  • An existing IP set in WAF

Create an IAM policy with these permissions:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"wafv2:GetIPSet",
"wafv2:UpdateIPSet",
"wafv2:ListIPSets"
],
"Resource": "*"
}
]
}

For production, restrict to specific resources:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"wafv2:GetIPSet",
"wafv2:UpdateIPSet"
],
"Resource": "arn:aws:wafv2:us-east-1:123456789012:regional/ipset/webdecoy-blocklist/*"
},
{
"Effect": "Allow",
"Action": "wafv2:ListIPSets",
"Resource": "*"
}
]
}

Before configuring the integration, create an IP set in AWS WAF:

  1. Go to AWS WAF Console

  2. Select your region

  3. Go to IP sets

  4. Click Create IP set

  5. Configure:

    FieldValue
    Namewebdecoy-blocklist
    RegionYour application’s region
    IP versionIPv4
  6. Click Create IP set

  7. Copy the IP set ID

  1. Go to AWS WAF Console

  2. Switch to Global (CloudFront)

  3. Go to IP sets

  4. Click Create IP set

  5. Configure:

    FieldValue
    Namewebdecoy-blocklist-global
    RegionGlobal (CloudFront)
    IP versionIPv4
  6. Click Create IP set

  7. Copy the IP set ID

  1. Go to Integrations → AWS WAF

  2. Click Add AWS WAF Integration

  3. Enter credentials:

    FieldDescription
    Access Key IDAWS IAM access key
    Secret Access KeyAWS IAM secret key
    RegionAWS region (e.g., us-east-1)
  4. Configure IP set:

    FieldDescription
    IP Set IDWAF IP set ID
    IP Set NameName for reference
    ScopeREGIONAL or CLOUDFRONT
  5. Click Connect

ScopeUse Case
REGIONALALB, API Gateway, AppSync
CLOUDFRONTCloudFront distributions

After setting up the IP set, create a rule to block IPs:

  1. Go to AWS WAF → Web ACLs

  2. Select your Web ACL

  3. Go to Rules

  4. Click Add rules → Add my own rules

  5. Configure:

    FieldValue
    Rule typeIP set
    Namewebdecoy-block-rule
    IP setSelect your IP set
    ActionBlock
  6. Click Add rule

Place the WebDecoy block rule early in your rule list for fastest blocking.

Configure when to add IPs to the block list:

  1. Go to Integrations → AWS WAF → Rules

  2. Click Add Rule

  3. Configure:

    SettingDescription
    Rule TypeBlock All or Block by Score
    DecoyWhich decoy triggers blocking
    Score ThresholdMinimum score (if by score)
  4. Click Create Rule

ScenarioScore Threshold
High security50+
Standard70+
Conservative85+
Detection Created (score: 85)
AWS WAF Rule Evaluated
├── Score >= Threshold? → Yes
Update IP Set via AWS API
├── Add IP: 192.168.1.100/32
WAF Rule Blocks IP
Future requests from IP are blocked

Be aware of AWS WAF limits:

LimitValue
IPs per IP set10,000
IP sets per region100
IP sets per Web ACL10

WebDecoy automatically manages IP set size:

  • Old entries are removed when approaching limits
  • IPs are removed after configured duration
  1. Go to Integrations → AWS WAF
  2. Click View Blocked IPs
  3. See:
    • IP address
    • Block reason
    • Added timestamp
    • Manual unblock option

From WebDecoy:

  1. Find IP in blocked list
  2. Click Unblock
  3. IP is removed from AWS WAF IP set

From AWS Console:

  1. Go to WAF → IP sets
  2. Select your IP set
  3. Remove the IP address

For applications in multiple regions, create separate integrations:

IntegrationRegionIP Set
US Eastus-east-1webdecoy-blocklist-use1
EU Westeu-west-1webdecoy-blocklist-euw1
GlobalCloudFrontwebdecoy-blocklist-global
  • ✅ Use minimal IAM permissions
  • ✅ Create dedicated IP set for WebDecoy
  • ✅ Monitor IP set size
  • ✅ Set reasonable score thresholds
  • ✅ Test blocking before production
  • ❌ Use root AWS credentials
  • ❌ Share IP set with other tools
  • ❌ Set threshold too low
  • ❌ Forget to create WAF rule for IP set
  1. Verify IAM permissions include required actions
  2. Check credentials are correct
  3. Ensure region matches IP set region
  4. For CloudFront, use CLOUDFRONT scope
  1. Verify IP set ID is correct
  2. Check region matches
  3. Ensure scope (REGIONAL/CLOUDFRONT) is correct
  4. Verify IP set exists in AWS console
  1. Verify integration is connected (green status)
  2. Check blocking rule is enabled in WebDecoy
  3. Verify WAF rule exists for the IP set
  4. Check Web ACL is associated with your resource
  5. Verify rule priority in Web ACL
  1. Increase IP set limit (contact AWS)
  2. Reduce block duration
  3. Increase score threshold
  4. WebDecoy auto-removes oldest entries

AWS WAF pricing:

  • Web ACL: $5/month
  • Rule: $1/month
  • Requests: $0.60 per million

The WebDecoy integration doesn’t add significant cost beyond existing WAF usage.