-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into sharedux-chrome-nav…
…/replace-v1
- Loading branch information
Showing
117 changed files
with
4,129 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
docs/management/connectors/action-types/d3security.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
[[d3security-action-type]] | ||
== D3 Security connector and action | ||
++++ | ||
<titleabbrev>D3 Security</titleabbrev> | ||
++++ | ||
|
||
The D3 Security connector uses https://github.com/axios/axios[axios] to send a POST request to a D3 Security endpoint. The connector uses the <<execute-connector-api,run connector API>> to send the request. You can use the connector for rule actions. | ||
|
||
[float] | ||
[[d3security-connector-prerequisites]] | ||
=== Prerequisites | ||
|
||
To use a D3 Security connector, you must first configure a webhook key in your D3 SOAR environment. To generate an API URL and a token in D3 Security: | ||
1. Log in to your D3 SOAR environment. | ||
2. Navigate to Configuration. | ||
3. Navigate to Integration > Search for “Kibana”. Click “Fetch Event”. | ||
4. Select the "Enable Webhook" checkbox. | ||
5. Click Set up Webhook Keys. | ||
6. Under Event Ingestion, Click +. Select the site for the webhook integration, then click Generate. | ||
7. Copy the Request URL and Request Header Value to configure the Kibana connector | ||
|
||
[float] | ||
[[define-d3security-ui]] | ||
=== Create connectors in {kib} | ||
|
||
You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example: | ||
|
||
[role="screenshot"] | ||
image::management/connectors/images/d3security-connector.png[D3 Security connector] | ||
|
||
[float] | ||
[[d3security-connector-configuration]] | ||
==== Connector configuration | ||
|
||
D3 Security connectors have the following configuration properties: | ||
|
||
Name:: The name of the connector. | ||
URL:: The D3 Security API request URL. | ||
Token:: The D3 Security token | ||
|
||
[float] | ||
[[preconfigured-d3security-configuration]] | ||
=== Create preconfigured connectors | ||
|
||
If you are running {kib} on-prem, you can define connectors by | ||
adding `xpack.actions.preconfigured` settings to your `kibana.yml` file. | ||
For example: | ||
|
||
[source,text] | ||
-- | ||
xpack.actions.preconfigured: | ||
my-d3security: | ||
name: preconfigured-d3security-connector-type | ||
actionTypeId: .d3security | ||
config: | ||
url: https://testurl.com/elasticsearch/VSOC/api/Data/Kibana/Security%20Operations/CreateEvents | ||
secrets: | ||
token: superlongtoken | ||
-- | ||
|
||
Config defines information for the connector type. | ||
|
||
`url`:: A URL string that corresponds to the *D3 Security API URL*. | ||
|
||
Secrets defines sensitive information for the connector type. | ||
|
||
`token`:: A string that corresponds to *D3 Security API Token*. | ||
|
||
[float] | ||
[[d3security-action-configuration]] | ||
=== Test connectors | ||
|
||
You can test connectors with the <<execute-connector-api,run connector API>> or | ||
as you're creating or editing the connector in {kib}. For example: | ||
|
||
[role="screenshot"] | ||
image::management/connectors/images/d3security-params-test.png[D3 Security params test] | ||
|
||
The D3 Security actions have the following configuration properties. | ||
|
||
Body:: A typeless payload sent to the D3 Security API URL. For example: | ||
+ | ||
[source,text] | ||
-- | ||
this can be any type, it is not validated | ||
-- | ||
[float] | ||
[[d3security-connector-networking-configuration]] | ||
=== Connector networking configuration | ||
|
||
Use the <<action-settings, Action configuration settings>> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...ed-objects/core-saved-objects-api-server-internal/src/lib/apis/helpers/validation.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { loggerMock, type MockedLogger } from '@kbn/logging-mocks'; | ||
import { SavedObjectsType } from '@kbn/core-saved-objects-server'; | ||
import { type SavedObjectSanitizedDoc } from '@kbn/core-saved-objects-server'; | ||
import { ValidationHelper } from './validation'; | ||
import { typedef, typedef1, typedef2 } from './validation_fixtures'; | ||
import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; | ||
|
||
const defaultVersion = '8.10.0'; | ||
const modelVirtualVersion = '10.1.0'; | ||
const typeA = 'my-typeA'; | ||
const typeB = 'my-typeB'; | ||
const typeC = 'my-typeC'; | ||
|
||
describe('Saved Objects type validation helper', () => { | ||
let helper: ValidationHelper; | ||
let logger: MockedLogger; | ||
let typeRegistry: SavedObjectTypeRegistry; | ||
|
||
const createMockObject = ( | ||
type: string, | ||
attr: Partial<SavedObjectSanitizedDoc> | ||
): SavedObjectSanitizedDoc => ({ | ||
type, | ||
id: 'test-id', | ||
references: [], | ||
attributes: {}, | ||
...attr, | ||
}); | ||
const registerType = (name: string, parts: Partial<SavedObjectsType>) => { | ||
typeRegistry.registerType({ | ||
name, | ||
hidden: false, | ||
namespaceType: 'single', | ||
mappings: { properties: {} }, | ||
...parts, | ||
}); | ||
}; | ||
beforeEach(() => { | ||
logger = loggerMock.create(); | ||
typeRegistry = new SavedObjectTypeRegistry(); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
describe('validation helper', () => { | ||
beforeEach(() => { | ||
registerType(typeA, typedef); | ||
registerType(typeB, typedef1); | ||
registerType(typeC, typedef2); | ||
}); | ||
|
||
it('should validate objects against stack versions', () => { | ||
helper = new ValidationHelper({ | ||
logger, | ||
registry: typeRegistry, | ||
kibanaVersion: defaultVersion, | ||
}); | ||
const data = createMockObject(typeA, { attributes: { foo: 'hi', count: 1 } }); | ||
expect(() => helper.validateObjectForCreate(typeA, data)).not.toThrowError(); | ||
}); | ||
|
||
it('should validate objects against model versions', () => { | ||
helper = new ValidationHelper({ | ||
logger, | ||
registry: typeRegistry, | ||
kibanaVersion: modelVirtualVersion, | ||
}); | ||
const data = createMockObject(typeB, { attributes: { foo: 'hi', count: 1 } }); | ||
expect(() => helper.validateObjectForCreate(typeB, data)).not.toThrowError(); | ||
}); | ||
|
||
it('should fail validation against invalid objects when version requested does not support a field', () => { | ||
helper = new ValidationHelper({ | ||
logger, | ||
registry: typeRegistry, | ||
kibanaVersion: defaultVersion, | ||
}); | ||
const validationError = new Error( | ||
'[attributes.count]: definition for this key is missing: Bad Request' | ||
); | ||
const data = createMockObject(typeC, { attributes: { foo: 'hi', count: 1 } }); | ||
expect(() => helper.validateObjectForCreate(typeC, data)).toThrowError(validationError); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.