Commit graph

3 commits

Author SHA1 Message Date
Patrick Mueller
95fa356a45
[ResponseOps] use Data Streams for AAD indices in serverless (#160572)
resolves https://github.com/elastic/kibana/issues/154266

Changes the way the alerts-as-data (AAD) indices are created and written
to, to allow them to be built as they have been in the past (alias and
backing indices created manually) OR as an ES Data Stream.

Serverless will use Data Streams, other environments will use the
existing alias and backing indices. The determination is made by
optionally including the `serverless` plugin, and determining if it's
available.

The implementation is organized around a `DataStreamAdapter` object,
which is instantiated with a "data stream" or "alias" flavor, and then
it handles the specialized behavior. Currently, a lot of the smaller
implementation bits, like setting property values in ES calls, is done
via in-line boolean checks of that object, as to whether data streams or
aliases are being used. This could probably be cleaned up some.

Existing non-serverless function tests are largely unchanged, as they
can't test the new data stream path. Some tests have been added to the
serverless function tests, to test basic reading / writing via updated
alert documents.

## DEFER

- more serverless AaD tests

- https://github.com/elastic/kibana/issues/158403 - this issue is more
noticeable now that we HAVE to do OCC with data streams, so we get
errors instead of simply overwriting documents (which is also bad)

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2023-08-30 11:12:56 -04:00
Antonio
9058d1e83a
[Cases] Create case form tests in serverless. (#164837)
Connected with https://github.com/elastic/kibana/issues/164552

## Summary
This PR creates a serverless version of the tests currently in
`x-pack/test/functional_with_es_ssl/apps/cases/group1/create_case_form.ts`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-25 15:53:45 +01:00
Paul Tavares
733e19c5c0
[Security Solution][Serverless][Endpoint] Defines set of available kibana privileges for Endpoint Essentials/Complete add-on (#162281)
## Summary

PR defines the set of available app features for serverless Product Line
Items (PLIs) for Endpoint addon. Changes include:

- Adds new Security Solution Serverless config file group:
`xpack.securitySolutionServerless.developer.*`. Used to facilitate
development. Values can be set via the
`config/serverless.security.dev.yml`
- Includes `disableManagementUrlRedirect` config option, which when set
to `true` will disable the redirect currently in place when a user
attempts to access the kibana Management pages.
- Defines the set of Kibana Privileges that goes along with Endpoint
Essentials and Endpoint Complete addons for serverless
- Includes cypress e2e tests for validating Endpoint Management related
access based on Product Tier (see below for list of test per role/per
product tier)

**Changes to e2e test framework:**

- Cypress `parallel` runner now normalizes the set of ENV variable
passed into each of the cypress runs
- Added support to Cypress for defining `productTier` via a Cypress test
file (`*.cy.ts`) top-level `describe(description, config, testFn)`
block. Will be applied when the stack is running in `serverless` mode.
- NOTE: if opening Cypress locally using `cypress:open`, you likely will
have to change the setup (only locally - don't commit) to only pickup
your 1 test file because the current implementation of Cypress
`parallel` only reads the first test file
- Serverless Security folder structure was altered with the following:
- `ftr` folder was created and all existing FTR tests moved under it (we
already had a `cypress` folder, thus those are clearly separated)
- a new folder was was created here `test_serverless/shared/lib`.
Contains code that should be test framework independent (aka: can be
used from both FTR and Cypress).
- It currently has the security solution role/user loader logic, thus it
can be used by both FTR (ex. API integration) and Cypress


### Checklist

- [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-08-01 10:20:46 -07:00