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

[Cloud Security] Handle critical errors returned from the Agentless API when creating and deleting agentless agents #195997

Conversation

seanrathier
Copy link
Contributor

@seanrathier seanrathier commented Oct 11, 2024

Summary

We are adding more defined error handling on the statuses returned from the Agentless API. This includes some changes to the data and messages being logged and the error that is thrown to the user.

We've also refactored the code to have the agentless agent create and delete actions share the same handling function.

Checklist

Delete any items that are not applicable to this PR.

@seanrathier seanrathier force-pushed the 10657-agentless-handle-critical-error-statuses branch from ed2b902 to 917cec7 Compare October 17, 2024 13:25
@seanrathier seanrathier self-assigned this Oct 17, 2024
@seanrathier seanrathier requested a review from a team October 17, 2024 13:49
@seanrathier seanrathier added 8.17 candidate backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:Cloud Security Cloud Security team related ci:project-deploy-security Create a Security Serverless Project release_note:skip Skip the PR/issue when compiling release notes labels Oct 17, 2024
@seanrathier seanrathier changed the title 10657 agentless handle critical error statuses [Cloud Security] Handle critical errors returned from the Agentless API when creating and deleting agentless agents Oct 17, 2024
@seanrathier seanrathier marked this pull request as ready for review October 17, 2024 20:43
@seanrathier seanrathier requested a review from a team as a code owner October 17, 2024 20:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 17, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seanrathier seanrathier force-pushed the 10657-agentless-handle-critical-error-statuses branch from 869782e to d8ddf42 Compare October 18, 2024 15:32
Copy link
Contributor

@maxcold maxcold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, haven't tested though

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 23, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #18 / useSetupTechnology should update new agent policy and selected policy tab when setup technology is agent-based

Metrics [docs]

✅ unchanged

History

cc @seanrathier

@seanrathier seanrathier enabled auto-merge (squash) October 23, 2024 15:10
@seanrathier seanrathier merged commit d153584 into elastic:main Oct 23, 2024
27 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11483493436

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 23, 2024
…less API when creating and deleting agentless agents (#195997) (#197490)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Cloud Security] Handle critical errors returned from the Agentless
API when creating and deleting agentless agents
(#195997)](#195997)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"seanrathier","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-23T15:46:26Z","message":"[Cloud
Security] Handle critical errors returned from the Agentless API when
creating and deleting agentless agents
(#195997)","sha":"d15358496b8cbc153d494f9a8f70c9400ebb1d66","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","Team:Cloud
Security","backport:prev-minor","ci:project-deploy-security","8.17
candidate"],"title":"[Cloud Security] Handle critical errors returned
from the Agentless API when creating and deleting agentless
agents","number":195997,"url":"https://github.com/elastic/kibana/pull/195997","mergeCommit":{"message":"[Cloud
Security] Handle critical errors returned from the Agentless API when
creating and deleting agentless agents
(#195997)","sha":"d15358496b8cbc153d494f9a8f70c9400ebb1d66"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195997","number":195997,"mergeCommit":{"message":"[Cloud
Security] Handle critical errors returned from the Agentless API when
creating and deleting agentless agents
(#195997)","sha":"d15358496b8cbc153d494f9a8f70c9400ebb1d66"}}]}]
BACKPORT-->

Co-authored-by: seanrathier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.17 candidate backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-security Create a Security Serverless Project release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related Team:Fleet Team label for Observability Data Collection Fleet team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants