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

[Security Solution][Endpoint] Actions Log API #101032

Merged
merged 71 commits into from
Jun 14, 2021
Merged

[Security Solution][Endpoint] Actions Log API #101032

merged 71 commits into from
Jun 14, 2021

Conversation

ashokaditya
Copy link
Member

@ashokaditya ashokaditya commented Jun 1, 2021

Summary

This PR is to add/modify the actions_log API in order to show actions log on endpoint details.

This is a branch of off /pull/99795

screenshot:
Screenshot 2021-06-01 at 10 38 46

clip
action-log

Checklist

Delete any items that are not applicable to this PR.

For maintainers

ashokaditya and others added 30 commits May 11, 2021 16:33
add tabs for endpoint details
this is work in progress with dummy data
in order to use it in endpoint_hosts as well as in trusted _apps

review suggestion
review suggestions
this needs to be fleshed out in a later PR
review change
review changes
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Fleet changes 🚀 hopefully we can get this soon #101603

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Left a few comments that I'm ok with you addressing in a subsequent PR.

Thanks

@ashokaditya
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 2242 2243 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1006 1007 +1

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.9MB 7.0MB +7.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 434.8KB 435.2KB +343.0B
Unknown metric groups

API count

id before after diff
fleet 1096 1097 +1

History

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

@ashokaditya ashokaditya merged commit 71a81f7 into elastic:master Jun 14, 2021
@ashokaditya ashokaditya deleted the sec-team-1150/endpoint-details-activity-log-api branch June 14, 2021 13:39
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 14, 2021
* WIP

add tabs for endpoint details

* fetch activity log for endpoint

this is work in progress with dummy data

* refactor to hold host details and activity log within endpointDetails

* api for fetching actions log

* add a selector for getting selected agent id

* use the new api to show actions log

* review changes

* move util function to common/utils

in order to use it in endpoint_hosts as well as in trusted _apps

review suggestion

* use util function to get API path

review suggestion

* sync url params with details active tab

review suggestion

* fix types due to merge commit

refs 3722552

* use AsyncResourseState type

review suggestions

* sort entries chronologically with recent at the top

* adjust icon sizes within entries to match mocks

* remove endpoint list paging stuff (not for now)

* fix import after sync with master

* make the search bar work (sort of)

this needs to be fleshed out in a later PR

* add tests to middleware for now

* use snake case for naming routes

review changes

* rename and use own relative time function

review change

* use euiTheme tokens

review change

* add a comment

review changes

* log errors to kibana log and unwind stack

review changes

* search on two indices

* fix types

* use modified data

* distinguish between responses and actions and respective states in UI

* use indices explicitly and tune the query

* fix types after sync with master

* fix lint

* do better types

review suggestion

* add paging to API call

* add paging info to redux store for activityLog

* decouple paging action from other API requests

* use a button for now to fetch more data

* add index to fleet indices

else we get a type check error about the constant not being exported correctly
from `x-pack/plugins/fleet/common/constants/agent`

* add tests for audit log API

* do semantic paging from first request

* fix ts error

review changes

* add document id and total to API

review suggestions

* update test

* update frontend to consume the modified api correctly

* update mock

* rename action

review changes

* wrap mock into function to create anew on each test

review changes

* wrap with schema.maybe and increase page size

review changes

* ignore 404

review changes

* use i18n

review changes

* abstract logEntry component logic

review changes

* move handler logic to a service

review changes

* update response object

review changes

* fix paging to use 50 as initial fetch size

* fix translations and move custom hook to component file

review changes

* add return type

review changes

* update default value for page_size

review changes

* remove default values

review changes

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#schemamaybe

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#default-values

* fix mock data

refs 1f9ae70

* add selectors for data

review changes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 14, 2021
* WIP

add tabs for endpoint details

* fetch activity log for endpoint

this is work in progress with dummy data

* refactor to hold host details and activity log within endpointDetails

* api for fetching actions log

* add a selector for getting selected agent id

* use the new api to show actions log

* review changes

* move util function to common/utils

in order to use it in endpoint_hosts as well as in trusted _apps

review suggestion

* use util function to get API path

review suggestion

* sync url params with details active tab

review suggestion

* fix types due to merge commit

refs 3722552

* use AsyncResourseState type

review suggestions

* sort entries chronologically with recent at the top

* adjust icon sizes within entries to match mocks

* remove endpoint list paging stuff (not for now)

* fix import after sync with master

* make the search bar work (sort of)

this needs to be fleshed out in a later PR

* add tests to middleware for now

* use snake case for naming routes

review changes

* rename and use own relative time function

review change

* use euiTheme tokens

review change

* add a comment

review changes

* log errors to kibana log and unwind stack

review changes

* search on two indices

* fix types

* use modified data

* distinguish between responses and actions and respective states in UI

* use indices explicitly and tune the query

* fix types after sync with master

* fix lint

* do better types

review suggestion

* add paging to API call

* add paging info to redux store for activityLog

* decouple paging action from other API requests

