-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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][Platform] - Fixing exceptions export format #114920
Conversation
* Side Public License, v 1. | ||
*/ | ||
|
||
export const transformDataToNdjson = (data: unknown[]): string => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to package as it's used in multiple plugins and exactly the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Integration tests look great 👍
packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts
Outdated
Show resolved
Hide resolved
packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts
Outdated
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/search/session·ts.apis search search session touched time updates when you poll on an searchStandard Out
Stack Trace
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: cc @yctercero |
### Summary Fixing exceptions export format and adding integration tests for it.
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…mple/introduce-baseline-tests * 'master' of github.com:elastic/kibana: (55 commits) [Fleet] Improve Functionality around Managed Package Policies (elastic#114526) cleanup (elastic#114902) remove stray semicolon (elastic#114969) [Security Solution] Edit host isolation exception IP UI (elastic#114279) [ML] APM Correlations: Round duration values to be used in range aggregations. (elastic#114833) [Index Management] Added `data-test-subj` values to the index context menu buttons (elastic#114900) [Stack monitoring] Fix logstash functional tests for react (elastic#114819) Implement hybrid approach to writing rule execution event logs (elastic#114852) [Detection Rules] Add 7.16 rules (elastic#114939) Fixing exceptions export format (elastic#114920) Clean up inaccurate comments (elastic#114935) chore(NA): fixes a typo on persist_bazel_cache.sh comment (elastic#114943) [ci] Fixes Bazel cache writes (elastic#114915) fix package.json: (elastic#114936) [Controls] Redux Toolkit and Embeddable Redux Wrapper (elastic#114371) [APM] Fixes incorrect index config names (elastic#114901) (elastic#114904) [Workplace Search] Fix button order and remove extra source name label (elastic#114899) [Actions] Fixed actions telemetry for multiple namespaces usage (elastic#114748) docs: fix config names (elastic#114903) Update kibana to EMS 7.16 (elastic#114865) ...
Summary
Fixes exceptions export route. It is formatting exports weirdly with extra charachters. Adds integration tests for export of exception list.
Existing export
"{\"_version\":\"WzIxMjU1LDNd\",\"created_at\":\"2021-10-13T03:35:46.040Z\",\"created_by\":\"ytercero\",\"description\":\"test new\",\"id\":\"a6a3ef80-2bd6-11ec-8555-95b02ad6ae04\",\"immutable\":false,\"list_id\":\"15007788-8227-4b29-bec0-417cb9bd2192\",\"name\":\"test new\",\"namespace_type\":\"single\",\"os_types\":[],\"tags\":[],\"tie_breaker_id\":\"2b368e6a-f469-4a3b-8bca-6dd4bf8b82c9\",\"type\":\"detection\",\"updated_at\":\"2021-10-13T03:35:46.110Z\",\"updated_by\":\"ytercero\",\"version\":1}\n" "{\"_version\":\"WzIxMjU5LDNd\",\"comments\":[],\"created_at\":\"2021-10-13T03:36:01.327Z\",\"created_by\":\"ytercero\",\"description\":\"test new - exception list item\",\"entries\":[{\"field\":\"host.name\",\"operator\":\"included\",\"type\":\"match\",\"value\":\"DESKTOP-QBBSCUT\"}],\"id\":\"afc08bf0-2bd6-11ec-8555-95b02ad6ae04\",\"item_id\":\"f0dd9782-5a5a-43f9-ab9c-cb8c2b6fc4e5\",\"list_id\":\"15007788-8227-4b29-bec0-417cb9bd2192\",\"name\":\"test new - exception list item\",\"namespace_type\":\"single\",\"os_types\":[],\"tags\":[],\"tie_breaker_id\":\"d6eb9a6d-e3e1-4038-b476-f17cf3902e16\",\"type\":\"simple\",\"updated_at\":\"2021-10-13T03:36:01.396Z\",\"updated_by\":\"ytercero\"}\n" {"exception_list_items_details":"{\"exported_count\":1}\n"}
Fixed export
{"_version":"WzU0MjIzLDNd","created_at":"2021-10-13T03:35:46.040Z","created_by":"ytercero","description":"test new","id":"a6a3ef80-2bd6-11ec-8555-95b02ad6ae04","immutable":false,"list_id":"15007788-8227-4b29-bec0-417cb9bd2192","name":"test new","namespace_type":"single","os_types":[],"tags":[],"tie_breaker_id":"2b368e6a-f469-4a3b-8bca-6dd4bf8b82c9","type":"detection","updated_at":"2021-10-13T03:35:46.110Z","updated_by":"ytercero","version":1} {"_version":"WzU0MjI1LDNd","comments":[],"created_at":"2021-10-13T03:36:01.327Z","created_by":"ytercero","description":"test new - exception list item","entries":[{"field":"host.name","operator":"included","type":"match","value":"DESKTOP-QBBSCUT"}],"id":"afc08bf0-2bd6-11ec-8555-95b02ad6ae04","item_id":"f0dd9782-5a5a-43f9-ab9c-cb8c2b6fc4e5","list_id":"15007788-8227-4b29-bec0-417cb9bd2192","name":"test new - exception list item","namespace_type":"single","os_types":[],"tags":[],"tie_breaker_id":"d6eb9a6d-e3e1-4038-b476-f17cf3902e16","type":"simple","updated_at":"2021-10-13T03:36:01.396Z","updated_by":"ytercero"} {"exported_list_items_count":1}
Testing
To test, create a rule with and add an exception item to your rule. Navigate to the exceptions tab and hit export:
Checklist
For maintainers
Not sure this is a breaking change, but happy to add tag if needed.