[9.5](backport #7593) Add option to enable graceful unenroll to invalid API key agents. - #7646
[9.5](backport #7593) Add option to enable graceful unenroll to invalid API key agents.#7646mergify[bot] wants to merge 1 commit into
Conversation
) Once an Elastic Agent is force unenrolled the Elastic Agents will continue to communicate to Fleet Server. There are cases where it would be best to just have the Elastic Agent stop all of its components, unenroll if it can (those with tamper protection on will not be able to), and those that cannot will continue to receive 401's for a full hour, until the cycle starts again. (cherry picked from commit 34a8c89) # Conflicts: # internal/pkg/api/handleCheckin.go
|
Cherry-pick of 34a8c89 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
TL;DRThe Buildkite failures are caused by unresolved merge conflict markers committed in Remediation
Investigation detailsRoot CauseThis is a merge-conflict carryover in the backport branch ( Evidence
Verification
Follow-up
What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
What is the problem this PR solves?
Once an Elastic Agent is force unenrolled the Elastic Agents will continue to communicate to Fleet Server. There are cases where it would be best to just have the Elastic Agent stop all of its components, unenroll if it can (those with tamper protection on will not be able to), and those that cannot will continue to receive 401's for a full hour, until the cycle starts again.
How does this PR solve the problem?
This changes the behavior of invalid API keys from being a 401 error that just gets retried non-stop to a 200 with a policy change action that is an empty policy, then a unenroll action, and then back to the 401 error.
How to test this PR locally
Design Checklist
[ ] I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.[ ] I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.Checklist
./changelog/fragmentsusing the changelog toolThis is an automatic backport of pull request #7593 done by [Mergify](https://mergify.com).