fleet/cypress/support/constants.ts
Roberto Dip 9a1d2066bb
deprecate host_settings in favor of features (#7358)
Related to #7312, this makes use of the changes introduced in #7353 to rename host_settings to features while keeping backwards compatibility.
2022-08-25 13:41:50 -03:00

247 lines
6.4 KiB
TypeScript

const GOOD_PASSWORD = "password123#";
const BAD_PASSWORD_LENGTH = "password12#";
const BAD_PASSWORD_NO_NUMBER = "password####";
const BAD_PASSWORD_NO_SYMBOL = "password1234";
const CONFIG_INTEGRATIONS_AUTOMATIONS = {
org_info: {
org_name: "Fleet Test",
org_logo_url: "",
},
server_settings: {
server_url: "https://localhost:8642",
live_query_disabled: false,
enable_analytics: true,
deferred_save_host: false,
},
smtp_settings: {
enable_smtp: false,
configured: false,
sender_address: "",
server: "",
port: 587,
authentication_type: "authtype_username_password",
user_name: "",
password: "",
enable_ssl_tls: true,
authentication_method: "authmethod_plain",
domain: "",
verify_ssl_certs: true,
enable_start_tls: true,
},
host_expiry_settings: {
host_expiry_enabled: true,
host_expiry_window: 9,
},
features: {
enable_host_users: true,
enable_software_inventory: true,
},
agent_options: {
config: {
options: {
logger_plugin: "tls",
pack_delimiter: "/",
logger_tls_period: 10,
distributed_plugin: "tls",
disable_distributed: false,
logger_tls_endpoint: "/api/osquery/log",
distributed_interval: 10,
distributed_tls_max_attempts: 3,
},
decorators: {
load: [
"SELECT uuid AS host_uuid FROM system_info;",
"SELECT hostname AS hostname FROM system_info;",
],
},
},
overrides: {},
},
sso_settings: {
entity_id: "",
issuer_uri: "",
idp_image_url: "",
metadata: "",
metadata_url: "",
idp_name: "",
enable_sso: false,
enable_sso_idp_login: false,
enable_jit_provisioning: false,
},
vulnerability_settings: {
databases_path: "",
},
webhook_settings: {
host_status_webhook: {
enable_host_status_webhook: false,
destination_url: "",
host_percentage: 0,
days_count: 0,
},
failing_policies_webhook: {
enable_failing_policies_webhook: false,
destination_url: "ok.com",
policy_ids: [5, 10],
host_batch_size: 0,
},
vulnerabilities_webhook: {
enable_vulnerabilities_webhook: false,
destination_url: "",
host_batch_size: 0,
},
interval: "24h0m0s",
},
integrations: {
jira: [
{
url: "https://fleetdm.atlassian.com",
username: "jira1@example.com",
api_token: "jira123",
project_key: "PROJECT 1",
enable_failing_policies: true,
enable_software_vulnerabilities: true,
},
{
url: "https://fleetdm.atlassian.com",
username: "jira2@example.com",
api_token: "jira123",
project_key: "PROJECT 2",
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
],
zendesk: [
{
url: "https://fleetdm.zendesk.com",
email: "zendesk1@example.com",
api_token: "zendesk123",
group_id: 12345678,
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
{
url: "https://fleetdm.zendesk.com",
email: "zendesk2@example.com",
api_token: "zendesk123",
group_id: 87654321,
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
],
},
update_interval: {
osquery_detail: 3600000000000,
osquery_policy: 3600000000000,
},
vulnerabilities: {
databases_path: "/tmp/vulndbs",
periodicity: 3600000000000,
cpe_database_url: "",
cve_feed_prefix_url: "",
current_instance_checks: "auto",
disable_data_sync: false,
recent_vulnerability_max_age: 2592000000000000,
},
license: {
tier: "premium",
organization: "development-only",
device_count: 100,
expiration: "2099-06-30T20:00:00-04:00",
note: "for development only",
},
logging: {
debug: false,
json: false,
result: {
plugin: "filesystem",
config: {
status_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_status",
result_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_result",
enable_log_rotation: false,
enable_log_compression: false,
},
},
status: {
plugin: "filesystem",
config: {
status_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_status",
result_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_result",
enable_log_rotation: false,
enable_log_compression: false,
},
},
},
};
const CONFIG_INTEGRATIONS_AUTOMATIONS_DISABLED = {
...CONFIG_INTEGRATIONS_AUTOMATIONS,
integrations: {
jira: [
{
url: "https://fleetdm.atlassian.com",
username: "jira1@example.com",
api_token: "jira123",
project_key: "PROJECT 1",
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
{
url: "https://fleetdm.atlassian.com",
username: "jira2@example.com",
api_token: "jira123",
project_key: "PROJECT 2",
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
],
zendesk: [
{
url: "https://fleetdm.zendesk.com",
email: "zendesk1@example.com",
api_token: "zendesk123",
group_id: 12345678,
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
{
url: "https://fleetdm.zendesk.com",
email: "zendesk2@example.com",
api_token: "zendesk123",
group_id: 87654321,
enable_failing_policies: false,
enable_software_vulnerabilities: false,
},
],
},
webhook_settings: {
host_status_webhook: {
enable_host_status_webhook: false,
destination_url: "",
host_percentage: 0,
days_count: 0,
},
failing_policies_webhook: {
enable_failing_policies_webhook: false,
destination_url: "ok.com",
policy_ids: [5, 10],
host_batch_size: 0,
},
vulnerabilities_webhook: {
destination_url: "www.foo.com/bar",
enable_vulnerabilities_webhook: false,
},
},
};
export default {
GOOD_PASSWORD,
BAD_PASSWORD_LENGTH,
BAD_PASSWORD_NO_NUMBER,
BAD_PASSWORD_NO_SYMBOL,
CONFIG_INTEGRATIONS_AUTOMATIONS,
CONFIG_INTEGRATIONS_AUTOMATIONS_DISABLED,
};