Skip to content

enable Fastly WAF on crates-io web app CDN#917

Merged
marcoieni merged 1 commit intomasterfrom
enable-fastly-waf-on-crates-io-web-app-cdn
Feb 19, 2026
Merged

enable Fastly WAF on crates-io web app CDN#917
marcoieni merged 1 commit intomasterfrom
enable-fastly-waf-on-crates-io-web-app-cdn

Conversation

@marcoieni
Copy link
Copy Markdown
Member

@marcoieni marcoieni commented Jan 23, 2026

The crates-io team requested to enable WAF because of bots sending too many requests.

  • I asked Fastly to enable WAF on our account.

Related to #1007

@syphar
Copy link
Copy Markdown
Member

syphar commented Jan 25, 2026

short note: ( we're also using the fastly WAF at my dayjob)

after having the WAF active for some time, and ruling out false positives, we actually set up "block always / directly" rules for some signals.

example:
Here someone seemed to have tried to SQL-inject crates.io, through docs.rs search.

HTTP status client error (400 Bad Request) for url (https://crates.io/api/v1/crates?q=1&sort=relevance&per_page=30&seek=W2ZhbHNlLDkuMSwxMzQ1NDU3XQ%27||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||%27)

enabled = true
workspace_id = fastly_ngwaf_workspace.webapp.id
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if some VCL snippets also need to be added to make the edge WAF work.

Copy link
Copy Markdown
Contributor

@ubiratansoares ubiratansoares Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much experience with Fastly, but after some research I learned about NGWAF simulator, and I was wondering whether we could use to experiment and fine tune signals/rules we want to apply 👀

I discussed with @marcoieni and I'm now* aware that we have staging as an option to deploy and test WAF behavior, but eventually something like a simulator speeds a bit the lifecycle for code-test-deploy for any snippets we want to try out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default behaviour for the WAF is "don't block, just report",

so you'll be able to inspect the signals in the dashboard before switching the blocking mode on

Comment thread terragrunt/modules/crates-io/fastly-webapp.tf Outdated
@marcoieni marcoieni force-pushed the enable-fastly-waf-on-crates-io-web-app-cdn branch 3 times, most recently from bbdbab6 to 044cdf5 Compare February 19, 2026 12:22
@marcoieni marcoieni force-pushed the enable-fastly-waf-on-crates-io-web-app-cdn branch from 044cdf5 to 02ad776 Compare February 19, 2026 12:23
@marcoieni
Copy link
Copy Markdown
Member Author

I applied this. Changed the mode to log. Probably we need to change the thresholds as well.

@marcoieni marcoieni merged commit 1153377 into master Feb 19, 2026
4 checks passed
@marcoieni marcoieni deleted the enable-fastly-waf-on-crates-io-web-app-cdn branch February 19, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants