Fastly Integration
The WebDecoy Fastly integration has two halves:
- Detection: Fastly streams every request your service answers to WebDecoy, which reports the automated ones, including crawlers that never run JavaScript, with their TLS fingerprint. See Detection with log streaming.
- Protection: WebDecoy adds addresses to a Fastly Access Control List (ACL) that your VCL blocks. You can do this by hand today; automatic blocking from detections is built but withheld until scores are calibrated (see Block an Address by Hand).
How It Works
Section titled “How It Works”Detection Created │ ▼WebDecoy Rule Engine │ ├─ Check integration rules │ ├─ Event type matches? │ ├─ Score threshold met? │ └─ Decoy filter matches? │ ├─ Automatic blocking enabled for this scorer version? │ (currently withheld until calibration) │ ▼Fastly ACL Entry API │ └─ Add IP to ACL block listWhen automatic blocking is enabled and 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 the ACL name 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
Your ACL name, not its ID
Section titled “Your ACL name, not its ID”Fastly’s dashboard lists ACLs by name and does not show their IDs, so WebDecoy asks for the name. Enter it exactly as it appears under Access control lists (for example webdecoy_blocklist) and WebDecoy looks up the ID with your API token when you save. If no ACL of that name exists on the active service version, the integration is not saved and the message says so.
If you already have the ACL ID (from the Fastly API or CLI), you can enter it instead.
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 name | The ACL to add blocked IPs to, as named in Fastly |
| ACL ID | Optional. Leave empty and WebDecoy looks it up from the name |
| Action | What to do when triggered (see below) |
- Click Create Integration
Detection with Log Streaming
Section titled “Detection with Log Streaming”Log streaming is detection, so it is included on the Free plan. On Free, create the integration with the Log Only action; Block IP requires a paid plan or an active trial.
Fastly’s HTTPS logging endpoint sends WebDecoy the requests your service answered: client IP, user agent, path, status, cache result and the TLS fingerprint (JA4). WebDecoy reports the automated ones to your dashboard and drops the rest; ordinary visitors are never stored. Nothing changes in your responses.
Because the stream includes your scripts and styles, WebDecoy also reports page requests from a browser user agent whose visit never fetched them: a scraper copying a browser’s name takes the HTML and leaves. Each page is held for 45 seconds so its assets can arrive in later batches, and a page is left undecided rather than guessed when the evidence is missing. See A browser that never drew the page.
It needs the integration tied to one site, so its rows land on that site.
-
On the integration, under Detection: log streaming, select Set up log streaming. WebDecoy shows a URL, a custom header, a log format and the options to set. Copy the header value now: it is shown once.
-
In Fastly, open the service, then Logging, and create an HTTPS endpoint:
Fastly field Value URL The URL WebDecoy showed Custom header name X-WebDecoy-Log-SecretCustom header value The secret WebDecoy showed Log format The format WebDecoy showed, pasted as is Content type application/x-ndjsonJSON log entry format Newline delimited Maximum bytes 5000000Compression None or gzip -
Activate the new service version. Before its first delivery, Fastly checks that WebDecoy expects your service; WebDecoy answers for services with streaming turned on.
-
Prove it:
curl -A "WebDecoy-Test/1.0" https://your-site.example/. A detection labeled Test appears once Fastly delivers the log. The first delivery after activating a version can take about five minutes; after that, Fastly sends a batch every few seconds from each location that served traffic. The integration shows the last delivery and how many requests it reported.
Replace secret issues a new URL and secret; the old ones stop working at once. Turn off stops WebDecoy accepting the stream; remove the logging endpoint in Fastly too.
Requests Fastly logs again at a shield POP are counted once.
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 Detections (Score >= 80) | Only trigger when the detection’s bot score is 80 or higher |
Minimum Score (optional)
Section titled “Minimum Score (optional)”Set a threshold score (0-100). The integration only triggers for detections whose threat score (unified_score, or the bot score when there is none) is 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 check the connection. WebDecoy asks Fastly, read-only, whether the stored token can read the configured ACL, and shows Fastly’s own answer if it cannot (for example a token without write access, or an ACL name that does not exist). A test changes nothing at Fastly and does not count as a trigger.
Block an Address by Hand
Section titled “Block an Address by Hand”Automatic blocking acts only on detections whose score has been calibrated, so you can also add an address yourself. On the Fastly integration page, under Changes on this provider, choose Block an address, then enter the address, how long the block should last and a reason, and select Apply block. WebDecoy adds the ACL entry, reads it back to confirm Fastly holds it, and removes it when it expires. A Fastly ACL entry has no expiry of its own, so the removal is ours.
The block applies wherever your VCL consults the ACL, which is usually the whole service. It cannot be limited to one hostname from WebDecoy. The button appears when exactly one Fastly integration is active and set to Block IP.
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 Detections 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 name (or ID) matches the ACL in Fastly
- 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 score threshold isn’t too high
- Remember that automatic blocking is currently withheld until scorer calibration; use Block an address to block by hand
- 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 carry a comment of the form
webdecoy:action:<id>, which identifies the change in WebDecoy’s list of changes on the provider
Removing Blocked IPs
Section titled “Removing Blocked IPs”Every ACL entry WebDecoy adds has a lifetime, and WebDecoy removes it when that expires. You can also reverse one at any time from Integrations → Fastly, under the list of changes on the provider. Deleting the integration is the exception: its credentials go with it, so entries it added stay in the ACL.
To remove one from Fastly’s side instead:
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