mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-10 23:49:09 +02:00
[management] Renew certificate challenge nonces on quiet accounts
A certificate challenge nonce is accepted for its own window and the one before it, and it only reaches a peer attached to a network map. An account where nothing changes sends no map, so after a day the peer re-sends the nonce it still holds, verification rejects its whole proof set, and the certificates stored for it are dropped. It fails the certificate check and loses every policy gated on it until some unrelated change happens to push a map. The outage repairs itself in seconds, which is what makes it expensive: it is intermittent, it only hits stable networks, and it is not reproducible on demand. Push the account's peers an update often enough that the nonce they hold is never close to expiring. Only accounts whose posture checks actually ask for a certificate are tracked, so a deployment without the feature does no extra work. The refresh runs from one goroutine over a map of accounts rather than a timer per account: the period is hours, so one pass every few minutes costs nothing next to it, and there is no timer to re-arm when an account that falls due sooner appears. Each account's first run is offset by a hash of its ID, because the challenge window is global and an instance restart would otherwise arm every account in the same moment. The push carries no administrative change, so it is counted as a refresh rather than an update and stays out of the figures that track what was edited.
This commit is contained in:
@@ -34,4 +34,7 @@ const (
|
||||
UpdateOperationCreate UpdateOperation = "create"
|
||||
UpdateOperationUpdate UpdateOperation = "update"
|
||||
UpdateOperationDelete UpdateOperation = "delete"
|
||||
// UpdateOperationRefresh is a periodic push that carries no change of its own, so
|
||||
// it stays out of the counters that track what an administrator actually edited.
|
||||
UpdateOperationRefresh UpdateOperation = "refresh"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user