2021-08-16 14:30:19 +00:00
|
|
|
/* Config interface is a flattened version of the fleet/config API response */
|
|
|
|
|
2022-02-05 00:48:35 +00:00
|
|
|
import {
|
|
|
|
IWebhookHostStatus,
|
|
|
|
IWebhookFailingPolicies,
|
|
|
|
IWebhookSoftwareVulnerabilities,
|
|
|
|
} from "interfaces/webhook";
|
2021-04-12 13:32:25 +00:00
|
|
|
import PropTypes from "prop-types";
|
2022-04-11 19:04:41 +00:00
|
|
|
import { IIntegrations } from "./integration";
|
2016-10-21 23:13:41 +00:00
|
|
|
|
|
|
|
export default PropTypes.shape({
|
2021-08-16 14:30:19 +00:00
|
|
|
org_name: PropTypes.string,
|
|
|
|
org_logo_url: PropTypes.string,
|
|
|
|
server_url: PropTypes.string,
|
2020-01-14 00:53:04 +00:00
|
|
|
live_query_disabled: PropTypes.bool,
|
2021-06-23 22:19:01 +00:00
|
|
|
enable_analytics: PropTypes.bool,
|
2021-08-16 14:30:19 +00:00
|
|
|
enable_smtp: PropTypes.bool,
|
|
|
|
configured: PropTypes.bool,
|
2016-12-23 18:40:16 +00:00
|
|
|
sender_address: PropTypes.string,
|
|
|
|
server: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
port: PropTypes.number,
|
|
|
|
authentication_type: PropTypes.string,
|
2016-12-23 18:40:16 +00:00
|
|
|
user_name: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
password: PropTypes.string,
|
|
|
|
enable_ssl_tls: PropTypes.bool,
|
|
|
|
authentication_method: PropTypes.string,
|
|
|
|
domain: PropTypes.string,
|
2016-12-23 18:40:16 +00:00
|
|
|
verify_sll_certs: PropTypes.bool,
|
2021-08-16 14:30:19 +00:00
|
|
|
enable_start_tls: PropTypes.bool,
|
|
|
|
entity_id: PropTypes.string,
|
|
|
|
issuer_uri: PropTypes.string,
|
|
|
|
idp_image_url: PropTypes.string,
|
|
|
|
metadata: PropTypes.string,
|
2022-01-21 17:06:58 +00:00
|
|
|
metadata_url: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
idp_name: PropTypes.string,
|
|
|
|
enable_sso: PropTypes.bool,
|
|
|
|
enable_sso_idp_login: PropTypes.bool,
|
2022-08-15 18:26:55 +00:00
|
|
|
enable_jit_provisioning: PropTypes.bool,
|
2021-08-16 14:30:19 +00:00
|
|
|
host_expiry_enabled: PropTypes.bool,
|
|
|
|
host_expiry_window: PropTypes.number,
|
|
|
|
agent_options: PropTypes.string,
|
2021-05-18 15:08:48 +00:00
|
|
|
tier: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
organization: PropTypes.string,
|
|
|
|
device_count: PropTypes.number,
|
|
|
|
expiration: PropTypes.string,
|
2023-02-01 17:47:52 +00:00
|
|
|
mdm_feature_flag_enabled: PropTypes.bool,
|
2023-01-16 14:10:12 +00:00
|
|
|
mdm: PropTypes.shape({
|
2023-02-01 17:47:52 +00:00
|
|
|
enabled_and_configured: PropTypes.bool,
|
2023-01-16 14:10:12 +00:00
|
|
|
apple_bm_terms_expired: PropTypes.bool,
|
2023-01-27 22:25:53 +00:00
|
|
|
macos_updates: PropTypes.shape({
|
|
|
|
minimum_version: PropTypes.string,
|
|
|
|
deadline: PropTypes.string,
|
|
|
|
}),
|
2023-01-16 14:10:12 +00:00
|
|
|
}),
|
2021-08-16 14:30:19 +00:00
|
|
|
note: PropTypes.string,
|
|
|
|
// vulnerability_settings: PropTypes.any, TODO
|
2021-09-10 17:49:11 +00:00
|
|
|
enable_host_status_webhook: PropTypes.bool,
|
|
|
|
destination_url: PropTypes.string,
|
|
|
|
host_percentage: PropTypes.number,
|
|
|
|
days_count: PropTypes.number,
|
2021-08-10 22:53:47 +00:00
|
|
|
logging: PropTypes.shape({
|
|
|
|
debug: PropTypes.bool,
|
|
|
|
json: PropTypes.bool,
|
|
|
|
result: PropTypes.shape({
|
|
|
|
plugin: PropTypes.string,
|
|
|
|
config: PropTypes.shape({
|
2021-08-16 14:30:19 +00:00
|
|
|
status_log_file: PropTypes.string,
|
|
|
|
result_log_file: PropTypes.string,
|
|
|
|
enable_log_rotation: PropTypes.bool,
|
|
|
|
enable_log_compression: PropTypes.bool,
|
2021-08-10 22:53:47 +00:00
|
|
|
}),
|
|
|
|
}),
|
|
|
|
status: PropTypes.shape({
|
|
|
|
plugin: PropTypes.string,
|
|
|
|
config: PropTypes.shape({
|
|
|
|
status_log_file: PropTypes.string,
|
|
|
|
result_log_file: PropTypes.string,
|
|
|
|
enable_log_rotation: PropTypes.bool,
|
|
|
|
enable_log_compression: PropTypes.bool,
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
}),
|
2016-10-21 23:13:41 +00:00
|
|
|
});
|
2021-05-18 15:08:48 +00:00
|
|
|
|
2022-11-18 16:25:39 +00:00
|
|
|
export interface ILicense {
|
|
|
|
tier: string;
|
|
|
|
device_count: number;
|
|
|
|
expiration: string;
|
|
|
|
note: string;
|
|
|
|
organization: string;
|
|
|
|
}
|
|
|
|
|
2023-02-01 17:47:52 +00:00
|
|
|
export interface IMdmConfig {
|
|
|
|
enabled_and_configured: boolean;
|
|
|
|
apple_bm_terms_expired: boolean;
|
|
|
|
macos_updates: {
|
|
|
|
minimum_version: string;
|
|
|
|
deadline: string;
|
|
|
|
};
|
2023-03-14 20:03:02 +00:00
|
|
|
macos_settings: {
|
|
|
|
custom_settings: null; // TODO: type?
|
|
|
|
enable_disk_encryption: boolean;
|
|
|
|
};
|
2023-02-01 17:47:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IDeviceGlobalConfig {
|
|
|
|
mdm: Pick<IMdmConfig, "enabled_and_configured">;
|
|
|
|
}
|
|
|
|
|
2022-06-11 17:23:02 +00:00
|
|
|
export interface IFleetDesktopSettings {
|
|
|
|
transparency_url: string;
|
|
|
|
}
|
|
|
|
|
2022-01-21 17:06:58 +00:00
|
|
|
export interface IConfigFormData {
|
|
|
|
smtpAuthenticationMethod: string;
|
|
|
|
smtpAuthenticationType: string;
|
|
|
|
domain: string;
|
2023-02-22 14:05:38 +00:00
|
|
|
smtpEnableSslTls: boolean;
|
|
|
|
enableStartTls: boolean;
|
|
|
|
serverUrl: string;
|
|
|
|
orgLogoUrl: string;
|
2022-01-21 17:06:58 +00:00
|
|
|
orgName: string;
|
|
|
|
smtpPassword: string;
|
|
|
|
smtpPort?: number;
|
|
|
|
smtpSenderAddress: string;
|
|
|
|
smtpServer: string;
|
|
|
|
smtpUsername: string;
|
2023-02-22 14:05:38 +00:00
|
|
|
verifySslCerts: boolean;
|
|
|
|
entityId: string;
|
|
|
|
issuerUri: string;
|
|
|
|
idpImageUrl: string;
|
2022-01-21 17:06:58 +00:00
|
|
|
metadata: string;
|
2023-02-22 14:05:38 +00:00
|
|
|
metadataUrl: string;
|
2022-01-21 17:06:58 +00:00
|
|
|
idpName: string;
|
2023-02-22 14:05:38 +00:00
|
|
|
enableSso: boolean;
|
|
|
|
enableSsoIdpLogin: boolean;
|
|
|
|
enableSmtp: boolean;
|
2022-01-21 17:06:58 +00:00
|
|
|
enableHostExpiry: boolean;
|
|
|
|
hostExpiryWindow: number;
|
|
|
|
disableLiveQuery: boolean;
|
|
|
|
agentOptions: any;
|
|
|
|
enableHostStatusWebhook: boolean;
|
2023-02-22 14:05:38 +00:00
|
|
|
hostStatusWebhookDestinationUrl?: string;
|
2022-01-21 17:06:58 +00:00
|
|
|
hostStatusWebhookHostPercentage?: number;
|
|
|
|
hostStatusWebhookDaysCount?: number;
|
|
|
|
enableUsageStatistics: boolean;
|
2023-02-22 14:05:38 +00:00
|
|
|
transparencyUrl: string;
|
2022-01-21 17:06:58 +00:00
|
|
|
}
|
|
|
|
|
2022-10-19 19:00:39 +00:00
|
|
|
export interface IConfigFeatures {
|
|
|
|
enable_host_users: boolean;
|
|
|
|
enable_software_inventory: boolean;
|
|
|
|
}
|
|
|
|
|
2022-04-07 16:08:00 +00:00
|
|
|
export interface IConfig {
|
2022-01-21 17:06:58 +00:00
|
|
|
org_info: {
|
|
|
|
org_name: string;
|
|
|
|
org_logo_url: string;
|
|
|
|
};
|
2022-07-13 16:00:16 +00:00
|
|
|
sandbox_enabled: boolean;
|
2022-01-21 17:06:58 +00:00
|
|
|
server_settings: {
|
|
|
|
server_url: string;
|
|
|
|
live_query_disabled: boolean;
|
|
|
|
enable_analytics: boolean;
|
|
|
|
};
|
|
|
|
smtp_settings: {
|
|
|
|
enable_smtp: boolean;
|
|
|
|
configured: boolean;
|
|
|
|
sender_address: string;
|
|
|
|
server: string;
|
|
|
|
port?: number;
|
|
|
|
authentication_type: string;
|
|
|
|
user_name: string;
|
|
|
|
password: string;
|
|
|
|
enable_ssl_tls: boolean;
|
|
|
|
authentication_method: string;
|
|
|
|
domain: string;
|
|
|
|
verify_ssl_certs: boolean;
|
|
|
|
enable_start_tls: boolean;
|
|
|
|
};
|
|
|
|
sso_settings: {
|
|
|
|
entity_id: string;
|
|
|
|
issuer_uri: string;
|
|
|
|
idp_image_url: string;
|
|
|
|
metadata: string;
|
|
|
|
metadata_url: string;
|
|
|
|
idp_name: string;
|
|
|
|
enable_sso: boolean;
|
|
|
|
enable_sso_idp_login: boolean;
|
2022-08-15 18:26:55 +00:00
|
|
|
enable_jit_provisioning: boolean;
|
2022-01-21 17:06:58 +00:00
|
|
|
};
|
|
|
|
host_expiry_settings: {
|
|
|
|
host_expiry_enabled: boolean;
|
|
|
|
host_expiry_window: number;
|
|
|
|
};
|
2022-10-19 19:00:39 +00:00
|
|
|
features: IConfigFeatures;
|
2022-01-21 17:06:58 +00:00
|
|
|
agent_options: string;
|
|
|
|
update_interval: {
|
|
|
|
osquery_detail: number;
|
|
|
|
osquery_policy: number;
|
|
|
|
};
|
2022-11-18 16:25:39 +00:00
|
|
|
license: ILicense;
|
2022-06-11 17:23:02 +00:00
|
|
|
fleet_desktop: IFleetDesktopSettings;
|
2022-02-08 00:52:55 +00:00
|
|
|
vulnerabilities: {
|
2022-01-21 17:06:58 +00:00
|
|
|
databases_path: string;
|
2022-02-08 00:52:55 +00:00
|
|
|
periodicity: number;
|
|
|
|
cpe_database_url: string;
|
|
|
|
cve_feed_prefix_url: string;
|
|
|
|
current_instance_checks: string;
|
|
|
|
disable_data_sync: boolean;
|
2022-04-13 18:45:50 +00:00
|
|
|
recent_vulnerability_max_age: number;
|
2022-01-21 17:06:58 +00:00
|
|
|
};
|
2022-02-08 00:52:55 +00:00
|
|
|
// Note: `vulnerability_settings` is deprecated and should not be used
|
|
|
|
// vulnerability_settings: {
|
|
|
|
// databases_path: string;
|
|
|
|
// };
|
2022-06-13 23:21:24 +00:00
|
|
|
webhook_settings: IWebhookSettings;
|
2022-04-11 19:04:41 +00:00
|
|
|
integrations: IIntegrations;
|
2022-01-21 17:06:58 +00:00
|
|
|
logging: {
|
|
|
|
debug: boolean;
|
|
|
|
json: boolean;
|
|
|
|
result: {
|
|
|
|
plugin: string;
|
|
|
|
config: {
|
|
|
|
status_log_file: string;
|
|
|
|
result_log_file: string;
|
|
|
|
enable_log_rotation: boolean;
|
|
|
|
enable_log_compression: boolean;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
status: {
|
|
|
|
plugin: string;
|
|
|
|
config: {
|
|
|
|
status_log_file: string;
|
|
|
|
result_log_file: string;
|
|
|
|
enable_log_rotation: boolean;
|
|
|
|
enable_log_compression: boolean;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 17:47:52 +00:00
|
|
|
mdm: IMdmConfig;
|
|
|
|
mdm_feature_flag_enabled: boolean;
|
2021-05-18 15:08:48 +00:00
|
|
|
}
|
2022-06-13 23:21:24 +00:00
|
|
|
|
|
|
|
export interface IWebhookSettings {
|
|
|
|
failing_policies_webhook: IWebhookFailingPolicies;
|
|
|
|
host_status_webhook: IWebhookHostStatus;
|
|
|
|
vulnerabilities_webhook: IWebhookSoftwareVulnerabilities;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type IAutomationsConfig = Pick<
|
|
|
|
IConfig,
|
|
|
|
"webhook_settings" | "integrations"
|
|
|
|
>;
|
2022-10-19 19:00:39 +00:00
|
|
|
|
|
|
|
export const CONFIG_DEFAULT_RECENT_VULNERABILITY_MAX_AGE_IN_DAYS = 30;
|