Skip to content

Commit

Permalink
[SECURITY_SOLUTION] 145: Advanced Policy UI (#80390) (#82363)
Browse files Browse the repository at this point in the history
* Create Policies for each generated host

* Refactor Ingest setup to also setup Fleet

* Rename prop name

* Add generic response type to KbnClient.request + support for headers

* first attempt at adding fleet agent registration

* a little closer with fleet integration

* SUCCESS. Able to enroll agent and set it to online

* update names to be policy

* policy generator has advanced types in endpoint confit

* linting

* flesh out callback

* add submit button for verify_peer

* add verify hostname field

* 145 generalize cb

* 145 fix setAgain and getValue

* 145 merge conflict

* 145 add verify_hostname back, start loop for form

* 145 remove OS trick

* 145 make AdvancedPolicyForms its own component

* 145 grid partially working

* 145 back to basics

* 145 back to basics

* 145 rolled back grid

* 145 flex table working

* 145 undo accidental change

* 145 remove extra schema file

* 145 remove unused variable

* 145 kevin's PR feedback

* 145 fix type check and jest

* 145 EuiFlexGroups

* 145 use simple EuiFormRow and add show/hide buttons

* 145 move all advanced policy code to advanced file; remove unnec test code

* 145 fix IDs

* 145 take out unnecessary stuff

* 145 removed a couple more lines

* 145 add some fields back in

* 145 add spacer

Co-authored-by: Paul Tavares <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kevinlog <[email protected]>
Co-authored-by: Candace Park <[email protected]>

Co-authored-by: Paul Tavares <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kevinlog <[email protected]>
Co-authored-by: Candace Park <[email protected]>
  • Loading branch information
5 people authored Nov 3, 2020
1 parent 93917fe commit e7cdafe
Show file tree
Hide file tree
Showing 9 changed files with 477 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ type KbnConfigSchemaNonOptionalProps<Props extends Record<string, unknown>> = Pi
*/
export interface PolicyConfig {
windows: {
advanced?: {};
events: {
dll_and_driver_load: boolean;
dns: boolean;
Expand All @@ -881,6 +882,7 @@ export interface PolicyConfig {
};
};
mac: {
advanced?: {};
events: {
file: boolean;
process: boolean;
Expand All @@ -898,6 +900,7 @@ export interface PolicyConfig {
};
};
linux: {
advanced?: {};
events: {
file: boolean;
process: boolean;
Expand All @@ -916,15 +919,15 @@ export interface UIPolicyConfig {
/**
* Windows-specific policy configuration that is supported via the UI
*/
windows: Pick<PolicyConfig['windows'], 'events' | 'malware' | 'popup'>;
windows: Pick<PolicyConfig['windows'], 'events' | 'malware' | 'popup' | 'advanced'>;
/**
* Mac-specific policy configuration that is supported via the UI
*/
mac: Pick<PolicyConfig['mac'], 'malware' | 'events' | 'popup'>;
mac: Pick<PolicyConfig['mac'], 'malware' | 'events' | 'popup' | 'advanced'>;
/**
* Linux-specific policy configuration that is supported via the UI
*/
linux: Pick<PolicyConfig['linux'], 'events'>;
linux: Pick<PolicyConfig['linux'], 'events' | 'advanced'>;
}

/** Policy: Malware protection fields */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

interface AdvancedPolicySchemaType {
key: string;
first_supported_version: string;
last_supported_version?: string;
documentation: string;
}

export const AdvancedPolicySchema: AdvancedPolicySchemaType[] = [
{
key: 'linux.advanced.agent.connection_delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.global.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.global.manifest_relative_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.global.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.global.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.global.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.user.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.user.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.user.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.artifacts.user.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.elasticsearch.delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'linux.advanced.elasticsearch.tls.verify_peer',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'linux.advanced.elasticsearch.tls.verify_hostname',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'linux.advanced.elasticsearch.tls.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.agent.connection_delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.global.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.global.manifest_relative_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.global.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.global.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.global.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.user.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.user.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.user.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.artifacts.user.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.elasticsearch.delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.elasticsearch.tls.verify_peer',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'mac.advanced.elasticsearch.tls.verify_hostname',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'mac.advanced.elasticsearch.tls.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.malware.quarantine',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.kernel.connect',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.kernel.harden',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.kernel.process',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.kernel.filewrite',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'mac.advanced.kernel.network',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.agent.connection_delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.global.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.global.manifest_relative_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.global.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.global.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.global.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.user.base_url',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.user.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.user.public_key',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.artifacts.user.interval',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.elasticsearch.delay',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.elasticsearch.tls.verify_peer',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'windows.advanced.elasticsearch.tls.verify_hostname',
first_supported_version: '7.11',
documentation: 'default is true',
},
{
key: 'windows.advanced.elasticsearch.tls.ca_cert',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.malware.quarantine',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.ransomware.mbr',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.ransomware.canary',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.connect',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.harden',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.process',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.filewrite',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.network',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.fileopen',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.asyncimageload',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.syncimageload',
first_supported_version: '7.11',
documentation: '',
},
{
key: 'windows.advanced.kernel.registry',
first_supported_version: '7.11',
documentation: '',
},
];
Loading

0 comments on commit e7cdafe

Please sign in to comment.