Commit graph

8 commits

Author SHA1 Message Date
Karl Godard
672e9925b0
[Session View] Fixes to slow process event queries + xterm.js updated. (#155326)
## Summary

Issue: https://github.com/elastic/kibana/issues/155183

This PR improves the process_events_route and io_event_route queries. We
now pass in the index and **process.entry_leader.start** time to greatly
improve the loading time of session view. Prior to this change, we were
doing a cross cluster search across the entire
logs-endpoint.events.process datastream. Session view will now use the
index from the entry leader event to limit the scope of the query. It
also ensures a range query is added with the entry leader start time, to
prevent data prior to the session from being hit.

I've also updated the npm package for xterm.js which addresses this
renovate ticket: https://github.com/elastic/kibana/pull/147815

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-25 09:25:01 -07:00
Karl Godard
422f6e837f
[SessionView] cloud_defend process index as a source + merged process event handling (#153213)
## Summary

This PR adds logs-cloud_defend.process as a source to load process
events in SessionView. _(note: I have plans to optimize sessionview so
it only pulls from the index that the session leader came from)._

The cloud-defend service (WIP) implements a technique to reduce process
event volume by squishing the 3 lifecycle **event.action** s (fork,
exec, end) into a single event. SessionView has been updated to handle
these new merged events.

Much of the information across a fork, exec and end event does not
change, so given a short window, the cloud-defend service buffers the
events, and merges the values from event.action and event.type into an
array of the values from each event.

In most cases an SSH session leader process (e.g bash) will have two
events. One event containing event.action: ['fork', 'exec'] (2
merged events), and one final event with event.action: 'end' when the
user exits the session.

The nice thing about the above is that in the majority of situations
processes are short lived, and so most events should contain all three
actions [fork, exec, end]. In our tests, this has provided roughly a 50%
savings in process event volume. It should also be noted that any rules
using event.action or event.type should be unaffected by this change, as
the query languages don't care if it's comparing a single value, or an
array of values.

A minor change has also been made in the process analyzer feature to
handle the merging of event.type
e.g event.type = ['start', 'end'] 
cc @kqualters-elastic if you know of any other places I need to update.

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-24 10:00:08 -07:00
Karl Godard
929cdc0f44
[TTY Player] Endpoint integration tweaks and other improvements (#140672)
* defaults for rows columns added. temp hacks to get integration with endpoint working

* tty_player header style parity with session_view

* fit/fullscreen logic tweaks

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* marker logic fixed

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* jump to output logic implemented

* playback logic tweaks.

* jest tests passing

* removed unused translation

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* type checks fixed. test added to text sizer for fullscreen

* mouse wheel scroll issues fixed.

* removed unneeded "|| 0"

* ftr tests fixed

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* lint fix

* using host.id until host.boot.id is fixed in endpoint

* falling back to using host.id until host.boot.id is fixed

Co-authored-by: Karl Godard <karlgodard@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-14 22:08:21 -07:00
Jack
c9b8098c88
[8.5] [Session view] Fetch output events in process_events_route and show output button (#140425)
* Fetch output events in process_events_route and show output button accordingly

* Add unit tests for rendering output button

* Update process event route fetch process with output
2022-09-13 13:02:24 -07:00
Karl Godard
b453a6b791
[Terminal output] IO events are now queried by tty major/minor device number, host … (#139772)
* TTY IO events are now queried by tty major/minor device number, host boot id, and session date range.

* removed mock test changes

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* type/lint fixes

* fixed get_total_io_bytes test

* fixed test

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

Co-authored-by: Karl Godard <karlgodard@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-31 16:02:51 -07:00
Karl Godard
5e26a6ab58
[Session View] TTY Player baseline implementation (#138773)
* tty output POC

output poc stuff

oh baby, tty output search working nice.

output poc work

primitive playback mechanism added, xterm render callback improved. infinite pagination working

minor css tweaks

* stash restore

* stash restore

* refactor

* code shuffle/refactor

* cleanup/refactor

* component renamed

* search improved

* new route to get total bytes of io added. it will hide tty player button if no output, so removes the need for a feature flag

* some jest test coverage added

* basic jest test coverage added to tty_player

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* removed search addon. i've commited a modified version of it

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* tweaks to mock data

* tests added for tty_search_bar

* translations added for aria labels in session_view component

* mocking of window.matchMedia moved to beforeAll

* lint fix

* fixed build error

* event action name updated. lint fixes

* fix for ftr tests

* addresses jacks comments

Co-authored-by: mitodrummer <karlgodard@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-16 14:40:48 -07:00
Rickyanto Ang
bc591aedfa
[Session View][Security Solution][8.3]Refresh button bug fix (#133935)
* Fix for refresh button issue

* fix for refresh button

* fix for failed e2e test
2022-06-08 14:39:58 -07:00
Karl Godard
40b1cb95a5
Routes and E2E tests for kubernetes_security plugin (#133266)
* aggregate and count routes added for kubernetes_security plugins.
includes FTR e2e tests. some e2e tests also created for session view plugin.

* naming fixes

Co-authored-by: mitodrummer <karlgodard@elastic.co>
2022-06-01 09:41:18 -07:00