Skip to content

Commit

Permalink
Merge branch 'main' into RAM-add-maintenance-window-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM authored Aug 16, 2023
2 parents c7fd4dd + f9bc627 commit 8412220
Show file tree
Hide file tree
Showing 264 changed files with 4,762 additions and 1,681 deletions.
13 changes: 12 additions & 1 deletion .buildkite/pipelines/pull_request/security_solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,15 @@ steps:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
- "target/kibana-security-solution/**/*"

- command: .buildkite/scripts/steps/functional/security_solution_burn.sh
label: 'Security Solution Cypress tests, burning changed specs'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 1
soft_fail: true
artifact_paths:
- "target/kibana-security-solution/**/*"
50 changes: 25 additions & 25 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1157,15 +1157,12 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/stack_connectors/common/sentinelone @elastic/security-defend-workflows

## Security Solution sub teams - Detection Rule Management
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/fleet_integrations @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/rule_monitoring @elastic/security-detection-rule-management

/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management @elastic/security-detection-rule-management
Expand Down Expand Up @@ -1196,24 +1193,37 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/utils @elastic/security-detection-rule-management

/x-pack/plugins/security_solution/scripts/openapi @elastic/security-detection-rule-management

## Security Solution sub teams - Detection Engine

/x-pack/plugins/security_solution/common/api/detection_engine @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/index_management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/rule_preview @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/signals @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/cti @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/field_maps @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/risk_engine @elastic/security-detection-engine

/x-pack/plugins/security_solution/public/common/components/sourcerer @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detections/pages/alerts @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/entity_analytics @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/exceptions @elastic/security-detection-engine

/x-pack/plugins/security_solution/server/lib/detection_engine/migrations @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/sourcerer @elastic/security-detection-engine

/x-pack/test/security_solution_cypress/cypress/e2e/data_sources @elastic/security-detection-engine
/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation @elastic/security-detection-engine
Expand All @@ -1222,40 +1232,26 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/test/security_solution_cypress/cypress/e2e/exceptions @elastic/security-detection-engine
/x-pack/test/security_solution_cypress/cypress/e2e/overview @elastic/security-detection-engine

/x-pack/plugins/security_solution/common/detection_engine/rule_exceptions @elastic/security-detection-engine

/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/common/components/exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/common/components/sourcerer @elastic/security-detection-engine

/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/sourcerer @elastic/security-detection-engine

## Security Threat Intelligence - Under Security Platform
/x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine

## Security Solution cross teams ownership
/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/e2e/detection_rules @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/test/security_solution_cypress/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/screens/common @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine

/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/common/test @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting

/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response
/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations

/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions @elastic/security-detection-engine @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting

## Security Solution sub teams - security-defend-workflows
/x-pack/plugins/security_solution/public/management/ @elastic/security-defend-workflows
Expand Down Expand Up @@ -1283,7 +1279,11 @@ x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-an

## Security Solution sub teams - security-engineering-productivity
x-pack/test/security_solution_cypress/cypress/README.md @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/cli_config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/runner.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/serverless_config.ts @elastic/security-engineering-productivity

## Security Solution sub teams - adaptive-workload-protection
x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/sec-cloudnative-integrations
Expand All @@ -1294,7 +1294,7 @@ x-pack/plugins/security_solution/public/threat_intelligence @elastic/protections
x-pack/test/threat_intelligence_cypress @elastic/protections-experience

# Security Defend Workflows - OSQuery Ownership
/x-pack/plugins/security_solution/common/detection_engine/rule_response_actions @elastic/security-defend-workflows
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions @elastic/security-defend-workflows
/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions @elastic/security-defend-workflows
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions @elastic/security-defend-workflows

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@elastic/apm-rum-react": "^1.4.4",
"@elastic/charts": "59.1.0",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected].0",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.9.1-canary.1",
"@elastic/ems-client": "8.4.0",
"@elastic/eui": "86.0.0",
"@elastic/filesaver": "1.1.2",
Expand Down Expand Up @@ -1355,7 +1355,7 @@
"@types/source-map-support": "^0.5.3",
"@types/stats-lite": "^2.2.0",
"@types/styled-components": "^5.1.0",
"@types/supertest": "^2.0.5",
"@types/supertest": "^2.0.12",
"@types/tapable": "^1.0.6",
"@types/tar": "^6.1.5",
"@types/tempy": "^0.2.0",
Expand Down Expand Up @@ -1537,8 +1537,8 @@
"style-loader": "^1.1.3",
"stylelint": "^14.9.1",
"stylelint-scss": "^4.3.0",
"superagent": "^3.8.2",
"supertest": "^3.1.0",
"superagent": "^8.1.2",
"supertest": "^6.3.3",
"supports-color": "^7.0.0",
"svgo": "^2.8.0",
"tape": "^5.0.1",
Expand Down
15 changes: 15 additions & 0 deletions packages/core/http/core-http-browser-internal/src/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Fetch', () => {
const fetchInstance = new Fetch({
basePath: new BasePath(BASE_PATH),
kibanaVersion: 'VERSION',
buildNumber: 1234,
executionContext: executionContextMock,
});
afterEach(() => {
Expand Down Expand Up @@ -160,6 +161,7 @@ describe('Fetch', () => {
expect(fetchMock.lastOptions()!.headers).toMatchObject({
'content-type': 'application/json',
'kbn-version': 'VERSION',
'kbn-build-number': '1234',
'x-elastic-internal-origin': 'Kibana',
myheader: 'foo',
});
Expand All @@ -178,6 +180,19 @@ describe('Fetch', () => {
`"Invalid fetch headers, headers beginning with \\"kbn-\\" are not allowed: [kbn-version]"`
);
});
it('should not allow overwriting of kbn-build-number header', async () => {
fetchMock.get('*', {});
await expect(
fetchInstance.fetch('/my/path', {
headers: {
myHeader: 'foo',
'kbn-build-number': 4321,
},
})
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Invalid fetch headers, headers beginning with \\"kbn-\\" are not allowed: [kbn-build-number]"`
);
});

it('should not allow overwriting of x-elastic-internal-origin header', async () => {
fetchMock.get('*', {});
Expand Down
2 changes: 2 additions & 0 deletions packages/core/http/core-http-browser-internal/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { HttpInterceptHaltError } from './http_intercept_halt_error';
interface Params {
basePath: IBasePath;
kibanaVersion: string;
buildNumber: number;
executionContext: ExecutionContextSetup;
}

Expand Down Expand Up @@ -135,6 +136,7 @@ export class Fetch {
'Content-Type': 'application/json',
...options.headers,
'kbn-version': this.params.kibanaVersion,
'kbn-build-number': this.params.buildNumber,
[ELASTIC_HTTP_VERSION_HEADER]: version,
[X_ELASTIC_INTERNAL_ORIGIN_REQUEST]: 'Kibana',
...(!isEmpty(context) ? new ExecutionContextContainer(context).toHeader() : {}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ export class HttpService implements CoreService<HttpSetup, HttpStart> {

public setup({ injectedMetadata, fatalErrors, executionContext }: HttpDeps): HttpSetup {
const kibanaVersion = injectedMetadata.getKibanaVersion();
const buildNumber = injectedMetadata.getKibanaBuildNumber();
const basePath = new BasePath(
injectedMetadata.getBasePath(),
injectedMetadata.getServerBasePath(),
injectedMetadata.getPublicBaseUrl()
);

const fetchService = new Fetch({ basePath, kibanaVersion, executionContext });
const fetchService = new Fetch({ basePath, kibanaVersion, buildNumber, executionContext });
const loadingCount = this.loadingCount.setup({ fatalErrors });
loadingCount.addLoadingCountSource(fetchService.getRequestCount$());

Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
connectorsConfluence: `${ENTERPRISE_SEARCH_DOCS}connectors-confluence.html`,
connectorsDropbox: `${ENTERPRISE_SEARCH_DOCS}connectors-dropbox.html`,
connectorsContentExtraction: `${ENTERPRISE_SEARCH_DOCS}connectors-content-extraction.html`,
connectorsGithub: `${ENTERPRISE_SEARCH_DOCS}connectors-github.html`,
connectorsGmail: `${ENTERPRISE_SEARCH_DOCS}connectors-gmail.html`,
connectorsGoogleCloudStorage: `${ENTERPRISE_SEARCH_DOCS}connectors-google-cloud.html`,
connectorsGoogleDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-google-drive.html`,
connectorsJira: `${ENTERPRISE_SEARCH_DOCS}connectors-jira.html`,
Expand All @@ -146,12 +148,15 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
connectorsMySQL: `${ENTERPRISE_SEARCH_DOCS}connectors-mysql.html`,
connectorsNative: `${ENTERPRISE_SEARCH_DOCS}connectors.html#connectors-native`,
connectorsNetworkDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-network-drive.html`,
connectorsOneDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-onedrive.html`,
connectorsOracle: `${ENTERPRISE_SEARCH_DOCS}connectors-oracle.html`,
connectorsPostgreSQL: `${ENTERPRISE_SEARCH_DOCS}connectors-postgresql.html`,
connectorsS3: `${ENTERPRISE_SEARCH_DOCS}connectors-s3.html`,
connectorsSalesforce: `${ENTERPRISE_SEARCH_DOCS}connectors-salesforce.html`,
connectorsServiceNow: `${ENTERPRISE_SEARCH_DOCS}connectors-servicenow.html`,
connectorsSharepoint: `${ENTERPRISE_SEARCH_DOCS}connectors-sharepoint.html`,
connectorsSharepointOnline: `${ENTERPRISE_SEARCH_DOCS}connectors-sharepoint-online.html`,
connectorsSlack: `${ENTERPRISE_SEARCH_DOCS}connectors-slack.html`,
connectorsWorkplaceSearch: `${ENTERPRISE_SEARCH_DOCS}workplace-search-connectors.html`,
crawlerExtractionRules: `${ENTERPRISE_SEARCH_DOCS}crawler-extraction-rules.html`,
crawlerManaging: `${ENTERPRISE_SEARCH_DOCS}crawler-managing.html`,
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,25 @@ export interface DocLinks {
readonly connectorsConfluence: string;
readonly connectorsContentExtraction: string;
readonly connectorsDropbox: string;
readonly connectorsGithub: string;
readonly connectorsGoogleCloudStorage: string;
readonly connectorsGoogleDrive: string;
readonly connectorsGmail: string;
readonly connectorsJira: string;
readonly connectorsMicrosoftSQL: string;
readonly connectorsMongoDB: string;
readonly connectorsMySQL: string;
readonly connectorsNative: string;
readonly connectorsNetworkDrive: string;
readonly connectorsOneDrive: string;
readonly connectorsOracle: string;
readonly connectorsPostgreSQL: string;
readonly connectorsS3: string;
readonly connectorsSalesforce: string;
readonly connectorsServiceNow: string;
readonly connectorsSharepoint: string;
readonly connectorsSharepointOnline: string;
readonly connectorsSlack: string;
readonly connectorsWorkplaceSearch: string;
readonly crawlerExtractionRules: string;
readonly crawlerManaging: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const getRulesSchemaMock = (anchorDate: string = ANCHOR_DATE) => ({
enabled: true,
false_positives: ['false positive 1', 'false positive 2'],
from: 'now-6m',
investigation_fields: ['custom.field1', 'custom.field2'],
immutable: false,
name: 'Query with a rule id',
query: 'user.name: root or user.name: admin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ const createSearchFnMock = (nrOfHits: number) => {

const dataViewMock = buildDataViewMock({ name: 'the-data-view', fields: deepMockedFields });

// FLAKY: https://github.com/elastic/kibana/issues/162997
describe.skip('saved search embeddable', () => {
describe('saved search embeddable', () => {
let mountpoint: HTMLDivElement;
let servicesMock: jest.Mocked<DiscoverServices>;

Expand Down Expand Up @@ -322,7 +321,8 @@ describe.skip('saved search embeddable', () => {
expect(search).toHaveBeenCalledTimes(1);
});

it('should not reload when the input title doesnt change', async () => {
// FLAKY: https://github.com/elastic/kibana/issues/162997
it.skip('should not reload when the input title doesnt change', async () => {
const search = jest.fn().mockReturnValue(getSearchResponse(1));
const { embeddable } = createEmbeddable({ searchMock: search, customTitle: 'custom title' });
await waitOneTick();
Expand Down
9 changes: 9 additions & 0 deletions test/plugin_functional/plugins/core_http/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ export class CoreHttpPlugin implements Plugin {
return res.ok();
}
);
router.get(
{
path: '/api/core_http/headers',
validate: false,
},
async (ctx, req, res) => {
return res.ok({ body: req.headers });
}
);
}

public start() {}
Expand Down
Loading

0 comments on commit 8412220

Please sign in to comment.