* kind of working solution... need to fix types.. would be great if all of this could go in the authorization class but I don't think we have access to the spaceids when we generate the kibana security action strings?
* update mapping type as array:true for space_ids field, fixes types, updates jest tests, adds integration tests
* undo changes in alerting authz class
* update snapshot for apm api integration test for rules writing alerts
* fix apm integration tests
* omit version and sequence from expected outcome
* re-add space id after this code was moved in master
* add another default space id to test
* fixes bug to remove duplicate spaceids
* add space ids filter to elasticsearch query, updates detection role
* update snapshot
* update type docs for alerts client
* remove dead code
* fix type error
* renames space ids field on alert documents from kibana.rac.alert.space_ids to kibana.space_ids
* fixes kb-rule-data-utils package
* update snapshots
* remove references to kibana.rac.alert.space_ids and replace with kibana.space_ids in rule registry integration tests and apm integration tests
* fix apm functional test snapshots
* undo index name changes I made in apm integration test configs
* update typedocs references to upstream, not local repo
This package was migrated to bazel, but the legacy style script commands
still exist in `package.json`. This removes these scripts to avoid
incorrectly building the package.
An MVP of the RBAC work required for the "alerts as data" effort. An example of the existing implementation for alerts would be that of the security solution. The security solution stores its alerts generated from rules in a single data index - .siem-signals. In order to gain or restrict access to alerts, users do so by following the Elasticsearch privilege architecture. A user would need to go into the Kibana role access UI and give explicit read/write/manage permissions for the index itself.
Kibana as a whole is moving away from this model and instead having all user interactions run through the Kibana privilege model. When solutions use saved objects, this authentication layer is abstracted away for them. Because we have chosen to use data indices for alerts, we cannot rely on this abstracted out layer that saved objects provide - we need to provide our own RBAC! Instead of giving users explicit permission to an alerts index, users are instead given access to features. They don't need to know anything about indices, that work we do under the covers now.
Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
Co-authored-by: Yara Tercero <yara.tercero@elastic.co>