* use a button for now to fetch more data

* add index to fleet indices

else we get a type check error about the constant not being exported correctly
from `x-pack/plugins/fleet/common/constants/agent`

* add tests for audit log API

* do semantic paging from first request

* fix ts error

review changes

* add document id and total to API

review suggestions

* update test

* update frontend to consume the modified api correctly

* update mock

* rename action

review changes

* wrap mock into function to create anew on each test

review changes

* wrap with schema.maybe and increase page size

review changes

* ignore 404

review changes

* use i18n

review changes

* abstract logEntry component logic

review changes

* move handler logic to a service

review changes

* update response object

review changes

* fix paging to use 50 as initial fetch size

* fix translations and move custom hook to component file

review changes

* add return type

review changes

* update default value for page_size

review changes

* remove default values

review changes

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#schemamaybe

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#default-values

* fix mock data

refs 1f9ae70

* add selectors for data

review changes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Ashokaditya <am.struktr@gmail.com>
cuff-links pushed a commit to cuff-links/kibana that referenced this pull request Jun 15, 2021
* WIP

add tabs for endpoint details

* fetch activity log for endpoint

this is work in progress with dummy data

* refactor to hold host details and activity log within endpointDetails

* api for fetching actions log

* add a selector for getting selected agent id

* use the new api to show actions log

* review changes

* move util function to common/utils

in order to use it in endpoint_hosts as well as in trusted _apps

review suggestion

* use util function to get API path

review suggestion

* sync url params with details active tab

review suggestion

* fix types due to merge commit

refs 3722552

* use AsyncResourseState type

review suggestions

* sort entries chronologically with recent at the top

* adjust icon sizes within entries to match mocks

* remove endpoint list paging stuff (not for now)

* fix import after sync with master

* make the search bar work (sort of)

this needs to be fleshed out in a later PR

* add tests to middleware for now

* use snake case for naming routes

review changes

* rename and use own relative time function

review change

* use euiTheme tokens

review change

* add a comment

review changes

* log errors to kibana log and unwind stack

review changes

* search on two indices

* fix types

* use modified data

* distinguish between responses and actions and respective states in UI

* use indices explicitly and tune the query

* fix types after sync with master

* fix lint

* do better types

review suggestion

* add paging to API call

* add paging info to redux store for activityLog

* decouple paging action from other API requests

* use a button for now to fetch more data

* add index to fleet indices

else we get a type check error about the constant not being exported correctly
from `x-pack/plugins/fleet/common/constants/agent`

* add tests for audit log API

* do semantic paging from first request

* fix ts error

review changes

* add document id and total to API

review suggestions

* update test

* update frontend to consume the modified api correctly

* update mock

* rename action

review changes

* wrap mock into function to create anew on each test

review changes

* wrap with schema.maybe and increase page size

review changes

* ignore 404

review changes

* use i18n

review changes

* abstract logEntry component logic

review changes

* move handler logic to a service

review changes

* update response object

review changes

* fix paging to use 50 as initial fetch size

* fix translations and move custom hook to component file

review changes

* add return type

review changes

* update default value for page_size

review changes

* remove default values

review changes

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#schemamaybe

https://github.com/elastic/kibana/tree/master/packages/kbn-config-schema#default-values

* fix mock data

refs 1f9ae70

* add selectors for data

