Fastly Integration
The WebDecoy Fastly integration automatically blocks malicious IPs at the edge using Fastly’s Access Control List (ACL) API. When a detection occurs, WebDecoy can instantly add the IP to your Fastly service’s ACL for immediate blocking.
How It Works
Section titled “How It Works”Detection Created │ ▼WebDecoy Rule Engine │ ├─ Check integration rules │ ├─ Event type matches? │ ├─ Bot score threshold met? │ └─ Decoy filter matches? │ ▼Fastly ACL Entry API │ └─ Add IP to ACL block listWhen a detection triggers the integration, WebDecoy calls the Fastly ACL Entry API (POST /service/{service_id}/acl/{acl_id}/entry) to add the IP address to your configured ACL.
Prerequisites
Section titled “Prerequisites”- Fastly account with ACL support
- Fastly API token with appropriate permissions
- An ACL container created and attached to your Fastly service
- VCL configured to block IPs in the ACL
Understanding Fastly ACLs
Section titled “Understanding Fastly ACLs”Fastly Access Control Lists (ACLs) work in two parts:
- ACL Container - A named list attached to your service configuration
- ACL Entries - The actual IP addresses or subnets in the list
ACL entries are “versionless” - once your ACL is attached to an active service version, any updates to the entries take effect immediately without requiring a new service version.
Getting a Fastly API Token
Section titled “Getting a Fastly API Token”- Log in to manage.fastly.com
- Click Account → Personal API tokens
- Click Create Token
- Configure the token:
- Name: “WebDecoy Integration”
- Type: Automation token (recommended)
- Scope: Select your service or Global (all services)
- Role: Engineer or higher
- Click Create Token
- Copy the token immediately (you won’t see it again)
Required Permissions
Section titled “Required Permissions”The API token needs permission to:
- Read service configuration
- Create ACL entries
- Update ACL entries
- Delete ACL entries
Setting Up an ACL in Fastly
Section titled “Setting Up an ACL in Fastly”Before configuring WebDecoy, you need an ACL in your Fastly service:
1. Create the ACL Container
Section titled “1. Create the ACL Container”- Go to your Fastly service
- Click Edit configuration → Clone active
- Click ACLs in the sidebar
- Click Create ACL
- Name it something like
webdecoy_blocklist - Click Create
2. Add VCL to Block IPs
Section titled “2. Add VCL to Block IPs”Add VCL code to your service to block IPs in the ACL:
acl webdecoy_blocklist { # Managed by WebDecoy - do not edit manually}
sub vcl_recv { if (client.ip ~ webdecoy_blocklist) { error 403 "Forbidden"; }}Alternatively, use Fastly’s IP Block List feature:
- Go to Security → IP block list
- Enable the feature
- Select your ACL as the block list source
3. Activate the Configuration
Section titled “3. Activate the Configuration”- Click Activate to deploy the new version
- Note your Service ID and ACL ID for WebDecoy configuration
Finding Your Service ID
Section titled “Finding Your Service ID”- Go to manage.fastly.com
- Click on your service
- The Service ID is shown in the service details (or in the URL)
- Format: alphanumeric string like
SU1Z0isxPaozGVKXdv0eY
Finding Your ACL ID
Section titled “Finding Your ACL ID”- Go to your service in Fastly
- Click ACLs
- Click on your ACL
- The ACL ID is in the URL or details panel
- Format: alphanumeric string like
5clTcvM3wPDCa0fhO7LMbf
Setting Up the Integration
Section titled “Setting Up the Integration”- Go to Integrations in the WebDecoy sidebar
- Click Fastly
- Click Add Fastly Integration
- Fill in the configuration:
| Field | Description |
|---|---|
| Name | A friendly name for this integration |
| API Token | Your Fastly API token |
| Service ID | Your Fastly service ID |
| ACL ID | The ACL ID to add blocked IPs to |
| ACL Name | Optional human-readable name for reference |
| Action | What to do when triggered (see below) |
- Click Create Integration
Action Types
Section titled “Action Types”| Action | Description |
|---|---|
| Block IP | Add the IP to the Fastly ACL (blocked by your VCL) |
| Log Only | Record the event without adding to ACL |
Trigger Configuration
Section titled “Trigger Configuration”Event Types
Section titled “Event Types”Choose when the integration should trigger:
| Option | Description |
|---|---|
| All Detections | Trigger on any detection |
| High Risk Only | Only trigger when bot score >= 80 |
Minimum Bot Score
Section titled “Minimum Bot Score”Set a threshold score (0-100). The integration only triggers for detections with a bot score at or above this value.
Recommended thresholds:
| Use Case | Threshold |
|---|---|
| Aggressive blocking | 50+ |
| Standard protection | 70+ |
| Conservative (fewer false positives) | 85+ |
Decoy Filter
Section titled “Decoy Filter”Optionally restrict the integration to specific decoys. Leave empty to trigger for all decoys in your organization.
Managing Integrations
Section titled “Managing Integrations”View Status
Section titled “View Status”Each integration shows:
- Trigger Count - How many times it has fired
- Failure Count - How many API calls failed
- Last Triggered - When it last fired
- Last Error - Most recent error message (if any)
Test Integration
Section titled “Test Integration”Click Test to verify the integration is working. This sends a test request to the Fastly API.
Enable/Disable
Section titled “Enable/Disable”Toggle integrations on or off without deleting them. Disabled integrations don’t process any detections.
Delete
Section titled “Delete”Remove an integration entirely. This doesn’t remove any IPs already added to your Fastly ACL.
Best Practices
Section titled “Best Practices”- Start with “High Risk Only” to avoid false positives
- Use a conservative bot score threshold initially (75+)
- Create a dedicated ACL for WebDecoy (don’t mix with manual entries)
- Monitor the failure count for API issues
- Test the integration after setup
- Regularly review blocked IPs in Fastly
Don’ts
Section titled “Don’ts”- Don’t use a token with more permissions than needed
- Don’t set the threshold too low (causes false positives)
- Don’t ignore failure counts (may indicate permission issues)
- Don’t manually edit the WebDecoy ACL entries
Troubleshooting
Section titled “Troubleshooting””Unauthorized” or “401” Errors
Section titled “”Unauthorized” or “401” Errors”- Verify your API token is correct
- Check the token hasn’t been revoked
- Ensure the token has permission for the service
- Regenerate the token if needed
”ACL Not Found” or “404” Errors
Section titled “”ACL Not Found” or “404” Errors”- Verify the ACL ID is correct
- Ensure the ACL exists in your service
- Check the service ID is correct
- Verify the ACL is attached to an active service version
”Service Not Found” Errors
Section titled “”Service Not Found” Errors”- Verify the Service ID is correct
- Ensure the API token has access to the service
- Check if the service has been deleted or moved
IPs Not Being Blocked
Section titled “IPs Not Being Blocked”- Check the integration is active (not disabled)
- Verify the event type filters match your detections
- Check the bot score threshold isn’t too high
- Verify your VCL is configured to block IPs in the ACL
- Check that the service version with the ACL is active
- Look for errors in the integration status
High Failure Count
Section titled “High Failure Count”- Check the Last Error message
- Verify API token permissions
- Check Fastly’s status page for outages
- Ensure you haven’t hit API rate limits
Fastly ACL Limits
Section titled “Fastly ACL Limits”Be aware of Fastly’s limits:
| Limit | Value |
|---|---|
| ACL entries per ACL | 10,000 (can be increased) |
| API rate limits | Varies by plan |
Contact Fastly support to increase limits if needed.
Viewing Blocked IPs in Fastly
Section titled “Viewing Blocked IPs in Fastly”To see IPs blocked by WebDecoy:
- Go to your Fastly service
- Click ACLs
- Click on your WebDecoy ACL
- View all entries
- WebDecoy entries include a comment: “Blocked by WebDecoy - Detection [ID]“
Removing Blocked IPs
Section titled “Removing Blocked IPs”WebDecoy doesn’t automatically remove blocked IPs. To unblock:
Via Fastly Dashboard
Section titled “Via Fastly Dashboard”- Go to your Fastly service
- Click ACLs → Your WebDecoy ACL
- Find the IP entry
- Click Delete
Via Fastly API
Section titled “Via Fastly API”curl -X DELETE \ "https://api.fastly.com/service/{service_id}/acl/{acl_id}/entry/{entry_id}" \ -H "Fastly-Key: YOUR_API_TOKEN"Comparison with Other WAF Integrations
Section titled “Comparison with Other WAF Integrations”| Feature | Fastly | Cloudflare | AWS WAF |
|---|---|---|---|
| Edge blocking | Yes | Yes | Yes |
| Immediate updates | Yes (versionless) | Yes | Yes |
| Subnet support | Yes | Yes | Yes |
| IP set management | ACLs | Firewall Rules | IP Sets |
| Setup complexity | Medium | Low | High |
Next Steps
Section titled “Next Steps”- Cloudflare - Alternative WAF integration
- AWS WAF - AWS WAF IP blocking
- Vercel - Edge middleware protection
- Overview - All integrations