diff --git a/src/steps/devices/__snapshots__/computerEntityConverter.test.ts.snap b/src/steps/devices/__snapshots__/computerEntityConverter.test.ts.snap new file mode 100644 index 0000000..dee4a1a --- /dev/null +++ b/src/steps/devices/__snapshots__/computerEntityConverter.test.ts.snap @@ -0,0 +1,394 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`#createComputerEntity should convert data 1`] = ` +Object { + "_class": Array [ + "Host", + "Device", + ], + "_key": "ABC123DEF456", + "_rawData": Array [ + Object { + "name": "default", + "rawData": Object { + "building": "", + "department": "", + "id": 1, + "mac_address": "12:34:67:8A:9B:1C", + "managed": true, + "model": "MacBookPro13,3", + "name": "John’s MacBook", + "report_date_epoch": 1560787256384, + "report_date_utc": "2019-06-17T16:00:56.384+0000", + "serial_number": "ABC123DEF456", + "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", + "username": "john", + }, + }, + Object { + "name": "detail", + "rawData": Object { + "certificates": Array [ + Object { + "common_name": "com.apple.kerberos.kdc", + "expires_epoch": "", + "expires_utc": "", + "identity": true, + "name": "", + }, + Object { + "common_name": "Apple Worldwide Developer Relations Certification Authority", + "expires_epoch": 1675806527000, + "expires_utc": "2023-02-07T21:48:47.000+0000", + "identity": false, + "name": "", + }, + ], + "configuration_profiles": Array [ + Object { + "id": -2, + "is_removable": false, + "name": "", + "uuid": "", + }, + Object { + "id": -1, + "is_removable": false, + "name": "", + "uuid": "", + }, + ], + "extension_attributes": Array [ + Object { + "id": 1, + "name": "123", + "value": Array [ + "foo123", + "bar123", + ], + }, + Object { + "id": 2, + "name": "456", + "value": Array [ + "foo456", + "bar456", + ], + }, + Object { + "id": 3, + "name": "Deployment status", + "value": Array [ + "active", + ], + }, + ], + "general": Object { + "alt_mac_address": "12:34:56:78:90:12", + "alt_network_adapter_type": "Ethernet", + "asset_tag": "", + "barcode_1": "", + "barcode_2": "", + "distribution_point": "", + "id": 1, + "initial_entry_date": "2020-06-03", + "initial_entry_date_epoch": 1591217314697, + "initial_entry_date_utc": "2020-06-03T20:48:34.697+0000", + "ip_address": "12.34.567.890", + "itunes_store_account_is_active": true, + "jamf_version": "10.23.0-t1595614145", + "last_cloud_backup_date_epoch": 0, + "last_cloud_backup_date_utc": "", + "last_contact_time": "2020-08-09 13:24:00", + "last_contact_time_epoch": 1596979440636, + "last_contact_time_utc": "2020-08-09T13:24:00.636+0000", + "last_enrolled_date_epoch": 1591217314697, + "last_enrolled_date_utc": "2020-06-03T20:48:34.697+0000", + "last_reported_ip": "192.168.1.139", + "mac_address": "12:34:67:8A:9B:1C", + "management_status": Object { + "enrolled_via_dep": false, + "user_approved_enrollment": false, + "user_approved_mdm": false, + }, + "mdm_capable": true, + "mdm_capable_users": Object { + "mdm_capable_user": "john.doe", + }, + "mdm_profile_expiration_epoch": 1748983791000, + "mdm_profile_expiration_utc": "2025-06-03T20:49:51.000+0000", + "name": "John's MacBook", + "netboot_server": "", + "network_adapter_type": "IEEE80211", + "platform": "Mac", + "remote_management": Object { + "managed": true, + "management_password_sha256": "abc123", + "management_username": "macOS", + }, + "report_date": "2020-08-03 12:24:29", + "report_date_epoch": 1596457469968, + "report_date_utc": "2020-08-03T12:24:29.968+0000", + "serial_number": "ABC123DEF456", + "site": Object { + "id": 1, + "name": "Test site", + }, + "supervised": false, + "sus": "", + "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", + }, + "groups_accounts": Object { + "computer_group_memberships": Array [ + "All Managed Clients", + ], + "local_accounts": Array [ + Object { + "administrator": true, + "filevault_enabled": true, + "home": "/Users/john", + "home_size": "-1MB", + "home_size_mb": -1, + "name": "john.doe", + "realname": "John", + "uid": "501", + }, + Object { + "administrator": true, + "filevault_enabled": true, + "home": "/Users/macOS", + "home_size": "-1MB", + "home_size_mb": -1, + "name": "macOS", + "realname": "macOS", + "uid": "502", + }, + ], + "user_inventories": Object { + "disable_automatic_login": true, + "user": Object { + "password_history_depth": "", + "password_max_age": "", + "password_min_complex_characters": "", + "password_min_length": "4", + "password_require_alphanumeric": "false", + "username": "macOS", + }, + }, + }, + "hardware": Object { + "active_directory_status": "Not Bound", + "available_ram_slots": 0, + "battery_capacity": 93, + "ble_capable": true, + "boot_rom": "204.0.0.0.0", + "bus_speed": 0, + "bus_speed_mhz": 0, + "cache_size": 8192, + "cache_size_kb": 8192, + "disk_encryption_configuration": "", + "filevault2_users": Array [ + "macOS", + "john.doe", + ], + "gatekeeper_status": "App Store and identified developers", + "institutional_recovery_key": "Not Present", + "make": "Apple", + "mapped_printers": Array [ + Object { + "location": "", + "name": "Brother ABC", + "type": "Brother ABC", + "uri": "dnssd://Brother%20ABC._pdl-datastream._tcp.local./?bidi", + }, + ], + "master_password_set": false, + "model": "15-inch Retina MacBook Pro with TouchID (Mid 2017)", + "model_identifier": "MacBookPro14,3", + "nic_speed": "n/a", + "number_cores": 4, + "number_processors": 1, + "optical_drive": "", + "os_build": "19D76", + "os_name": "Mac OS X", + "os_version": "10.15", + "processor_architecture": "x86_64", + "processor_speed": 3100, + "processor_speed_mhz": 3100, + "processor_type": "Quad-Core Intel Core i7", + "service_pack": "", + "sip_status": "Enabled", + "smc_version": "2.45f1", + "storage": Array [ + Object { + "connection_type": "NO", + "disk": "disk0", + "drive_capacity_mb": 1000555, + "model": "APPLE SSD SM1024L", + "partitions": Array [ + Object { + "available_mb": 207295, + "boot_drive_available_mb": 207295, + "filevault2_percent": 100, + "filevault2_status": "Encrypted", + "filevault_percent": 100, + "filevault_status": "Encrypted", + "lvUUID": "", + "lvgUUID": "", + "name": "Macintosh HD (Boot Partition)", + "partition_capacity_mb": 1000240, + "percentage_full": 5, + "pvUUID": "", + "size": 1000240, + "type": "boot", + }, + Object { + "available_mb": 207295, + "filevault2_percent": 100, + "filevault2_status": "Encrypted", + "filevault_percent": 100, + "filevault_status": "Encrypted", + "name": "Data", + "partition_capacity_mb": 1000240, + "percentage_full": 79, + "size": 1000240, + "type": "other", + }, + ], + "revision": "CXS5EA0Q", + "serial_number": "123ABC", + "size": 1000555, + "smart_status": "Verified", + }, + ], + "total_ram": 16384, + "total_ram_mb": 16384, + "xprotect_version": "2127", + }, + "iphones": Array [], + "location": Object { + "building": "", + "department": "", + "email_address": "JOHN.doe@test.com", + "phone": "111", + "phone_number": "111", + "position": "CISO", + "real_name": "John Doe", + "realname": "John Doe", + "room": "", + "username": "john.doe", + }, + "peripherals": Array [], + "purchasing": Object { + "applecare_id": "", + "attachments": Array [], + "is_leased": false, + "is_purchased": true, + "lease_expires": "", + "lease_expires_epoch": 0, + "lease_expires_utc": "", + "life_expectancy": 0, + "os_applecare_id": "", + "os_maintenance_expires": "", + "po_date": "", + "po_date_epoch": 0, + "po_date_utc": "", + "po_number": "", + "purchase_price": "", + "purchasing_account": "", + "purchasing_contact": "", + "vendor": "", + "warranty_expires": "", + "warranty_expires_epoch": 0, + "warranty_expires_utc": "", + }, + "security": Object { + "activation_lock": false, + "external_boot_level": "not supported", + "firewall_enabled": false, + "secure_boot_level": "not supported", + }, + "software": Object { + "applications": Array [ + Object { + "bundle_id": "com.github.atom", + "name": "Atom.app", + "path": "/Applications/Atom.app", + "version": "1.43.0", + }, + ], + "available_software_updates": Array [], + "available_updates": Object {}, + "cached_by_casper": Array [], + "fonts": Array [], + "installed_by_casper": Array [], + "installed_by_installer_swu": Array [ + "com.apple.pkg.Core", + ], + "licensed_software": Array [], + "plugins": Array [], + "running_services": Array [ + "com.apple.accessoryd", + ], + "unix_executables": Array [], + }, + }, + }, + ], + "_type": "user_endpoint", + "altMacAddress": "12:34:56:78:90:12", + "altNetworkAdapterType": "Ethernet", + "assetTag": "", + "barcode1": "", + "barcode2": "", + "building": "", + "category": "endpoint", + "createdOn": 1591217314697, + "department": "", + "deviceId": "DF7C48EF-D17E-4A5E-B192-8C758870F624", + "deviceType": "laptop", + "displayName": "John’s MacBook", + "distributionPoint": "", + "email": "john.doe@test.com", + "encrypted": true, + "enrolledOn": 1591217314697, + "extensionAttribute.Deployment status": Array [ + "active", + ], + "firewallEnabled": false, + "gatekeeperEnabled": true, + "gatekeeperStatus": "App Store and identified developers", + "hostname": null, + "id": "1", + "ipAddress": "12.34.567.890", + "itunesStoreAccountIsActive": true, + "jamfVersion": "10.23.0-t1595614145", + "lastCloudBackupDateEpoch": 0, + "lastCloudBackupDateUtc": "", + "lastReportedIp": "192.168.1.139", + "lastReportedOn": 1560787256384, + "lastSeenOn": 1596979440636, + "macAddress": "12:34:67:8a:9b:1c", + "make": "Apple", + "managed": true, + "mdmCapable": true, + "mdmProfileExpirationEpoch": 1748983791000, + "mdmProfileExpirationUtc": "2025-06-03T20:49:51.000+0000", + "model": "MacBookPro13,3", + "name": "John's MacBook", + "netbootServer": "", + "networkAdapterType": "IEEE80211", + "osBuild": "19D76", + "osName": "macOS", + "osVersion": "10.15.0", + "platform": "darwin", + "realName": "John Doe", + "serial": "ABC123DEF456", + "serialNumber": "ABC123DEF456", + "supervised": false, + "sus": "", + "systemIntegrityProtectionEnabled": true, + "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", + "username": "john", +} +`; diff --git a/src/steps/devices/__snapshots__/converters.test.ts.snap b/src/steps/devices/__snapshots__/converters.test.ts.snap index 5f7c249..674826b 100644 --- a/src/steps/devices/__snapshots__/converters.test.ts.snap +++ b/src/steps/devices/__snapshots__/converters.test.ts.snap @@ -1,398 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`#createComputerEntity should convert data 1`] = ` -Object { - "_class": Array [ - "Host", - "Device", - ], - "_key": "ABC123DEF456", - "_rawData": Array [ - Object { - "name": "default", - "rawData": Object { - "building": "", - "department": "", - "id": 1, - "mac_address": "12:34:67:8A:9B:1C", - "managed": true, - "model": "MacBookPro13,3", - "name": "John’s MacBook", - "report_date_epoch": 1560787256384, - "report_date_utc": "2019-06-17T16:00:56.384+0000", - "serial_number": "ABC123DEF456", - "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", - "username": "john", - }, - }, - Object { - "name": "detail", - "rawData": Object { - "certificates": Array [ - Object { - "common_name": "com.apple.kerberos.kdc", - "expires_epoch": "", - "expires_utc": "", - "identity": true, - "name": "", - }, - Object { - "common_name": "Apple Worldwide Developer Relations Certification Authority", - "expires_epoch": 1675806527000, - "expires_utc": "2023-02-07T21:48:47.000+0000", - "identity": false, - "name": "", - }, - ], - "configuration_profiles": Array [ - Object { - "id": -2, - "is_removable": false, - "name": "", - "uuid": "", - }, - Object { - "id": -1, - "is_removable": false, - "name": "", - "uuid": "", - }, - ], - "extension_attributes": Array [ - Object { - "id": 1, - "name": "123", - "value": Array [ - "foo123", - "bar123", - ], - }, - Object { - "id": 2, - "name": "456", - "value": Array [ - "foo456", - "bar456", - ], - }, - Object { - "id": 3, - "name": "Deployment status", - "value": Array [ - "active", - ], - }, - ], - "general": Object { - "alt_mac_address": "12:34:56:78:90:12", - "alt_network_adapter_type": "Ethernet", - "asset_tag": "", - "barcode_1": "", - "barcode_2": "", - "distribution_point": "", - "id": 1, - "initial_entry_date": "2020-06-03", - "initial_entry_date_epoch": 1591217314697, - "initial_entry_date_utc": "2020-06-03T20:48:34.697+0000", - "ip_address": "12.34.567.890", - "itunes_store_account_is_active": true, - "jamf_version": "10.23.0-t1595614145", - "last_cloud_backup_date_epoch": 0, - "last_cloud_backup_date_utc": "", - "last_contact_time": "2020-08-09 13:24:00", - "last_contact_time_epoch": 1596979440636, - "last_contact_time_utc": "2020-08-09T13:24:00.636+0000", - "last_enrolled_date_epoch": 1591217314697, - "last_enrolled_date_utc": "2020-06-03T20:48:34.697+0000", - "last_reported_ip": "192.168.1.139", - "mac_address": "12:34:67:8A:9B:1C", - "management_status": Object { - "enrolled_via_dep": false, - "user_approved_enrollment": false, - "user_approved_mdm": false, - }, - "mdm_capable": true, - "mdm_capable_users": Object { - "mdm_capable_user": "john.doe", - }, - "mdm_profile_expiration_epoch": 1748983791000, - "mdm_profile_expiration_utc": "2025-06-03T20:49:51.000+0000", - "name": "John's MacBook", - "netboot_server": "", - "network_adapter_type": "IEEE80211", - "platform": "Mac", - "remote_management": Object { - "managed": true, - "management_password_sha256": "abc123", - "management_username": "macOS", - }, - "report_date": "2020-08-03 12:24:29", - "report_date_epoch": 1596457469968, - "report_date_utc": "2020-08-03T12:24:29.968+0000", - "serial_number": "ABC123DEF456", - "site": Object { - "id": 1, - "name": "Test site", - }, - "supervised": false, - "sus": "", - "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", - }, - "groups_accounts": Object { - "computer_group_memberships": Array [ - "All Managed Clients", - ], - "local_accounts": Array [ - Object { - "administrator": true, - "filevault_enabled": true, - "home": "/Users/john", - "home_size": "-1MB", - "home_size_mb": -1, - "name": "john.doe", - "realname": "John", - "uid": "501", - }, - Object { - "administrator": true, - "filevault_enabled": true, - "home": "/Users/macOS", - "home_size": "-1MB", - "home_size_mb": -1, - "name": "macOS", - "realname": "macOS", - "uid": "502", - }, - ], - "user_inventories": Object { - "disable_automatic_login": true, - "user": Object { - "password_history_depth": "", - "password_max_age": "", - "password_min_complex_characters": "", - "password_min_length": "4", - "password_require_alphanumeric": "false", - "username": "macOS", - }, - }, - }, - "hardware": Object { - "active_directory_status": "Not Bound", - "available_ram_slots": 0, - "battery_capacity": 93, - "ble_capable": true, - "boot_rom": "204.0.0.0.0", - "bus_speed": 0, - "bus_speed_mhz": 0, - "cache_size": 8192, - "cache_size_kb": 8192, - "disk_encryption_configuration": "", - "filevault2_users": Array [ - "macOS", - "john.doe", - ], - "gatekeeper_status": "App Store and identified developers", - "institutional_recovery_key": "Not Present", - "make": "Apple", - "mapped_printers": Array [ - Object { - "location": "", - "name": "Brother ABC", - "type": "Brother ABC", - "uri": "dnssd://Brother%20ABC._pdl-datastream._tcp.local./?bidi", - }, - ], - "master_password_set": false, - "model": "15-inch Retina MacBook Pro with TouchID (Mid 2017)", - "model_identifier": "MacBookPro14,3", - "nic_speed": "n/a", - "number_cores": 4, - "number_processors": 1, - "optical_drive": "", - "os_build": "19D76", - "os_name": "Mac OS X", - "os_version": "10.15.3", - "processor_architecture": "x86_64", - "processor_speed": 3100, - "processor_speed_mhz": 3100, - "processor_type": "Quad-Core Intel Core i7", - "service_pack": "", - "sip_status": "Enabled", - "smc_version": "2.45f1", - "storage": Array [ - Object { - "connection_type": "NO", - "disk": "disk0", - "drive_capacity_mb": 1000555, - "model": "APPLE SSD SM1024L", - "partitions": Array [ - Object { - "available_mb": 207295, - "boot_drive_available_mb": 207295, - "filevault2_percent": 100, - "filevault2_status": "Encrypted", - "filevault_percent": 100, - "filevault_status": "Encrypted", - "lvUUID": "", - "lvgUUID": "", - "name": "Macintosh HD (Boot Partition)", - "partition_capacity_mb": 1000240, - "percentage_full": 5, - "pvUUID": "", - "size": 1000240, - "type": "boot", - }, - Object { - "available_mb": 207295, - "filevault2_percent": 100, - "filevault2_status": "Encrypted", - "filevault_percent": 100, - "filevault_status": "Encrypted", - "name": "Data", - "partition_capacity_mb": 1000240, - "percentage_full": 79, - "size": 1000240, - "type": "other", - }, - ], - "revision": "CXS5EA0Q", - "serial_number": "123ABC", - "size": 1000555, - "smart_status": "Verified", - }, - ], - "total_ram": 16384, - "total_ram_mb": 16384, - "xprotect_version": "2127", - }, - "iphones": Array [], - "location": Object { - "building": "", - "department": "", - "email_address": "JOHN.doe@test.com", - "phone": "111", - "phone_number": "111", - "position": "CISO", - "real_name": "John Doe", - "realname": "John Doe", - "room": "", - "username": "john.doe", - }, - "peripherals": Array [], - "purchasing": Object { - "applecare_id": "", - "attachments": Array [], - "is_leased": false, - "is_purchased": true, - "lease_expires": "", - "lease_expires_epoch": 0, - "lease_expires_utc": "", - "life_expectancy": 0, - "os_applecare_id": "", - "os_maintenance_expires": "", - "po_date": "", - "po_date_epoch": 0, - "po_date_utc": "", - "po_number": "", - "purchase_price": "", - "purchasing_account": "", - "purchasing_contact": "", - "vendor": "", - "warranty_expires": "", - "warranty_expires_epoch": 0, - "warranty_expires_utc": "", - }, - "security": Object { - "activation_lock": false, - "external_boot_level": "not supported", - "firewall_enabled": false, - "secure_boot_level": "not supported", - }, - "software": Object { - "applications": Array [ - Object { - "bundle_id": "com.github.atom", - "name": "Atom.app", - "path": "/Applications/Atom.app", - "version": "1.43.0", - }, - ], - "available_software_updates": Array [], - "available_updates": Object {}, - "cached_by_casper": Array [], - "fonts": Array [], - "installed_by_casper": Array [], - "installed_by_installer_swu": Array [ - "com.apple.pkg.Core", - ], - "licensed_software": Array [], - "plugins": Array [], - "running_services": Array [ - "com.apple.accessoryd", - ], - "unix_executables": Array [], - }, - }, - }, - ], - "_type": "user_endpoint", - "altMacAddress": "12:34:56:78:90:12", - "altNetworkAdapterType": "Ethernet", - "assetTag": "", - "barcode1": "", - "barcode2": "", - "building": "", - "category": "endpoint", - "createdOn": 1591217314697, - "department": "", - "deviceId": "DF7C48EF-D17E-4A5E-B192-8C758870F624", - "deviceType": "laptop", - "displayName": "John’s MacBook", - "distributionPoint": "", - "email": "john.doe@test.com", - "encrypted": true, - "enrolledOn": 1591217314697, - "extensionAttribute.Deployment status": Array [ - "active", - ], - "firewallEnabled": false, - "gatekeeperEnabled": true, - "gatekeeperStatus": "App Store and identified developers", - "hostname": null, - "id": "1", - "ipAddress": "12.34.567.890", - "itunesStoreAccountIsActive": true, - "jamfVersion": "10.23.0-t1595614145", - "lastCloudBackupDateEpoch": 0, - "lastCloudBackupDateUtc": "", - "lastReportedIp": "192.168.1.139", - "lastReportedOn": 1560787256384, - "lastSeenOn": 1596979440636, - "macAddress": "12:34:67:8a:9b:1c", - "make": "Apple", - "managed": true, - "mdmCapable": true, - "mdmProfileExpirationEpoch": 1748983791000, - "mdmProfileExpirationUtc": "2025-06-03T20:49:51.000+0000", - "model": "MacBookPro13,3", - "name": "John's MacBook", - "netbootServer": "", - "networkAdapterType": "IEEE80211", - "osBuild": "19D76", - "osName": "macOS", - "osVersion": "10.15.3", - "platform": "darwin", - "realName": "John Doe", - "serial": "ABC123DEF456", - "serialNumber": "ABC123DEF456", - "supervised": false, - "sus": "", - "systemIntegrityProtectionEnabled": true, - "udid": "DF7C48EF-D17E-4A5E-B192-8C758870F624", - "username": "john", -} -`; - exports[`#createMobileDeviceEntity should convert data 1`] = ` Object { "_class": Array [ @@ -516,7 +123,7 @@ Object { "name": "Tinas iPad", "os_build": "14F89", "os_type": "iOS", - "os_version": "10.3.2", + "os_version": "10.3", "percentage_used": 5, "phone_number": "123-555-6789", "serial_number": "C02Q7KHTGFWF", @@ -655,7 +262,7 @@ Object { "modelIdentifier": "iPhone6,1", "name": "Update 1-1", "osType": "iOS", - "osVersion": "10.3.2", + "osVersion": "10.3.0", "passcodeCompliant": true, "passcodeLockGracePeriodEnforced": "Not Available", "phoneNumber": "612-356-4364", diff --git a/src/steps/devices/__snapshots__/index.test.ts.snap b/src/steps/devices/__snapshots__/index.test.ts.snap index e07ae2f..4d95ac8 100644 --- a/src/steps/devices/__snapshots__/index.test.ts.snap +++ b/src/steps/devices/__snapshots__/index.test.ts.snap @@ -2452,6 +2452,7 @@ Object { "mdmProfileExpirationUtc": "2025-06-03T20:49:51.000+0000", "model": "MacBookPro14,3", "name": "Erkang’s LifeOmic MacBook (2)", + "netbootServer": "", "networkAdapterType": "IEEE80211", "osBuild": "19D76", "osName": "macOS", @@ -4674,6 +4675,7 @@ Object { "mdmProfileExpirationUtc": "2024-04-22T13:02:17.000+0000", "model": "MacBookPro13,3", "name": "Erkang’s LifeOmic MacBook", + "netbootServer": "", "networkAdapterType": "", "osBuild": "17G6030", "osName": "macOS", diff --git a/src/steps/devices/computerEntityConverter.test.ts b/src/steps/devices/computerEntityConverter.test.ts new file mode 100644 index 0000000..c310327 --- /dev/null +++ b/src/steps/devices/computerEntityConverter.test.ts @@ -0,0 +1,86 @@ +import { + createMockComputer, + createMockComputerDetail, +} from '../../../test/mocks'; +import { + createComputerEntity, + getConfigurationProfileData, + getUserNameData, +} from './computerEntityConverter'; + +describe('#createComputerEntity', () => { + test('should convert data', () => { + const data = createComputerEntity({ + device: createMockComputer(), + macOsConfigurationDetailByIdMap: new Map(), + detailData: createMockComputerDetail(), + previouslyDiscoveredDevice: false, + }); + expect(data).toMatchSnapshot(); + }); +}); + +describe('#getUserNameData()', () => { + describe('given an emptyuser name', () => { + it('should return the location user name', () => { + const result = getUserNameData('', createMockComputerDetail()); + expect(result).toEqual({ username: 'john.doe' }); + }); + }); +}); + +describe('#getConfigurationProfileData()', () => { + describe('given a set of configuration profiles', () => { + it('should return the firewall configuration', () => { + const map = new Map(); + map.set(-1, { + parsedPayload: { + PayloadDisplayName: 'names', + PayloadContent: [ + { + PayloadType: 'com.apple.security.firewall', + PayloadEnabled: true, + EnableFirewall: true, + BlockAllIncoming: true, + EnableStealthMode: true, + }, + { + PayloadType: 'com.apple.screensaver', + PayloadEnabled: true, + loginWindowIdleTime: 1, + }, + ], + }, + general: { + id: -1, + name: 'name', + description: 'description', + site: { id: 1, name: 'site' }, + category: { id: 1, name: 'category' }, + distribution_method: 'dist', + user_removable: true, + level: 'level', + redeploy_on_update: 're', + payloads: '', + }, + scope: { + all_computers: true, + all_jss_users: true, + }, + }); + + const result = getConfigurationProfileData( + createMockComputerDetail(), + map, + ); + + expect(result).toEqual({ + firewallBlockAllIncoming: true, + firewallEnabled: true, + firewallStealthModeEnabled: true, + screensaverIdleTime: 1, + screensaverLockEnabled: true, + }); + }); + }); +}); diff --git a/src/steps/devices/computerEntityConverter.ts b/src/steps/devices/computerEntityConverter.ts new file mode 100644 index 0000000..2efbce3 --- /dev/null +++ b/src/steps/devices/computerEntityConverter.ts @@ -0,0 +1,373 @@ +import { + convertProperties, + Entity, + parseTimePropertyValue, + RawDataTracking, + setRawData, +} from '@jupiterone/integration-sdk-core'; +import { + Computer, + ComputerDetail, + DiskPartition, + ExtensionAttribute, + OSXConfigurationDetailParsed, + OSXConfigurationPayloadItem, +} from '../../jamf/types'; +import { generateEntityKey } from '../../util/generateKey'; +import { Entities, DEPLOYMENT_STATUS } from '../constants'; +import { deviceNormalizer } from './normalizer'; + +function getDeploymentStatus(extensionAttributes: ExtensionAttribute[] = []) { + if (!Array.isArray(extensionAttributes)) return []; + + const deploymentStatusAttribute = extensionAttributes.find( + (attribute) => attribute.name === DEPLOYMENT_STATUS, + ); + if (!deploymentStatusAttribute) return []; + + return deploymentStatusAttribute.value; +} + +function itemArray(item: any): Array { + if (item) { + return Array.isArray(item) ? item : [item]; + } else { + return []; + } +} + +function primaryDiskBootPartition( + detailData: ComputerDetail, +): DiskPartition | undefined { + const storageList = itemArray(detailData.hardware.storage); + + for (const storage of storageList) { + const device = 'device' in storage ? storage.device : storage; + const partitionList = itemArray(device.partition || device.partitions); + + // If there is only one disk and one partition, returns it as the primary + // regardless of the type property value + if (storageList.length === 1 && partitionList.length === 1) { + return partitionList[0]; + } + // Otherwise check for type + else { + for (const p of partitionList) { + if (p.type === 'boot') { + return p; + } + } + } + } +} + +function encrypted(detailData: ComputerDetail): boolean { + const bootPartition = primaryDiskBootPartition(detailData); + return ( + !!bootPartition && + ((bootPartition.filevault_status === 'Encrypted' && + bootPartition.filevault_percent === 100) || + (bootPartition.filevault2_status === 'Encrypted' && + bootPartition.filevault2_percent === 100)) + ); +} + +function collapsePayloadValue( + configurationProfiles: OSXConfigurationDetailParsed[], + payloadType: string, + initialValue: any, + getNewValue: (payload: OSXConfigurationPayloadItem, currentValue: any) => any, +): any { + let value = initialValue; + + for (const profile of configurationProfiles) { + const payload = profile?.parsedPayload?.PayloadContent.find((item) => { + return item.PayloadType === payloadType; + }) as OSXConfigurationPayloadItem; + + value = getNewValue(payload, value) || value; + } + + return value; +} + +function gatekeeperEnabled(detailData: ComputerDetail): boolean { + // gatekeeperStatus can be one of three things: "App Store", "App Store and + // identified developers", or "Anywhere" + return ( + !!detailData.hardware.gatekeeper_status && + detailData.hardware.gatekeeper_status.startsWith('App Store') + ); +} + +function systemIntegrityProtectionEnabled(detailData: ComputerDetail): boolean { + return detailData.hardware.sip_status === 'Enabled'; +} + +function collapsePayloadBoolean( + configurationProfiles: OSXConfigurationDetailParsed[], + payloadType: string, + property: string, +): boolean { + return collapsePayloadValue( + configurationProfiles, + payloadType, + false, + (payload) => { + if (payload && payload.PayloadEnabled && payload[property]) { + return true; + } + }, + ); +} + +// This method assumes that lower = more restrictive. +function collapsePayloadNumber( + configurationProfiles: OSXConfigurationDetailParsed[], + payloadType: string, + property: string, +): number | undefined { + return collapsePayloadValue( + configurationProfiles, + payloadType, + undefined, + (payload, value) => { + if ( + payload && + payload.PayloadEnabled && + payload[property] && + typeof payload[property] === 'number' + ) { + if (!value) { + return payload[property]; + } else { + return payload[property] < value ? payload[property] : value; + } + } + }, + ); +} + +export const getConfigurationProfileData = ( + detailData, + macOsConfigurationDetailByIdMap, +) => { + const configurationProfiles = detailData.configuration_profiles + .map((profile) => macOsConfigurationDetailByIdMap.get(profile.id)) + .filter( + (profile) => typeof profile !== 'undefined', + ) as OSXConfigurationDetailParsed[]; + + const collapseFirewallBoolean = collapsePayloadBoolean.bind( + null, + configurationProfiles, + 'com.apple.security.firewall', + ); + + if (configurationProfiles.length > 0) { + return { + firewallEnabled: collapseFirewallBoolean('EnableFirewall'), + firewallStealthModeEnabled: collapseFirewallBoolean('EnableStealthMode'), + firewallBlockAllIncoming: collapseFirewallBoolean('BlockAllIncoming'), + screensaverLockEnabled: collapsePayloadBoolean( + configurationProfiles, + 'com.apple.screensaver', + 'PayloadEnabled', + ), + screensaverIdleTime: collapsePayloadNumber( + configurationProfiles, + 'com.apple.screensaver', + 'loginWindowIdleTime', + ), + }; + } + + return {}; +}; + +export const getUserNameData = ( + username: string, + detailData: ComputerDetail, +) => { + if (!username || username.length === 0) { + return { username: detailData.location.username }; + } + + return {}; +}; + +const getFirewallEnabledData = (detailData) => { + // TODO: Should we let the Security tab Firewall value override the above + // firewall data set by the profile (if one is attached)? In theory, they + // should always match + if ( + detailData.security && + detailData.security.firewall_enabled !== undefined + ) { + return { firewallEnabled: detailData.security.firewall_enabled }; + } + + return {}; +}; + +const getDetailedData = ( + detailData: ComputerDetail, + device: Computer, + macOsConfigurationDetailByIdMap: Map, +) => { + const convertedProperties = convertProperties(detailData.general); + // eslint-disable-next-line prefer-const + let data: any = { + id: detailData.general.id.toString(), + name: convertedProperties.name, + networkAdapterType: convertedProperties.networkAdapterType, + ipAddress: convertedProperties.ipAddress, + altNetworkAdapterType: convertedProperties.altNetworkAdapterType, + lastReportedIp: convertedProperties.lastReportedIp, + serialNumber: convertedProperties.serialNumber, + udid: convertedProperties.udid, + jamfVersion: convertedProperties.jamfVersion, + barcode1: convertedProperties.barcode1, + barcode2: convertedProperties.barcode2, + assetTag: convertedProperties.assetTag, + supervised: convertedProperties.supervised, + mdmCapable: convertedProperties.mdmCapable, + lastCloudBackupDateEpoch: convertedProperties.lastCloudBackupDateEpoch, + lastCloudBackupDateUtc: convertedProperties.lastCloudBackupDateUtc, + mdmProfileExpirationEpoch: convertedProperties.mdmProfileExpirationEpoch, + mdmProfileExpirationUtc: convertedProperties.mdmProfileExpirationUtc, + distributionPoint: convertedProperties.distributionPoint, + sus: convertedProperties.sus, + netbootServer: convertedProperties.netbootServer || '', + itunesStoreAccountIsActive: convertedProperties.itunesStoreAccountIsActive, + platform: + detailData.general.platform === 'Mac' + ? 'darwin' + : detailData.general.platform.toLowerCase(), + createdOn: detailData.general.initial_entry_date_epoch + ? detailData.general.initial_entry_date_epoch + : undefined, + enrolledOn: detailData.general.last_enrolled_date_epoch + ? detailData.general.last_enrolled_date_epoch + : undefined, + macAddress: + detailData.general.mac_address && + detailData.general.mac_address.toLowerCase(), + altMacAddress: + detailData.general.alt_mac_address && + detailData.general.alt_mac_address.toLowerCase(), + make: detailData.hardware.make, + osName: + detailData.general.platform === 'Mac' + ? 'macOS' + : detailData.hardware.os_name, + osVersion: deviceNormalizer.normalizeOsVersion( + detailData.hardware.os_version, + ), + osBuild: detailData.hardware.os_build, + systemIntegrityProtectionEnabled: + systemIntegrityProtectionEnabled(detailData), + email: detailData.location.email_address?.toLowerCase(), + encrypted: encrypted(detailData), + gatekeeperStatus: detailData.hardware.gatekeeper_status, + gatekeeperEnabled: gatekeeperEnabled(detailData), + }; + + const configurationProfileData = getConfigurationProfileData( + detailData, + macOsConfigurationDetailByIdMap, + ); + const firewallEnabledData = getFirewallEnabledData(detailData); + const usernameData = getUserNameData(device.username, detailData); + + return { + ...data, + ...configurationProfileData, + ...usernameData, + ...firewallEnabledData, + }; +}; + +export function createComputerEntity({ + device, + macOsConfigurationDetailByIdMap, + detailData, + previouslyDiscoveredDevice, +}: { + device: Computer; + macOsConfigurationDetailByIdMap: Map; + detailData?: ComputerDetail; + previouslyDiscoveredDevice: boolean; +}): Entity { + const defaultDeviceKey = generateEntityKey( + Entities.COMPUTER._type, + device.id, + ); + + const _key = previouslyDiscoveredDevice + ? defaultDeviceKey + : device.serial_number || defaultDeviceKey; + + const extensionAttributes = {}; + + // 06/17/21 CRB + // Making an update here to prevent all extensionAttributes from being uploaded + // due to the size of the entity that can be generated as a result from uploading + // every extensionAttribute property. + if (detailData && detailData.extension_attributes) { + extensionAttributes[`extensionAttribute.${DEPLOYMENT_STATUS}`] = + getDeploymentStatus(detailData.extension_attributes); + } + + const computer: Entity = { + _key, + _type: Entities.COMPUTER._type, + _class: Entities.COMPUTER._class, + _rawData: [{ name: 'default', rawData: device }], + id: device.udid.toString(), + displayName: + device.name || `${device.username || 'Unknown User'}'s ${device.model}`, + name: device.name, + realName: detailData?.location.real_name || detailData?.location.realname, + managed: device.managed, + username: device.username, + model: device.model, + serial: device.serial_number, + deviceType: /macbook/i.test(device.model) ? 'laptop' : 'desktop', + department: device.department, + building: device.building, + macAddress: device.mac_address.toLowerCase(), + udid: device.udid, + deviceId: device.udid, + lastReportedOn: device.report_date_epoch + ? device.report_date_epoch + : undefined, + lastSeenOn: parseTimePropertyValue( + detailData?.general?.last_contact_time_epoch ?? device.report_date_epoch, + 'ms', + ), + encrypted: false, + gatekeeperEnabled: false, + systemIntegrityProtectionEnabled: false, + category: 'endpoint', + hostname: null, + ...extensionAttributes, + }; + + if (detailData) { + setRawData(computer as RawDataTracking, { + name: 'detail', + rawData: detailData, + }); + + const data = getDetailedData( + detailData, + device, + macOsConfigurationDetailByIdMap, + ); + + return { ...computer, ...data }; + } + + return computer; +} diff --git a/src/steps/devices/converters.test.ts b/src/steps/devices/converters.test.ts index e155d25..4aec50b 100644 --- a/src/steps/devices/converters.test.ts +++ b/src/steps/devices/converters.test.ts @@ -1,12 +1,6 @@ -import { - createComputerEntity, - createMobileDeviceEntity, - getDeploymentStatus, -} from './converters'; +import { createMobileDeviceEntity, getDeploymentStatus } from './converters'; import { createMockMobileDevice, - createMockComputer, - createMockComputerDetail, EXTENSION_ATTRIBUTES, createMockMobileDeviceDetail, } from '../../../test/mocks'; @@ -23,19 +17,6 @@ describe('#createMobileDeviceEntity', () => { }); }); -describe('#createComputerEntity', () => { - test('should convert data', () => { - expect( - createComputerEntity({ - device: createMockComputer(), - macOsConfigurationDetailByIdMap: new Map(), - detailData: createMockComputerDetail(), - previouslyDiscoveredDevice: false, - }), - ).toMatchSnapshot(); - }); -}); - describe('#getDeploymentStatus', () => { test('should get the value of the deployment status hash', () => { expect(getDeploymentStatus(EXTENSION_ATTRIBUTES)).toEqual(['active']); diff --git a/src/steps/devices/converters.ts b/src/steps/devices/converters.ts index 4dabf86..9464ccf 100644 --- a/src/steps/devices/converters.ts +++ b/src/steps/devices/converters.ts @@ -1,21 +1,15 @@ import { - convertProperties, createIntegrationEntity, - Entity, parseTimePropertyValue, RawDataTracking, setRawData, } from '@jupiterone/integration-sdk-core'; import { - Computer, - ComputerDetail, - DiskPartition, ExtensionAttribute, MobileDevice, MobileDeviceDetail, OSXConfigurationDetailParsed, OSXConfigurationFirewallPayload, - OSXConfigurationPayloadItem, } from '../../jamf/types'; import { generateEntityKey } from '../../util/generateKey'; import { Entities, DEPLOYMENT_STATUS } from '../constants'; @@ -163,7 +157,7 @@ export function createMacOsConfigurationEntity( ) { return createIntegrationEntity({ entityData: { - source: { ...data }, // prevent osx configuration map contents from getting mutated during rawData shrinking + source: data, // prevent osx configuration map contents from getting mutated during rawData shrinking assign: { _key: generateEntityKey( Entities.MAC_OS_CONFIGURATION_PROFILE._type, @@ -205,180 +199,6 @@ export function getDeploymentStatus( return deploymentStatusAttribute.value; } -// TODO: Refactor this to be simpler! -export function createComputerEntity({ - device, - macOsConfigurationDetailByIdMap, - detailData, - previouslyDiscoveredDevice, -}: { - device: Computer; - macOsConfigurationDetailByIdMap: Map; - detailData?: ComputerDetail; - previouslyDiscoveredDevice: boolean; -}): Entity { - const defaultDeviceKey = generateEntityKey( - Entities.COMPUTER._type, - device.id, - ); - - const _key = previouslyDiscoveredDevice - ? defaultDeviceKey - : device.serial_number || defaultDeviceKey; - - const extensionAttributes = {}; - - // 06/17/21 CRB - // Making an update here to prevent all extensionAttributes from being uploaded - // due to the size of the entity that can be generated as a result from uploading - // every extensionAttribute property. - if (detailData && detailData.extension_attributes) { - extensionAttributes[`extensionAttribute.${DEPLOYMENT_STATUS}`] = - getDeploymentStatus(detailData.extension_attributes); - } - - const computer: Entity = { - _key, - _type: Entities.COMPUTER._type, - _class: Entities.COMPUTER._class, - _rawData: [{ name: 'default', rawData: device }], - id: device.udid.toString(), - displayName: - device.name || `${device.username || 'Unknown User'}'s ${device.model}`, - name: device.name, - realName: detailData?.location.real_name || detailData?.location.realname, - managed: device.managed, - username: device.username, - model: device.model, - serial: device.serial_number, - deviceType: /macbook/i.test(device.model) ? 'laptop' : 'desktop', - department: device.department, - building: device.building, - macAddress: device.mac_address.toLowerCase(), - udid: device.udid, - deviceId: device.udid, - lastReportedOn: device.report_date_epoch - ? device.report_date_epoch - : undefined, - lastSeenOn: parseTimePropertyValue( - detailData?.general?.last_contact_time_epoch ?? device.report_date_epoch, - 'ms', - ), - encrypted: false, - gatekeeperEnabled: false, - systemIntegrityProtectionEnabled: false, - category: 'endpoint', - hostname: null, - ...extensionAttributes, - }; - - if (detailData) { - setRawData(computer as RawDataTracking, { - name: 'detail', - rawData: detailData, - }); - - Object.assign(computer, { - ...convertProperties(detailData.general), - id: detailData.general.id.toString(), - }); - - computer.createdOn = detailData.general.initial_entry_date_epoch - ? detailData.general.initial_entry_date_epoch - : undefined; - computer.enrolledOn = detailData.general.last_enrolled_date_epoch - ? detailData.general.last_enrolled_date_epoch - : undefined; - - computer.macAddress = - detailData.general.mac_address && - detailData.general.mac_address.toLowerCase(); - computer.altMacAddress = - detailData.general.alt_mac_address && - detailData.general.alt_mac_address.toLowerCase(); - - delete (computer as any).initialEntryDate; - delete (computer as any).initialEntryDateEpoch; - delete (computer as any).initialEntryDateUtc; - delete (computer as any).lastContactTime; - delete (computer as any).lastContactTimeEpoch; - delete (computer as any).lastContactTimeUtc; - delete (computer as any).lastEnrolledDate; - delete (computer as any).lastEnrolledDateEpoch; - delete (computer as any).lastEnrolledDateUtc; - delete (computer as any).reportDate; - delete (computer as any).reportDateEpoch; - delete (computer as any).reportDateUtc; - - computer.platform = - detailData.general.platform === 'Mac' - ? 'darwin' - : detailData.general.platform.toLowerCase(); - computer.make = detailData.hardware.make; - computer.osName = - detailData.general.platform === 'Mac' - ? 'macOS' - : detailData.hardware.os_name; - computer.osVersion = deviceNormalizer.normalizeOsVersion( - detailData.hardware.os_version, - ); - computer.osBuild = detailData.hardware.os_build; - - if (!device.username || device.username.length === 0) { - computer.username = detailData.location.username; - } - - computer.email = detailData.location.email_address?.toLowerCase(); - computer.encrypted = encrypted(detailData); - computer.gatekeeperStatus = detailData.hardware.gatekeeper_status; - computer.gatekeeperEnabled = gatekeeperEnabled(detailData); - computer.systemIntegrityProtectionEnabled = - systemIntegrityProtectionEnabled(detailData); - - const configurationProfiles = detailData.configuration_profiles - .map((profile) => macOsConfigurationDetailByIdMap.get(profile.id)) - .filter((profile) => { - return typeof profile !== 'undefined'; - }) as OSXConfigurationDetailParsed[]; - - if (configurationProfiles.length > 0) { - const collapseFirewallBoolean = collapsePayloadBoolean.bind( - null, - configurationProfiles, - 'com.apple.security.firewall', - ); - - computer.firewallEnabled = collapseFirewallBoolean('EnableFirewall'); - computer.firewallStealthModeEnabled = - collapseFirewallBoolean('EnableStealthMode'); - computer.firewallBlockAllIncoming = - collapseFirewallBoolean('BlockAllIncoming'); - computer.screensaverLockEnabled = collapsePayloadBoolean( - configurationProfiles, - 'com.apple.screensaver', - 'PayloadEnabled', - ); - computer.screensaverIdleTime = collapsePayloadNumber( - configurationProfiles, - 'com.apple.screensaver', - 'loginWindowIdleTime', - ); - } - - // TODO: Should we let the Security tab Firewall value override the above - // firewall data set by the profile (if one is attached)? In theory, they - // should always match - if ( - detailData.security && - detailData.security.firewall_enabled !== undefined - ) { - computer.firewallEnabled = detailData.security.firewall_enabled; - } - } - - return computer; -} - export function createComputerGroupEntity(groupName: string) { return createIntegrationEntity({ entityData: { @@ -392,123 +212,3 @@ export function createComputerGroupEntity(groupName: string) { }, }); } - -function encrypted(detailData: ComputerDetail): boolean { - const bootPartition = primaryDiskBootPartition(detailData); - return ( - !!bootPartition && - ((bootPartition.filevault_status === 'Encrypted' && - bootPartition.filevault_percent === 100) || - (bootPartition.filevault2_status === 'Encrypted' && - bootPartition.filevault2_percent === 100)) - ); -} - -function itemArray(item: any): Array { - if (item) { - return Array.isArray(item) ? item : [item]; - } else { - return []; - } -} - -function primaryDiskBootPartition( - detailData: ComputerDetail, -): DiskPartition | undefined { - const storageList = itemArray(detailData.hardware.storage); - - for (const storage of storageList) { - const device = 'device' in storage ? storage.device : storage; - const partitionList = itemArray(device.partition || device.partitions); - - // If there is only one disk and one partition, returns it as the primary - // regardless of the type property value - if (storageList.length === 1 && partitionList.length === 1) { - return partitionList[0]; - } - // Otherwise check for type - else { - for (const p of partitionList) { - if (p.type === 'boot') { - return p; - } - } - } - } -} - -function gatekeeperEnabled(detailData: ComputerDetail): boolean { - // gatekeeperStatus can be one of three things: "App Store", "App Store and - // identified developers", or "Anywhere" - return ( - !!detailData.hardware.gatekeeper_status && - detailData.hardware.gatekeeper_status.startsWith('App Store') - ); -} - -function systemIntegrityProtectionEnabled(detailData: ComputerDetail): boolean { - return detailData.hardware.sip_status === 'Enabled'; -} - -function collapsePayloadBoolean( - configurationProfiles: OSXConfigurationDetailParsed[], - payloadType: string, - property: string, -): boolean { - return collapsePayloadValue( - configurationProfiles, - payloadType, - false, - (payload) => { - if (payload && payload.PayloadEnabled && payload[property]) { - return true; - } - }, - ); -} - -// This method assumes that lower = more restrictive. -function collapsePayloadNumber( - configurationProfiles: OSXConfigurationDetailParsed[], - payloadType: string, - property: string, -): number | undefined { - return collapsePayloadValue( - configurationProfiles, - payloadType, - undefined, - (payload, value) => { - if ( - payload && - payload.PayloadEnabled && - payload[property] && - typeof payload[property] === 'number' - ) { - if (!value) { - return payload[property]; - } else { - return payload[property] < value ? payload[property] : value; - } - } - }, - ); -} - -function collapsePayloadValue( - configurationProfiles: OSXConfigurationDetailParsed[], - payloadType: string, - initialValue: any, - getNewValue: (payload: OSXConfigurationPayloadItem, currentValue: any) => any, -): any { - let value = initialValue; - - for (const profile of configurationProfiles) { - const payload = profile?.parsedPayload?.PayloadContent.find((item) => { - return item.PayloadType === payloadType; - }) as OSXConfigurationPayloadItem; - - value = getNewValue(payload, value) || value; - } - - return value; -} diff --git a/src/steps/devices/index.ts b/src/steps/devices/index.ts index 3311509..2fbfe62 100644 --- a/src/steps/devices/index.ts +++ b/src/steps/devices/index.ts @@ -20,7 +20,6 @@ import { } from '../constants'; import { createMobileDeviceEntity, - createComputerEntity, createMacOsConfigurationEntity, createComputerGroupEntity, } from './converters'; @@ -41,6 +40,7 @@ import { setComputerDeviceIdToGraphObjectKeyMap, setMobileDeviceIdToGraphObjectKeyMap, } from '../../util/device'; +import { createComputerEntity } from './computerEntityConverter'; type MacOsConfigurationDetailsById = Map; @@ -341,13 +341,15 @@ export async function fetchMobileDevices({ new Map(); await iterateMobileDevices(client, logger, async (device, deviceDetail) => { - const previouslyDiscoveredDevice = jobState.hasKey(device.serial_number); + const previouslyDiscoveredDevice = jobState.hasKey( + device.serial_number, + ) as boolean; const mobileDeviceEntity = await jobState.addEntity( createMobileDeviceEntity( device, deviceDetail, - previouslyDiscoveredDevice as boolean, + previouslyDiscoveredDevice, ), ); diff --git a/test/mocks.ts b/test/mocks.ts index 577991e..1279ed3 100644 --- a/test/mocks.ts +++ b/test/mocks.ts @@ -101,7 +101,7 @@ export function createMockMobileDeviceDetail(): MobileDeviceDetail { available_mb: 11487, percentage_used: 5, os_type: 'iOS', - os_version: '10.3.2', + os_version: '10.3', os_build: '14F89', serial_number: 'C02Q7KHTGFWF', udid: '270aae10800b6e61a2ee2bbc285eb967050b5984', @@ -399,7 +399,7 @@ export function createMockComputerDetail(): ComputerDetail { model: '15-inch Retina MacBook Pro with TouchID (Mid 2017)', model_identifier: 'MacBookPro14,3', os_name: 'Mac OS X', - os_version: '10.15.3', + os_version: '10.15', os_build: '19D76', master_password_set: false, active_directory_status: 'Not Bound',