review changes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ashokaditya added a commit that referenced this pull request Jun 23, 2021
…ll (#102261)

* Show loading below the list when loading

fixes elastic/security-team/issues/1245

* use intersection observer to load data when callout is visible

fixes elastic/security-team/issues/1245

* remove unused `total` from API response

refs 4f7d18b

* toggle ability to paging based on API response and target intersection

fixes elastic/security-team/issues/1245

* use a invisible target

* display a message when end of log

fixes elastic/security-team/issues/1245

* remove search bar

fixes elastic/security-team/issues/1245

* refresh data

fixes elastic/security-team/issues/1245

* rename

refs 85e5add

* add refresh button to empty state

* add translations for copy

* remove refresh button

* load activity log for endpoint on activity log tab selection

fixes elastic/security-team/issues/1312

* reset paging correctly on activity log tab selection

* fix variable mixup

refs /pull/101032/commits/c4e933a9c5954ce249942ca66bab380c1dfa79e2#diff-41a74ad41665921620230a0729728f3bf6e27a6f9dc302fb37b0d2061637c212R81

* fix react warning

refs 697a3c3

* clean up

review changes

* use the complicated flyout version instead of styled version

refs https://elastic.github.io/eui/#/layout/flyout#more-complicated-flyout
refs https://github.com/elastic/kibana/pull/99795/files#r635810660
refs c26a7d4

* Page only when scrolled (so that info message is shown after paging once)

fixes elastic/security-team#1245 (comment)

* add tests

fixes elastic/security-team/issues/1312
fixes elastic/security-team/issues/1245

* increase the parent container's height to ensure that the scroll target is well hidden below the footer

refs 48e3291

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* address review changes

* cleanup callback and effect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 23, 2021
…ll (elastic#102261)

* Show loading below the list when loading

fixes elastic/security-team/issues/1245

* use intersection observer to load data when callout is visible

fixes elastic/security-team/issues/1245

* remove unused `total` from API response

refs 4f7d18b

* toggle ability to paging based on API response and target intersection

fixes elastic/security-team/issues/1245

* use a invisible target

* display a message when end of log

fixes elastic/security-team/issues/1245

* remove search bar

fixes elastic/security-team/issues/1245

* refresh data

fixes elastic/security-team/issues/1245

* rename

refs 85e5add

* add refresh button to empty state

* add translations for copy

* remove refresh button

* load activity log for endpoint on activity log tab selection

fixes elastic/security-team/issues/1312

* reset paging correctly on activity log tab selection

* fix variable mixup

refs elastic/pull/101032/commits/c4e933a9c5954ce249942ca66bab380c1dfa79e2#diff-41a74ad41665921620230a0729728f3bf6e27a6f9dc302fb37b0d2061637c212R81

* fix react warning

refs 697a3c3

* clean up

review changes

* use the complicated flyout version instead of styled version

refs https://elastic.github.io/eui/#/layout/flyout#more-complicated-flyout
refs https://github.com/elastic/kibana/pull/99795/files#r635810660
refs c26a7d4

* Page only when scrolled (so that info message is shown after paging once)

fixes elastic/security-team#1245 (comment)

* add tests

fixes elastic/security-team/issues/1312
fixes elastic/security-team/issues/1245

* increase the parent container's height to ensure that the scroll target is well hidden below the footer

refs 48e3291

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* address review changes

* cleanup callback and effect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jun 23, 2021
…ll (#102261) (#103047)

* Show loading below the list when loading

fixes elastic/security-team/issues/1245

* use intersection observer to load data when callout is visible

fixes elastic/security-team/issues/1245

* remove unused `total` from API response

refs 4f7d18b

* toggle ability to paging based on API response and target intersection

fixes elastic/security-team/issues/1245

* use a invisible target

* display a message when end of log

fixes elastic/security-team/issues/1245

* remove search bar

fixes elastic/security-team/issues/1245

* refresh data

fixes elastic/security-team/issues/1245

* rename

refs 85e5add

* add refresh button to empty state

* add translations for copy

* remove refresh button

* load activity log for endpoint on activity log tab selection

fixes elastic/security-team/issues/1312

* reset paging correctly on activity log tab selection

* fix variable mixup

refs /pull/101032/commits/c4e933a9c5954ce249942ca66bab380c1dfa79e2#diff-41a74ad41665921620230a0729728f3bf6e27a6f9dc302fb37b0d2061637c212R81

* fix react warning

refs 697a3c3

* clean up

review changes

* use the complicated flyout version instead of styled version

refs https://elastic.github.io/eui/#/layout/flyout#more-complicated-flyout
refs https://github.com/elastic/kibana/pull/99795/files#r635810660
refs c26a7d4

* Page only when scrolled (so that info message is shown after paging once)

fixes elastic/security-team#1245 (comment)

* add tests

fixes elastic/security-team/issues/1312
fixes elastic/security-team/issues/1245

* increase the parent container's height to ensure that the scroll target is well hidden below the footer

refs 48e3291

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* Update x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

* address review changes

* cleanup callback and effect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>

Co-authored-by: Ashokaditya <am.struktr@gmail.com>
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
ashokaditya added a commit that referenced this pull request Aug 25, 2021
…109776)

* move activity log paging method close to call api method

refs 417d093

* add middleware additional activity log tests

* add a more specific server side test for activity log actions and responses

refs /pull/101032

* remove obsolete server side audit log index mock method

refs /pull/101032

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2021
…lastic#109776)

* move activity log paging method close to call api method

refs 417d093

* add middleware additional activity log tests

* add a more specific server side test for activity log actions and responses

refs elastic/pull/101032

* remove obsolete server side audit log index mock method

refs elastic/pull/101032

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2021
…lastic#109776)

* move activity log paging method close to call api method

refs 417d093

* add middleware additional activity log tests

* add a more specific server side test for activity log actions and responses

refs elastic/pull/101032

* remove obsolete server side audit log index mock method

refs elastic/pull/101032

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Aug 25, 2021
…109776) (#110074)

* move activity log paging method close to call api method

refs 417d093

* add middleware additional activity log tests

* add a more specific server side test for activity log actions and responses

refs /pull/101032

* remove obsolete server side audit log index mock method

refs /pull/101032

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Ashokaditya <am.struktr@gmail.com>
kibanamachine added a commit that referenced this pull request Aug 25, 2021
…109776) (#110075)

* move activity log paging method close to call api method

refs 417d093

* add middleware additional activity log tests

* add a more specific server side test for activity log actions and responses

refs /pull/101032

* remove obsolete server side audit log index mock method

refs /pull/101032

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Ashokaditya <am.struktr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants