Skip to content

Move the CrowdSec Start revert onto the shared module state snapshot #1846

Open

Description

@Wikid82

What: the Start revert in crowdsec_handler.go / crowdsec_lifecycle.go still uses its own snapshot pair in security_handler.go instead of models.ModuleStateSnapshot (compare-and-restore).
Why it was not done in #1844: Start rewrites security.crowdsec.enabled with the same value, so the shared restore treats the key as untouched and leaves UpdatedAt at the Start time; TestStartCrowdSec_EngineExitsDuringLAPIWait and TestStartCrowdSec_EngineExitWhileEnabledRevertsToEnabledSnapshot compare full snapshots including UpdatedAt.
Suggested approach: decide whether UpdatedAt is meaningful there; if not, relax those tests to Value/Category and move the revert; if so, restore Start-written keys unconditionally. Severity: low (consistency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backendServer-side codebugSomething isn't workingcrowdsecCrowdSec integrationlowFuture enhancement, not urgentsecuritySecurity-related

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions