Page MenuHomePhabricator

Protect Catalyst/PatchDemo from aggressive bots at the ingress layer
Open, Stalled, Needs TriagePublic3 Estimated Story Points

Description

Our k3s uses Traefik.

In the past, we've mitigated aggressive bots at the apache layer of our projects. We should try to limit them as they enter our k8s to avoid having to update deployments with new apache configs.

Possibilities:

A.C.

  • Migrate the configuration from our https://patchdemo.wmcloud.org/ apache to traefik
  • Make it easy it update with our pipelines so we can respond quickly to new bots causing problems

Details

Other Assignee
EBomani
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
PoC: add Traefik configuration to clusterrepos/test-platform/catalyst/catalyst-tofu!27jnucheT415701-PoCmain
Draft: Update file traefik-config.yamlrepos/test-platform/catalyst/catalyst-tofu!24ebomaniT415701main
Draft: BotWrangler WIPrepos/test-platform/catalyst/patchdemo!246ebomani415701main
Customize query in GitLab

Event Timeline

thcipriani updated the task description. (Show Details)
thcipriani set the point value for this task to 3.
thcipriani moved this task from Backlog to Ready on the Catalyst (Luka Ijo Pimeja Jan) board.

Unfortunately it seems the bot-wrangler-traefik-plugin plugin is not compatible with our current K3s production version v1.28.7+k3s1.

I tried deploying the latest version v0.10.1 and ran into the following error:

time="2026-02-09T16:24:03Z" level=error msg="Plugins are disabled because an error has occurred." error="github.com/holysoles/bot-wrangler-traefik-plugin: failed to import plugin code \"github.com/holysoles/bot-wrangler-traefik-plugin\": 1:21: import \"github.com/holysoles/bot-wrangler-traefik-plugin\" error: plugins-storage/sources/gop-2486277708/src/github.com/holysoles/bot-wrangler-traefik-plugin/wrangler.go:12:2: import \"github.com/holysoles/bot-wrangler-traefik-plugin/pkg/botmanager\" error: plugins-storage/sources/gop-2486277708/src/github.com/holysoles/bot-wrangler-traefik-plugin/pkg/botmanager/botmanager.go:14:2: import \"github.com/holysoles/bot-wrangler-traefik-plugin/pkg/config\" error: plugins-storage/sources/gop-2486277708/src/github.com/holysoles/bot-wrangler-traefik-plugin/pkg/config/config.go:8:2: import \"slices\" error: unable to find source related to: \"slices\""

slices was added in go 1.21. At the same time, traefik uses a go interpreter named yaegi under the hood. At the time K3s v1.28.7+k3s1 was released, yaegi didn't support go 1.21, see: https://github.com/traefik/yaegi/issues/1608#issuecomment-1937084471

I tried using the earliest bot-wrangler-traefik-plugin release in this MR, but that release (v0.1.0) is still too recent and runs into the same issue.

All of the above means we will have to either:

  • Update the K3s cluster version. We already have a ticket for that: T400077
  • Try a different plugin and/or approach
thcipriani changed the task status from Open to Stalled.Thu, Feb 19, 5:24 PM
thcipriani moved this task from Ready to Backlog on the Catalyst (Luka Ijo Pimeja Jan) board.

Plugins require k3s upgrade, stalling until we do that.