## Summary
This PR for fixing the 'Flakiness' for our FTR Column Sort test cases.
The fix includes adding a 1 second delay or sleep between the test
clicking on the column its trying to sort and the test getting values
for that column.
There seems to be a problem from time to time where the values on that
column is not correct for a split second after clicking on the column to
sort it. Adding 1 second delay allows enough time for the column to sort
and show the correct value before we get the value for comparison with
the sorted (using our sorting function on the test)
This delay also fix the issue where the test fails because it checks for
an element while the page is still loading. I ran this 'fix' on our
flaky test runner for over 1000 runs and it hasn't fail so far, whereas
back then It would fail 3-4 times out of 450 runs
### Some other stuff that I tried before choosing this fix includes:
- Breaking the Column sort test cases into smaller test, currently we
test all Column sort in 1 test thus when 1 fail it might fail the next
one too.
- wait until loading element doesn't exist but I seem to be encountering
some issue when i use waitFor. Thus, I switch it to check if loading
element don't exist but It doesnt seem to help that much on fixing
column sort issue
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/135402
Allows deployments to not have the default footer added to alerting
emails via the new `xpack.actions.enableFooterInEmail` config setting.
The default value is `true`, which renders the footer. Setting the
value to `false` will cause no footer to be rendered.
Also changes the footer separator from `--` to `---`, which renders
nicer in HTML, as a `<hr>` element.
Resolves https://github.com/elastic/kibana/issues/153769
In this PR, I'm making `config`, `secrets` and `params` require a
validation in their connector type definition. Even in scenarios no
values are used, an empty object validation is required. This prevents
arbitrary data from being passed through.
Only `ES Index`, `Server Log` and `Teams` had some empty validators.
Adding them won't be a breaking change because the HTTP API defaults
missing `config` and `secrets` to `{}` ([see
here](https://github.com/elastic/kibana/blob/main/x-pack/plugins/actions/server/routes/create.ts#L19-L24)).
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Resolves: https://github.com/elastic/kibana/issues/152270
Specs:
https://docs.google.com/document/u/1/d/1-QblF6P19W9o5-10Us3bfgN80GRfjSIhybHrvJS_ObA/edit
This PR implements the following:
- New maintenance window SO
- New maintenance window client in the alerting plugin (generates and
queries maintenance window events, and other CRUD functionality around
the SO)
- New maintenance window REST APIs
- Kibana privileges for reading/writing maintenance window
This PR does not include integration with task runner, a new PR will be
created to do that work.
## APIs:
```
Find all maintenance windows in current space
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/_find`
body: {}
```
```
Create maintenance window:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window`
body: {
title: string,
duration: number,
r_rule: RRule
}
```
```
Update maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
body: {
title?: string,
duration?: number,
enabled?: boolean,
r_rule?: RRule,
}
```
```
Get maintenance window by ID:
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```
```
Delete maintenance window by ID:
DELETE `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```
```
Archive maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_archive`,
body: {
archive: boolean
}
```
```
Finish maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_finish`,
```
## Maintenance window response schema:
```
{
id: string;
title: string;
enabled: boolean;
duration: number;
expirationDate: string;
events: DateRange[];
rRule: RRuleParams;
status: 'running' | 'upcoming' | 'finished' | 'archived';
startDate: string | null;
endDate: string | null;
createdBy: string | null;
updatedBy: string | null;
createdAt: string;
updatedAt: string;
}
```
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR filters out all alerts that are already attached to the selected
case. To avoid breaking changes and not confuse the users (trying to
find which alert is attached to which case) the UI will not produce any
error.
### 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
### For maintainers
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
## Summary
This PR adds onboarding prompts for when vulnerability management
integration is not installed and when vulnerability management is
installed then show scanning empty prompt.
A `<NoVulnerabilitesState/>` component checks for `vuln_mgmt` status. If
the status is `not-deployed` or `indexing` then show
<ScanningVulnerabilitiesEmptyPrompt/>
The packageNoInstalledRender component will listen for the current tab
and renders on `useLocation().pathname`. If `currentTab` is
'vulnerabilities' then we show
`<VulnerabilitiesFindingsInstalledEmptyPrompt/>`. If `currentTab` is
`configurations` then show
`<ConfigurationFindingsInstalledEmptyPrompt/>`
Installed Prompt
<img width="1728" alt="Screen Shot 2023-03-30 at 3 45 35 PM"
src="https://user-images.githubusercontent.com/17135495/229010609-51a8f009-0fe1-45f3-8452-02bdd4234367.png">
Scanning Envioronment
<img width="1724" alt="Screen Shot 2023-03-30 at 3 45 20 PM"
src="https://user-images.githubusercontent.com/17135495/229010649-2d8c8482-c7d2-4040-927d-310354f99a94.png">
---------
Co-authored-by: Kfir Peled <kfir.peled@elastic.co>
## Summary
This PR filters out alerts already attached to a case on the backend.
The schema of the alerts in a case is:
```
{
alertId: string | string[]
index: string | string[]
}
```
So the `alertId` can contain multiple alert ids. In this case, if an ID
is attached to the case it will be removed from the `alertId` array. If
all alerts are attach to the case no attachment will be created.
### 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
### For maintainers
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Closes https://github.com/elastic/kibana/issues/154326
## Summary
After the merge of https://github.com/elastic/kibana/pull/153226, when
creating/updating a Logstash output as default, the `Elastic Cloud agent
policy` preconfigured on Cloud gets reassigned to the "default" ES
policy instead than keeping the `Elastic Cloud internal output`.
<img width="1418" alt="Screenshot 2023-04-04 at 12 51 21"
src="https://user-images.githubusercontent.com/16084106/230112067-a2767d1a-1191-4877-8dec-546d1590e41f.png">
Tee bug is fixed by checking if any given fleet server policy is
`preconfigured` or if it has already an assigned `data_output_id`, in
which cases it doesn't get updated.
### Testing
- Create an ES output additional to the default one
- Create a preconfigured fleet server policy and make sure it has
`fleet-server` integration (this is to simulate the preconfigured cloud
policy)
- Assign the previous output to the preconfigured policy
- Now create a new `logstash` output and make it default
- Check that the preconfigured policy maintains the custom output
previously assigned
### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
- Adds a `Filter fields` popover selector inspired by EUI's data grid
column picker to toggle inclusion of fields into grouping.
- Moves the `Group results` switch and the `Filter fields` popover on
the same level as the progress controls.
- Adapts the `explain_log_rate_spikes` API endpoint to support
retrieving a grouping update only.
- Hides the pagination footer for the results tables if there's less
results than the current page size.
Resolves https://github.com/elastic/kibana/issues/152140
## Summary
Updates the following functions in the Rules Client to re-use the API
key in context and avoid having the system invalidate them when no
longer in use:
- bulk_delete
- bulk_edit
- clone
- create
- delete
- update
- update_api_key
Also adds a new field to the rule SO to help determine when whether an
api key was created by a user or created by us.
### 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
### To verify
- Follow these
[instructions](https://www.elastic.co/guide/en/kibana/master/api-keys.html#create-api-key)
to create an api key. Make sure to copy your api key
- Run the following
```
curl -X POST "http://localhost:5601/api/alerting/rule/" -H 'Authorization: ApiKey ${API_KEY}' -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
"rule_type_id": "example.pattern",
"name": "pattern",
"schedule": {
"interval": "5s"
},
"actions": [
],
"consumer": "alerts",
"tags": [],
"notify_when": "onActionGroupChange",
"params": {
"patterns": {
"instA": " a - - a "
}
}
}'
```
- Verify that the request returns a rule
with`"api_key_created_by_user":true`
- Try this with the other rules clients functions listed above to verify
that you can manage alerting rules when authenticated with an api key
- Verify that `"api_key_created_by_user":false` when you remove the api
key header and add `-u ${USERNAME}:${PASSWORD}` to authenticate
This PR does some clean up and adds some validation.
Notable changes
- Removes unused operation code
- Adds check to ensure that only a single file can be contained in a
file attachment
- Adds some testing
- Modifies the LimitChecker to use the file service to determine how
many files are attached to a case
Fixes https://github.com/elastic/kibana/issues/154375
### background
https://github.com/elastic/kibana/pull/105326 replaced tile_map
visualization implementation with a new implementation that is a wrapper
around MapEmbeddable.
https://github.com/elastic/kibana/pull/152952 removed geohash_grid
aggregation. This causes a regression where existing tile_map
visualizations no longer work. Even though geohash_grid aggregation is
no longer used, the AggType is still needed so that new tile_map
visualization wrapper can access aggregation configuration state.
This PR adds back geohash_grid AggType in `legacyAggs` for this purpose.
PR also adds a functional test to better prevent regressions with
tile_map
### Test
* install web logs sample data
* install legacy tile_map saved objects from
```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"7.17.5","id":"90943e30-9a47-11e8-b64d-95841ca0b247","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2022-08-17T20:25:52.585Z","version":"WzEzMDQsMV0="}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"region_map","uiStateJSON":"{}","version":1,"visState":"{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"geo.dest\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addTooltip\":true,\"colorSchema\":\"Yellow
to
Red\",\"emsHotLink\":\"https://maps.elastic.co/v7.16?locale=en#file/world_countries\",\"isDisplayWarning\":true,\"legendPosition\":\"bottomright\",\"mapCenter\":[0,0],\"mapZoom\":2,\"outlineWeight\":1,\"selectedJoinField\":{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},\"selectedLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"http://www.naturalearthdata.com/about/terms-of-use\\\">Made
with NaturalEarth</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"created_at\":\"2020-10-28T16:16:08.720286\",\"fields\":[{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},{\"description\":\"ISO 3166-1
alpha-3 code\",\"name\":\"iso3\",\"type\":\"id\"},{\"description\":\"ISO
3166-1 numeric
code\",\"name\":\"iso_numeric\",\"type\":\"id\"},{\"description\":\"name\",\"name\":\"name\",\"type\":\"property\"}],\"format\":\"topojson\",\"id\":\"world_countries\",\"isEMS\":true,\"layerId\":\"elastic_maps_service.World
Countries\",\"meta\":{\"feature_collection_path\":\"data\"},\"name\":\"World
Countries\",\"origin\":\"elastic_maps_service\"},\"showAllShapes\":true,\"wms\":{\"enabled\":false,\"options\":{\"attribution\":\"\",\"format\":\"image/png\",\"layers\":\"\",\"styles\":\"\",\"transparent\":true,\"version\":\"\"},\"selectedTmsLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"id\":\"road_map\",\"maxZoom\":20,\"minZoom\":0,\"origin\":\"elastic_maps_service\"},\"url\":\"\"}},\"title\":\"region_map\",\"type\":\"region_map\"}"},"coreMigrationVersion":"7.17.5","id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:30:50.288Z","version":"WzE0MDIsMV0="}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"tile_map","uiStateJSON":"{\"mapZoom\":2,\"mapCenter\":[13.64385981167601,-135.97675761558068]}","version":1,"visState":"{\"title\":\"tile_map\",\"type\":\"tile_map\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"params\":{},\"schema\":\"metric\"},{\"id\":\"2\",\"enabled\":true,\"type\":\"geohash_grid\",\"params\":{\"field\":\"geo.coordinates\",\"autoPrecision\":true,\"precision\":2,\"useGeocentroid\":true,\"isFilteredByCollar\":true},\"schema\":\"segment\"}],\"params\":{\"colorSchema\":\"Yellow
to Red\",\"mapType\":\"Scaled Circle
Markers\",\"isDesaturated\":true,\"addTooltip\":true,\"heatClusterSize\":1.5,\"legendPosition\":\"bottomright\",\"mapZoom\":2,\"mapCenter\":[0,0],\"wms\":{\"enabled\":false,\"url\":\"\",\"options\":{\"version\":\"\",\"layers\":\"\",\"format\":\"image/png\",\"transparent\":true,\"attribution\":\"\",\"styles\":\"\"},\"selectedTmsLayer\":{\"origin\":\"elastic_maps_service\",\"id\":\"road_map\",\"minZoom\":0,\"maxZoom\":20,\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\"}}}}"},"coreMigrationVersion":"7.17.5","id":"4b073190-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:29:28.769Z","version":"WzEzNDksMV0="}
{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\"},\"panelIndex\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_ad02c99b-8bae-42e0-8a43-d27762f1e607\"},{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"},\"panelIndex\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"}]","timeRestore":false,"title":"dash
with legacy map
visualizations","version":1},"coreMigrationVersion":"7.17.5","id":"97437d70-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"dashboard":"7.17.3"},"references":[{"id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","name":"ad02c99b-8bae-42e0-8a43-d27762f1e607:panel_ad02c99b-8bae-42e0-8a43-d27762f1e607","type":"visualization"},{"id":"4b073190-1e6b-11ed-833b-a105e9534fa9","name":"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee:panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee","type":"visualization"}],"type":"dashboard","updated_at":"2022-08-17T20:31:36.656Z","version":"WzE0MzEsMV0="}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":4,"missingRefCount":0,"missingReferences":[]}
```
* Open dashboard and verify tile_map renders
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
> ⚠️ Synthetic failures are not related to any EUI changes and are
likely already failing on main. Please ignore the failing CI status when
reviewing.
## [`77.0.0`](https://github.com/elastic/eui/tree/v77.0.0)
**Bug fixes**
- Fixed named `EuiBadge` colors to reflect custom theme overrides
([#6659](https://github.com/elastic/eui/pull/6659))
- Fixed user-defined SCSS variables failing to override variables
defined in Amsterdam typography overrides.
([#6665](https://github.com/elastic/eui/pull/6665))
- Fixed bold `EuiCode` tokens to actually be bold
([#6666](https://github.com/elastic/eui/pull/6666))
**Breaking changes**
- Success- and accent-colored `EuiBadge`s and `EuiButton`s have had
their fill colors tinted slightly on light mode to be more readable
([#6659](https://github.com/elastic/eui/pull/6659))
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
## Summary
Closes https://github.com/elastic/kibana/issues/154585
Allow `PUT`ing partial request bodies for experimental features, which
ensures we don't break package policies from prior versions of Kibana
where not all experimental features were available.
Added an FTR test to catch the error, which is an API schema validation
one. Verified the test fails before the schema changes are made.
### 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
This PR extends the case deletion functionality to delete any files that
are attached to the case when a case is deleted.
To avoid attempting to delete too many files at once I chunk case ids
into 50 at a time such that we're at most only deleting 5000 (50 case *
100 files per case) at once. That way we don't exceed the 10k find api
limit.
## Testing
Run the python script from here:
https://github.com/elastic/cases-files-generator to generate some files
for a case
Deleting the case should remove all files