Skip to content

Conversation

@marcoieni
Copy link
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.

@syphar
Copy link
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
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
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
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

resource "fastly_ngwaf_workspace" "webapp" {
name = "${var.webapp_domain_name}-waf"
description = "Next-Gen WAF workspace for ${var.webapp_domain_name}"
mode = "block"
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
mode = "block"
mode = "log"

maybe we should change mode to just report initially.

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