Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit unenroll should not set unenrolled_at attribute #4221

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

michel-laterman
Copy link
Contributor

What is the problem this PR solves?

On systems where defend is running and may report as orphaned during an upgrade process, the unenrolled_at attribute will be set and will prevent future upgrade commands from being issued through Kibana.

How does this PR solve the problem?

Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • 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

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@michel-laterman michel-laterman added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify labels Dec 16, 2024
@michel-laterman michel-laterman requested a review from a team as a code owner December 16, 2024 20:29
@michel-laterman michel-laterman enabled auto-merge (squash) December 17, 2024 18:35
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@michel-laterman michel-laterman merged commit 8450b71 into elastic:main Dec 17, 2024
7 of 8 checks passed
mergify bot pushed a commit that referenced this pull request Dec 17, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)
mergify bot pushed a commit that referenced this pull request Dec 17, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)
mergify bot pushed a commit that referenced this pull request Dec 17, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)
michel-laterman added a commit that referenced this pull request Dec 17, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)

Co-authored-by: Michel Laterman <[email protected]>
ycombinator pushed a commit that referenced this pull request Dec 18, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)

Co-authored-by: Michel Laterman <[email protected]>
michel-laterman added a commit that referenced this pull request Dec 19, 2024
Do not set the unenrolled_at attribute when the audit/unenroll API is called.
Remove the unenrolled_at attribute if it's set during checkin.

(cherry picked from commit 8450b71)

Co-authored-by: Michel Laterman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants