Skip to content

[Security Solution][Endpoint] New API for creating a get-file response action request#142671

Merged
paul-tavares merged 13 commits intoelastic:mainfrom
paul-tavares:task/olm-2477-get-file-action-request-api
Oct 11, 2022
Merged

[Security Solution][Endpoint] New API for creating a get-file response action request#142671
paul-tavares merged 13 commits intoelastic:mainfrom
paul-tavares:task/olm-2477-get-file-action-request-api

Conversation

@paul-tavares
Copy link
Copy Markdown
Contributor

@paul-tavares paul-tavares commented Oct 4, 2022

Summary

  • Register a new POST api route at /api/endpoint/action/get_file to handle creating get-file action request
  • Some refactoring to move some const's to the actions service directory

Usage:

API usage below.

Request:

POST /api/endpoint/action/get_file
{
    "endpoint_ids": [
        "51af3cec-68a3-42c6-a623-1c95b4111453"
    ],
    "parameters": {
        "path": "/one/two/three"
    }
}

Response:

{
    "data": {
        "id": "271b0b13-9f30-4b1c-8c25-03e36267a4ca",
        "agents": [
            "51af3cec-68a3-42c6-a623-1c95b4111453"
        ],
        "hosts": {
            "51af3cec-68a3-42c6-a623-1c95b4111453": {
                "name": "Host-mtnj0uq155"
            }
        },
        "command": "get-file",
        "startedAt": "2022-10-04T21:12:52.572Z",
        "isCompleted": false,
        "wasSuccessful": false,
        "isExpired": false,
        "status": "pending",
        "outputs": {},
        "agentState": {
            "51af3cec-68a3-42c6-a623-1c95b4111453": {
                "isCompleted": false,
                "wasSuccessful": false
            }
        },
        "createdBy": "elastic",
        "parameters": {
            "path": "/one/two/three"
        }
    }
}

Checklist

@paul-tavares paul-tavares added release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.6.0 labels Oct 4, 2022
@paul-tavares paul-tavares self-assigned this Oct 4, 2022
@paul-tavares paul-tavares marked this pull request as ready for review October 5, 2022 16:24
@paul-tavares paul-tavares requested review from a team as code owners October 5, 2022 16:24
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

/**
* The list of possible capabilities, reported by the endpoint in the metadata document
*/
export const RESPONDER_CAPABILITIES = [
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NOTE: most of the changes in this PR are a result of this refactor

Copy link
Copy Markdown
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

Looking good to 🚢 . I have a few suggestions that are not blockers.

Also this can be done in a new PR as this one is mostly API related changes, but we also need a pendingGetFile to EndpointHostIsolationStatus component

and in

export const getEndpointHostIsolationStatusPropsCallback: (

for showing pending actions for get-file

@paul-tavares
Copy link
Copy Markdown
Contributor Author

Thanks @ashokaditya . I incorporated your changes and opened up an issue to track updating the endpoint_host_isolation_status.tsx component in a subsequent PR

@kibanamachine kibanamachine requested a review from a team as a code owner October 11, 2022 15:08
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 6.6MB 6.6MB +131.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 411 410 -1

Total ESLint disabled count

id before after diff
securitySolution 484 483 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @paul-tavares

Copy link
Copy Markdown
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

Import reformatting in x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx LGTM

@paul-tavares paul-tavares merged commit b5bacc3 into elastic:main Oct 11, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Oct 11, 2022
@paul-tavares paul-tavares deleted the task/olm-2477-get-file-action-request-api branch October 11, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants