2021-04-12 13:32:25 +00:00
|
|
|
import PropTypes from "prop-types";
|
2021-11-30 18:24:30 +00:00
|
|
|
import hostPolicyInterface, { IHostPolicy } from "./policy";
|
2021-06-22 19:26:57 +00:00
|
|
|
import hostUserInterface, { IHostUser } from "./host_users";
|
2021-08-16 14:30:19 +00:00
|
|
|
import labelInterface, { ILabel } from "./label";
|
|
|
|
import packInterface, { IPack } from "./pack";
|
|
|
|
import softwareInterface, { ISoftware } from "./software";
|
2021-12-09 16:38:51 +00:00
|
|
|
import hostQueryResult from "./campaign";
|
2021-08-16 14:30:19 +00:00
|
|
|
import queryStatsInterface, { IQueryStats } from "./query_stats";
|
2023-02-01 17:47:52 +00:00
|
|
|
import { ILicense, IDeviceGlobalConfig } from "./config";
|
2023-04-27 15:10:41 +00:00
|
|
|
import {
|
|
|
|
IHostMacMdmProfile,
|
|
|
|
MdmEnrollmentStatus,
|
|
|
|
BootstrapPackageStatus,
|
|
|
|
} from "./mdm";
|
2016-10-21 23:13:41 +00:00
|
|
|
|
|
|
|
export default PropTypes.shape({
|
2021-08-16 14:30:19 +00:00
|
|
|
created_at: PropTypes.string,
|
|
|
|
updated_at: PropTypes.string,
|
|
|
|
id: PropTypes.number,
|
2016-10-21 23:13:41 +00:00
|
|
|
detail_updated_at: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
label_updated_at: PropTypes.string,
|
2022-11-01 18:59:40 +00:00
|
|
|
policy_updated_at: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
last_enrolled_at: PropTypes.string,
|
|
|
|
seen_time: PropTypes.string,
|
|
|
|
refetch_requested: PropTypes.bool,
|
2016-10-21 23:13:41 +00:00
|
|
|
hostname: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
uuid: PropTypes.string,
|
2016-10-21 23:13:41 +00:00
|
|
|
platform: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
osquery_version: PropTypes.string,
|
|
|
|
os_version: PropTypes.string,
|
|
|
|
build: PropTypes.string,
|
|
|
|
platform_like: PropTypes.string,
|
|
|
|
code_name: PropTypes.string,
|
2016-10-21 23:13:41 +00:00
|
|
|
uptime: PropTypes.number,
|
2021-08-16 14:30:19 +00:00
|
|
|
memory: PropTypes.number,
|
|
|
|
cpu_type: PropTypes.string,
|
2022-11-01 18:59:40 +00:00
|
|
|
cpu_subtype: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
cpu_brand: PropTypes.string,
|
|
|
|
cpu_physical_cores: PropTypes.number,
|
|
|
|
cpu_logical_cores: PropTypes.number,
|
|
|
|
hardware_vendor: PropTypes.string,
|
|
|
|
hardware_model: PropTypes.string,
|
|
|
|
hardware_version: PropTypes.string,
|
|
|
|
hardware_serial: PropTypes.string,
|
|
|
|
computer_name: PropTypes.string,
|
|
|
|
primary_ip: PropTypes.string,
|
|
|
|
primary_mac: PropTypes.string,
|
|
|
|
distributed_interval: PropTypes.number,
|
|
|
|
config_tls_refresh: PropTypes.number,
|
|
|
|
logger_tls_period: PropTypes.number,
|
|
|
|
team_id: PropTypes.number,
|
|
|
|
pack_stats: PropTypes.arrayOf(
|
|
|
|
PropTypes.shape({
|
|
|
|
pack_id: PropTypes.number,
|
|
|
|
pack_name: PropTypes.string,
|
|
|
|
query_stats: PropTypes.arrayOf(queryStatsInterface),
|
|
|
|
})
|
|
|
|
),
|
|
|
|
team_name: PropTypes.string,
|
|
|
|
additional: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
2021-08-25 20:05:54 +00:00
|
|
|
percent_disk_space_available: PropTypes.number,
|
|
|
|
gigs_disk_space_available: PropTypes.number,
|
2021-08-16 14:30:19 +00:00
|
|
|
labels: PropTypes.arrayOf(labelInterface),
|
|
|
|
packs: PropTypes.arrayOf(packInterface),
|
|
|
|
software: PropTypes.arrayOf(softwareInterface),
|
|
|
|
status: PropTypes.string,
|
2022-10-14 19:26:15 +00:00
|
|
|
display_name: PropTypes.string,
|
2021-06-22 19:26:57 +00:00
|
|
|
users: PropTypes.arrayOf(hostUserInterface),
|
2021-10-18 18:29:48 +00:00
|
|
|
policies: PropTypes.arrayOf(hostPolicyInterface),
|
2021-12-09 16:38:51 +00:00
|
|
|
query_results: PropTypes.arrayOf(hostQueryResult),
|
2022-11-01 18:59:40 +00:00
|
|
|
batteries: PropTypes.arrayOf(
|
|
|
|
PropTypes.shape({
|
|
|
|
cycle_count: PropTypes.number,
|
|
|
|
health: PropTypes.string,
|
|
|
|
})
|
|
|
|
),
|
2016-10-21 23:13:41 +00:00
|
|
|
});
|
2021-03-03 16:51:39 +00:00
|
|
|
|
2022-10-14 20:21:30 +00:00
|
|
|
export type HostStatus = "online" | "offline" | "new" | "missing";
|
2021-09-28 21:05:25 +00:00
|
|
|
export interface IDeviceUser {
|
|
|
|
email: string;
|
2021-12-27 23:57:15 +00:00
|
|
|
source: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IDeviceMappingResponse {
|
|
|
|
device_mapping: IDeviceUser[];
|
2021-09-28 21:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMunkiData {
|
|
|
|
version: string;
|
|
|
|
}
|
|
|
|
|
2023-03-13 21:15:55 +00:00
|
|
|
type MacDiskEncryptionState =
|
|
|
|
| "applied"
|
|
|
|
| "action_required"
|
|
|
|
| "enforcing"
|
|
|
|
| "failed"
|
|
|
|
| "removing_enforcement"
|
|
|
|
| null;
|
|
|
|
|
|
|
|
type MacDiskEncryptionActionRequired = "log_out" | "rotate_key" | null;
|
|
|
|
|
|
|
|
interface IMdmMacOsSettings {
|
2023-04-27 15:10:41 +00:00
|
|
|
disk_encryption: MacDiskEncryptionState | null;
|
|
|
|
action_required: MacDiskEncryptionActionRequired | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IMdmMacOsSetup {
|
|
|
|
bootstrap_package_status: BootstrapPackageStatus | "";
|
|
|
|
details: string;
|
|
|
|
bootstrap_package_name: string;
|
2023-03-13 21:15:55 +00:00
|
|
|
}
|
|
|
|
|
2022-12-16 21:12:11 +00:00
|
|
|
export interface IHostMdmData {
|
2023-02-14 17:00:36 +00:00
|
|
|
encryption_key_available: boolean;
|
2023-02-01 17:47:52 +00:00
|
|
|
enrollment_status: MdmEnrollmentStatus | null;
|
2023-03-13 21:15:55 +00:00
|
|
|
name?: string;
|
2023-04-27 15:10:41 +00:00
|
|
|
server_url: string | null;
|
UI: 9274 unenroll mdm modal (#9539)
# Addresses #9274
https://www.loom.com/share/2edd946cbd424af2b960801cc505ac85
## Button and permissions:
- no permission, enrolled, online: <img width="1131" alt="no permission,
enrolled, online"
src="https://user-images.githubusercontent.com/61553566/215197330-abc1606d-bf0a-44ec-b2de-2ef687bd529b.png">
- permission, enrolled, online: <img width="1131" alt="permission,
enrolled, online"
src="https://user-images.githubusercontent.com/61553566/215197443-a1353b9b-10dd-408b-8295-56029f2df4c3.png">
- permission, enrolled, offline: <img width="1131" alt="permission,
enrolled, offline"
src="https://user-images.githubusercontent.com/61553566/215197544-b2a997a7-09e5-4f8a-b723-af587b61a90d.png">
- not enrolled: <img width="1131" alt="not enrolled"
src="https://user-images.githubusercontent.com/61553566/215197630-87f99cb3-63a9-45ce-bc85-57a45d54cae0.png">
## Modal
- <img width="672" alt="modal"
src="https://user-images.githubusercontent.com/61553566/215214640-96670a23-d927-4213-a8fa-89411279c075.png">
- <img width="672" alt="Screenshot 2023-01-27 at 2 12 42 PM"
src="https://user-images.githubusercontent.com/61553566/215215098-40d29556-3b73-4f52-a4ae-cc8b09122f5d.png">
- <img width="672" alt="Screenshot 2023-01-27 at 2 17 48 PM"
src="https://user-images.githubusercontent.com/61553566/215216304-b9362b13-f37f-4454-81b5-423f6fc72280.png">
- <img width="787" alt="success-shot"
src="https://user-images.githubusercontent.com/61553566/215236373-be7b1970-662d-47e6-ac59-f51eff344fcd.png">
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
- [x] Changes file added for user-visible changes in `changes/`
- [x] Updated test inventory
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-01-30 23:59:02 +00:00
|
|
|
id?: number;
|
2023-04-27 15:10:41 +00:00
|
|
|
profiles: IHostMacMdmProfile[] | null;
|
2023-04-28 14:04:55 +00:00
|
|
|
macos_settings?: IMdmMacOsSettings;
|
|
|
|
macos_setup?: IMdmMacOsSetup;
|
2021-12-27 23:57:15 +00:00
|
|
|
}
|
|
|
|
|
2022-09-02 22:05:07 +00:00
|
|
|
export interface IMunkiIssue {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
type: "error" | "warning";
|
|
|
|
created_at: string;
|
|
|
|
}
|
|
|
|
|
2023-04-27 15:10:41 +00:00
|
|
|
interface IMacadminMDMData {
|
|
|
|
enrollment_status: MdmEnrollmentStatus | null;
|
|
|
|
name?: string;
|
|
|
|
server_url: string | null;
|
|
|
|
id?: number;
|
|
|
|
}
|
|
|
|
|
2021-12-27 23:57:15 +00:00
|
|
|
export interface IMacadminsResponse {
|
|
|
|
macadmins: null | {
|
|
|
|
munki: null | IMunkiData;
|
2023-04-27 15:10:41 +00:00
|
|
|
mobile_device_management: null | IMacadminMDMData;
|
2022-09-02 22:05:07 +00:00
|
|
|
munki_issues: IMunkiIssue[];
|
2021-12-27 23:57:15 +00:00
|
|
|
};
|
2021-09-28 21:05:25 +00:00
|
|
|
}
|
|
|
|
|
2021-11-12 19:43:29 +00:00
|
|
|
export interface IPackStats {
|
|
|
|
pack_id: number;
|
|
|
|
pack_name: string;
|
|
|
|
query_stats: IQueryStats[];
|
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
2021-12-09 16:38:51 +00:00
|
|
|
export interface IHostPolicyQuery {
|
|
|
|
id: number;
|
2022-10-19 22:24:42 +00:00
|
|
|
display_name: string;
|
2022-04-13 16:08:37 +00:00
|
|
|
query_results?: unknown[];
|
2021-12-09 16:38:51 +00:00
|
|
|
status?: string;
|
|
|
|
}
|
|
|
|
|
2022-03-21 16:29:52 +00:00
|
|
|
interface IGeoLocation {
|
|
|
|
country_iso: string;
|
|
|
|
city_name: string;
|
|
|
|
geometry?: {
|
|
|
|
type: string;
|
|
|
|
coordinates: number[];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-11-01 18:59:40 +00:00
|
|
|
interface IBattery {
|
|
|
|
cycle_count: number;
|
|
|
|
health: string;
|
|
|
|
}
|
|
|
|
|
2022-11-18 16:25:39 +00:00
|
|
|
export interface IHostResponse {
|
|
|
|
host: IHost;
|
|
|
|
}
|
2023-02-01 17:47:52 +00:00
|
|
|
|
2022-11-18 16:25:39 +00:00
|
|
|
export interface IDeviceUserResponse {
|
|
|
|
host: IHost;
|
|
|
|
license: ILicense;
|
|
|
|
org_logo_url: string;
|
|
|
|
disk_encryption_enabled?: boolean;
|
|
|
|
platform?: string;
|
2023-02-01 17:47:52 +00:00
|
|
|
global_config: IDeviceGlobalConfig;
|
2022-11-18 16:25:39 +00:00
|
|
|
}
|
|
|
|
|
2023-02-14 17:00:36 +00:00
|
|
|
export interface IHostEncrpytionKeyResponse {
|
|
|
|
host_id: number;
|
|
|
|
encryption_key: {
|
|
|
|
updated_at: string;
|
|
|
|
key: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-03-03 16:51:39 +00:00
|
|
|
export interface IHost {
|
2021-08-16 14:30:19 +00:00
|
|
|
created_at: string;
|
|
|
|
updated_at: string;
|
|
|
|
id: number;
|
2021-03-03 16:51:39 +00:00
|
|
|
detail_updated_at: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
label_updated_at: string;
|
2022-11-01 18:59:40 +00:00
|
|
|
policy_updated_at: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
last_enrolled_at: string;
|
|
|
|
seen_time: string;
|
|
|
|
refetch_requested: boolean;
|
2023-05-23 15:43:50 +00:00
|
|
|
refetch_critical_queries_until: string;
|
2021-03-03 16:51:39 +00:00
|
|
|
hostname: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
uuid: string;
|
2021-03-03 16:51:39 +00:00
|
|
|
platform: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
osquery_version: string;
|
|
|
|
os_version: string;
|
|
|
|
build: string;
|
|
|
|
platform_like: string;
|
|
|
|
code_name: string;
|
2021-03-03 16:51:39 +00:00
|
|
|
uptime: number;
|
2021-08-16 14:30:19 +00:00
|
|
|
memory: number;
|
|
|
|
cpu_type: string;
|
2022-11-01 18:59:40 +00:00
|
|
|
cpu_subtype: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
cpu_brand: string;
|
|
|
|
cpu_physical_cores: number;
|
|
|
|
cpu_logical_cores: number;
|
|
|
|
hardware_vendor: string;
|
|
|
|
hardware_model: string;
|
|
|
|
hardware_version: string;
|
|
|
|
hardware_serial: string;
|
|
|
|
computer_name: string;
|
2022-03-21 16:29:52 +00:00
|
|
|
public_ip: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
primary_ip: string;
|
|
|
|
primary_mac: string;
|
|
|
|
distributed_interval: number;
|
|
|
|
config_tls_refresh: number;
|
|
|
|
logger_tls_period: number;
|
2022-11-01 18:59:40 +00:00
|
|
|
team_id: number | null;
|
|
|
|
pack_stats: IPackStats[] | null;
|
|
|
|
team_name: string | null;
|
|
|
|
additional?: object; // eslint-disable-line @typescript-eslint/ban-types
|
2021-08-25 20:05:54 +00:00
|
|
|
percent_disk_space_available: number;
|
|
|
|
gigs_disk_space_available: number;
|
2021-08-16 14:30:19 +00:00
|
|
|
labels: ILabel[];
|
|
|
|
packs: IPack[];
|
|
|
|
software: ISoftware[];
|
2021-10-19 18:15:48 +00:00
|
|
|
issues: {
|
|
|
|
total_issues_count: number;
|
|
|
|
failing_policies_count: number;
|
|
|
|
};
|
2022-10-10 18:07:47 +00:00
|
|
|
status: HostStatus;
|
2021-08-16 14:30:19 +00:00
|
|
|
display_text: string;
|
2022-10-14 19:26:15 +00:00
|
|
|
display_name: string;
|
2022-01-06 03:41:52 +00:00
|
|
|
target_type?: string;
|
2021-06-22 19:26:57 +00:00
|
|
|
users: IHostUser[];
|
2021-09-28 21:05:25 +00:00
|
|
|
device_users?: IDeviceUser[];
|
|
|
|
munki?: IMunkiData;
|
UI: 9274 unenroll mdm modal (#9539)
# Addresses #9274
https://www.loom.com/share/2edd946cbd424af2b960801cc505ac85
## Button and permissions:
- no permission, enrolled, online: <img width="1131" alt="no permission,
enrolled, online"
src="https://user-images.githubusercontent.com/61553566/215197330-abc1606d-bf0a-44ec-b2de-2ef687bd529b.png">
- permission, enrolled, online: <img width="1131" alt="permission,
enrolled, online"
src="https://user-images.githubusercontent.com/61553566/215197443-a1353b9b-10dd-408b-8295-56029f2df4c3.png">
- permission, enrolled, offline: <img width="1131" alt="permission,
enrolled, offline"
src="https://user-images.githubusercontent.com/61553566/215197544-b2a997a7-09e5-4f8a-b723-af587b61a90d.png">
- not enrolled: <img width="1131" alt="not enrolled"
src="https://user-images.githubusercontent.com/61553566/215197630-87f99cb3-63a9-45ce-bc85-57a45d54cae0.png">
## Modal
- <img width="672" alt="modal"
src="https://user-images.githubusercontent.com/61553566/215214640-96670a23-d927-4213-a8fa-89411279c075.png">
- <img width="672" alt="Screenshot 2023-01-27 at 2 12 42 PM"
src="https://user-images.githubusercontent.com/61553566/215215098-40d29556-3b73-4f52-a4ae-cc8b09122f5d.png">
- <img width="672" alt="Screenshot 2023-01-27 at 2 17 48 PM"
src="https://user-images.githubusercontent.com/61553566/215216304-b9362b13-f37f-4454-81b5-423f6fc72280.png">
- <img width="787" alt="success-shot"
src="https://user-images.githubusercontent.com/61553566/215236373-be7b1970-662d-47e6-ac59-f51eff344fcd.png">
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
- [x] Changes file added for user-visible changes in `changes/`
- [x] Updated test inventory
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-01-30 23:59:02 +00:00
|
|
|
mdm: IHostMdmData;
|
2021-10-18 18:29:48 +00:00
|
|
|
policies: IHostPolicy[];
|
2022-04-13 16:08:37 +00:00
|
|
|
query_results?: unknown[];
|
2022-03-21 16:29:52 +00:00
|
|
|
geolocation?: IGeoLocation;
|
2022-11-01 18:59:40 +00:00
|
|
|
batteries?: IBattery[];
|
2022-11-07 21:51:03 +00:00
|
|
|
disk_encryption_enabled?: boolean;
|
2021-03-03 16:51:39 +00:00
|
|
|
}
|