Skip to content

Commit

Permalink
Merge branch 'master' into alerting/details-ui
Browse files Browse the repository at this point in the history
* master: (31 commits)
  [SIEM] Overview page feedback (elastic#56261)
  refactor (elastic#56131)
  [NP Cleanup] Remove ui/public/inspector (elastic#55677)
  [SIEM] [TIMELINE] Only add endpoint logo when on event.module === endgame (elastic#56263)
  Basic Functionality Alert List (elastic#55800)
  [SIEM] Fix filters on Hosts and Network page (elastic#56234)
  [SIEM] Adds ability to infer the newsfeed.enabled setting (elastic#56236)
  [SIEM][Detection Engine] critical blocker for updated rules
  [SIEM][Detection Engine] critical blocker, fixes ordering issue that causes rules to not run the first time
  [SIEM] Add link to endpoint app through reference.url (elastic#56211)
  [Metrics UI] Fixing title truncation in Metrics Explorer (elastic#55917)
  [SIEM] Put the notice for rules in comment block (elastic#56123)
  [SIEM][Detection Engine] critical blocker with the UI crashing
  Consistent timeouts for the Space onPostAuth interceptor tests (elastic#56158)
  Skip tests that depend on other skipped test
  [SIEM] [Detection Engine] Timestamps for rules (elastic#56197)
  Sort server-side in SavedObject export (elastic#55128)
  [Reporting] Document the 8.0 breaking changes (elastic#56187)
  Revert "[Monitoring] Change all configs to `monitoring.*`" (elastic#56214)
  add owners for es_archiver (elastic#56184)
  ...
  • Loading branch information
gmmorris committed Jan 29, 2020
2 parents 20e048b + 9d4414d commit 2961ecd
Show file tree
Hide file tree
Showing 204 changed files with 15,139 additions and 2,291 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
/src/dev/ @elastic/kibana-operations
/src/setup_node_env/ @elastic/kibana-operations
/src/optimize/ @elastic/kibana-operations
/src/es_archiver/ @elastic/kibana-operations
/packages/*eslint*/ @elastic/kibana-operations
/packages/*babel*/ @elastic/kibana-operations
/packages/kbn-dev-utils*/ @elastic/kibana-operations
Expand All @@ -112,6 +113,7 @@
/src/legacy/server/logging/ @elastic/kibana-platform
/src/legacy/server/saved_objects/ @elastic/kibana-platform
/src/legacy/server/status/ @elastic/kibana-platform
/src/dev/run_check_core_api_changes.ts @elastic/kibana-platform

# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
Expand Down
34 changes: 34 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,40 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---
This product bundles rules based on https://github.com/BlueTeamLabs/sentinel-attack
which is available under a "MIT" license. The files based on this license are:

- windows_defense_evasion_via_filter_manager.json
- windows_process_discovery_via_tasklist_command.json
- windows_priv_escalation_via_accessibility_features.json
- windows_persistence_via_application_shimming.json
- windows_execution_via_trusted_developer_utilities.json
- windows_execution_via_net_com_assemblies.json
- windows_execution_via_connection_manager.json

MIT License

Copyright (c) 2019 Edoardo Gerosa, Olaf Hartong

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
This product includes code that is adapted from mapbox-gl-js, which is
available under a "BSD-3-Clause" license.
Expand Down
11 changes: 11 additions & 0 deletions docs/migration/migrate_8_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@ specified explicitly.

*Impact:* Any workflow that involved manually clearing generated bundles will have to be updated with the new path.


[float]
[[breaking_80_reporting_changes]]
=== Reporting changes

[float]
==== Legacy job parameters are no longer supported
*Details:* POST URL snippets that were copied in Kibana 6.2 or below are no longer supported. These logs have
been deprecated with warnings that have been logged throughout 7.x. Please use Kibana UI to re-generate the
POST URL snippets if you depend on these for automated PDF reports.

// end::notable-breaking-changes[]
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ describe('getSortedObjectsForExport()', () => {
"namespace": undefined,
"perPage": 500,
"search": undefined,
"sortField": "_id",
"sortOrder": "asc",
"type": Array [
"index-pattern",
"search",
Expand Down Expand Up @@ -256,8 +254,6 @@ describe('getSortedObjectsForExport()', () => {
"namespace": undefined,
"perPage": 500,
"search": "foo",
"sortField": "_id",
"sortOrder": "asc",
"type": Array [
"index-pattern",
"search",
Expand Down Expand Up @@ -345,8 +341,6 @@ describe('getSortedObjectsForExport()', () => {
"namespace": "foo",
"perPage": 500,
"search": undefined,
"sortField": "_id",
"sortOrder": "asc",
"type": Array [
"index-pattern",
"search",
Expand Down Expand Up @@ -399,6 +393,79 @@ describe('getSortedObjectsForExport()', () => {
).rejects.toThrowErrorMatchingInlineSnapshot(`"Can't export more than 1 objects"`);
});

test('sorts objects within type', async () => {
savedObjectsClient.find.mockResolvedValueOnce({
total: 3,
per_page: 10000,
page: 1,
saved_objects: [
{
id: '3',
type: 'index-pattern',
attributes: {
name: 'baz',
},
references: [],
},
{
id: '1',
type: 'index-pattern',
attributes: {
name: 'foo',
},
references: [],
},
{
id: '2',
type: 'index-pattern',
attributes: {
name: 'bar',
},
references: [],
},
],
});
const exportStream = await getSortedObjectsForExport({
exportSizeLimit: 10000,
savedObjectsClient,
types: ['index-pattern'],
});
const response = await readStreamToCompletion(exportStream);
expect(response).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
"name": "foo",
},
"id": "1",
"references": Array [],
"type": "index-pattern",
},
Object {
"attributes": Object {
"name": "bar",
},
"id": "2",
"references": Array [],
"type": "index-pattern",
},
Object {
"attributes": Object {
"name": "baz",
},
"id": "3",
"references": Array [],
"type": "index-pattern",
},
Object {
"exportedCount": 3,
"missingRefCount": 0,
"missingReferences": Array [],
},
]
`);
});

test('exports selected objects and sorts them', async () => {
savedObjectsClient.bulkGet.mockResolvedValueOnce({
saved_objects: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import Boom from 'boom';
import { createListStream } from '../../../../legacy/utils/streams';
import { SavedObjectsClientContract } from '../types';
import { SavedObjectsClientContract, SavedObject } from '../types';
import { fetchNestedDependencies } from './inject_nested_depdendencies';
import { sortObjects } from './sort_objects';

Expand Down Expand Up @@ -105,15 +105,17 @@ async function fetchObjectsToExport({
const findResponse = await savedObjectsClient.find({
type: types,
search,
sortField: '_id',
sortOrder: 'asc',
perPage: exportSizeLimit,
namespace,
});
if (findResponse.total > exportSizeLimit) {
throw Boom.badRequest(`Can't export more than ${exportSizeLimit} objects`);
}
return findResponse.saved_objects;

// sorts server-side by _id, since it's only available in fielddata
return findResponse.saved_objects.sort((a: SavedObject, b: SavedObject) =>
a.id > b.id ? 1 : -1
);
} else {
throw Boom.badRequest('Either `type` or `objects` are required.');
}
Expand All @@ -137,14 +139,17 @@ export async function getSortedObjectsForExport({
exportSizeLimit,
namespace,
});
let exportedObjects = [...rootObjects];
let exportedObjects = [];
let missingReferences: SavedObjectsExportResultDetails['missingReferences'] = [];

if (includeReferencesDeep) {
const fetchResult = await fetchNestedDependencies(rootObjects, savedObjectsClient, namespace);
exportedObjects = fetchResult.objects;
exportedObjects = sortObjects(fetchResult.objects);
missingReferences = fetchResult.missingRefs;
} else {
exportedObjects = sortObjects(rootObjects);
}
exportedObjects = sortObjects(exportedObjects);

const exportDetails: SavedObjectsExportResultDetails = {
exportedCount: exportedObjects.length,
missingRefCount: missingReferences.length,
Expand Down
42 changes: 40 additions & 2 deletions src/dev/run_check_lockfile_symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { existsSync, lstatSync, readFileSync } from 'fs';
import { existsSync, lstatSync, readFileSync, readlinkSync } from 'fs';
import globby from 'globby';
import { dirname } from 'path';

Expand Down Expand Up @@ -63,6 +63,7 @@ async function checkLockfileSymlinks(log, files) {
await checkOnlyLockfileAtProjectRoot(filtered);
await checkSuperfluousSymlinks(log, filtered);
await checkMissingSymlinks(log, filtered);
await checkIncorrectSymlinks(log, filtered);
}

async function checkOnlyLockfileAtProjectRoot(files) {
Expand Down Expand Up @@ -157,8 +158,9 @@ async function checkMissingSymlinks(log, files) {
try {
const json = JSON.parse(manifest);
if (json.dependencies && Object.keys(json.dependencies).length) {
const correctSymlink = getCorrectSymlink(lockfilePath);
log.warning(
`Manifest at '${path}' has dependencies, but did not find an adjacent 'yarn.lock' symlink.`
`Manifest at '${path}' has dependencies, but did not find an adjacent 'yarn.lock' symlink to '${correctSymlink}'.`
);
errorPaths.push(`${parent}/yarn.lock`);
}
Expand All @@ -177,6 +179,42 @@ async function checkMissingSymlinks(log, files) {
}
}

async function checkIncorrectSymlinks(log, files) {
const errorPaths = [];

files
.filter(file => matchesAnyGlob(file.getRelativePath(), LOCKFILE_GLOBS))
.forEach(file => {
const path = file.getRelativePath();
const stats = lstatSync(path);
if (!stats.isSymbolicLink()) {
return;
}

const symlink = readlinkSync(path);
const correctSymlink = getCorrectSymlink(path);
if (symlink !== correctSymlink) {
log.warning(
`Symlink at '${path}' points to '${symlink}', but it should point to '${correctSymlink}'.`
);
errorPaths.push(path);
}
});

if (errorPaths.length) {
throw createFailError(
`These symlinks do NOT point to the 'yarn.lock' file in the project root:\n${listPaths(
errorPaths
)}`
);
}
}

function getCorrectSymlink(path) {
const count = path.split('/').length - 1;
return `${'../'.repeat(count)}yarn.lock`;
}

function listPaths(paths) {
return paths.map(path => ` - ${path}`).join('\n');
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export { getRequestInspectorStats, getResponseInspectorStats } from '../../../da
export { intervalOptions } from 'ui/agg_types/buckets/_interval_options';
// @ts-ignore
export { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query';
// @ts-ignore
export { RequestAdapter } from 'ui/inspector/adapters';
export { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal';
export { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal';
export { stateMonitorFactory } from 'ui/state_management/state_monitor_factory';
Expand Down Expand Up @@ -92,7 +90,6 @@ export {
SortDirection,
} from '../../../../../plugins/data/public';
export { ElasticSearchHit } from './np_ready/doc_views/doc_views_types';
export { Adapters } from 'ui/inspector/types';
export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router';
export { FieldName } from 'ui/directives/field_name/field_name';
export { getFormat } from 'ui/visualize/loader/pipeline_helpers/utilities';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import dateMath from '@elastic/datemath';
import { i18n } from '@kbn/i18n';
import '../components/field_chooser/field_chooser';

import { RequestAdapter } from '../../../../../../../plugins/inspector/public';
// doc table
import './doc_table';
import { getSort } from './doc_table/lib/get_sort';
Expand All @@ -46,7 +47,6 @@ import {
hasSearchStategyForIndexPattern,
intervalOptions,
migrateLegacyQuery,
RequestAdapter,
showSaveModal,
unhashUrl,
stateMonitorFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as Rx from 'rxjs';
import { Subscription } from 'rxjs';
import { i18n } from '@kbn/i18n';
import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public';
import { RequestAdapter, Adapters } from '../../../../../../../plugins/inspector/public';
import {
esFilters,
TimeRange,
Expand All @@ -43,13 +44,11 @@ import { ISearchEmbeddable, SearchInput, SearchOutput } from './types';
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
import { getSortForSearchSource } from '../angular/doc_table/lib/get_sort_for_search_source';
import {
Adapters,
angular,
getRequestInspectorStats,
getResponseInspectorStats,
getServices,
IndexPattern,
RequestAdapter,
ISearchSource,
} from '../../kibana_services';
import { SEARCH_EMBEDDABLE_TYPE } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/agg_types/agg_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { initParams } from './agg_params';

import { AggConfig } from '../vis';
import { AggConfigs } from './agg_configs';
import { Adapters } from '../inspector';
import { Adapters } from '../../../../plugins/inspector/public';
import { BaseParamType } from './param_types/base';
import { AggParamType } from '../agg_types/param_types/agg';
import { KBN_FIELD_TYPES, fieldFormats, ISearchSource } from '../../../../plugins/data/public';
Expand Down
6 changes: 0 additions & 6 deletions src/legacy/ui/public/inspector/README.md

This file was deleted.

Loading

0 comments on commit 2961ecd

Please sign in to comment.