Removing outdated/stale bouncer versions deletes all bouncers (crowdsec_manager #118)

:octopus: GitHub issue crowdsec_manager #118, opened by nightshark on GitHub

Title: Deleting a single bouncer via UI removes all bouncers sharing the same base name

Version: v2.3.2-Independent

Summary

Clicking the delete (trash) icon on a single bouncer row in the Engines/Bouncers page deletes all bouncer registrations that share the same base name, not just the row that was clicked. The full unique identifier shown in the UI (caddy-bouncer@​172.23.0.1) appears to be stripped down to the base name (caddy-bouncer) before being passed to cscli.

Steps to reproduce

  1. Have multiple bouncer registrations from the same client across container restarts/IP changes, e.g.:
    • caddy-bouncer
    • caddy-bouncer@​172.23.0.1
    • caddy-bouncer@​172.23.0.3
    • caddy-bouncer@​172.23.0.5
    • …etc, plus one currently Connected (e.g. caddy-bouncer@​172.23.0.2)
  2. Click the trash icon on a single stale row, e.g. caddy-bouncer@​172.23.0.1.
  3. Observe the bouncers list.

Expected behavior

Only the row clicked (caddy-bouncer@​172.23.0.1) is deleted. All other registrations, including the live Connected one, remain.

Actual behavior

All bouncer registrations matching the base name caddy-bouncer* are removed, including the live Connected bouncer. This breaks the live bouncer’s authentication against LAPI and requires regenerating its API key (cscli bouncers add ...) and updating the client config.

Evidence from logs

The DELETE request hits /api/crowdsec/bouncers/caddy-bouncer (note: the @<ip> suffix has already …


:speech_balloon: Discuss it here. Status, fixes and code review stay on GitHub.