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";
|
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,
|
|
|
|
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,
|
|
|
|
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),
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMDMData {
|
2021-12-27 23:57:15 +00:00
|
|
|
enrollment_status: string;
|
|
|
|
server_url: string;
|
|
|
|
}
|
|
|
|
|
2022-09-02 22:05:07 +00:00
|
|
|
export interface IMunkiIssue {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
type: "error" | "warning";
|
|
|
|
created_at: string;
|
|
|
|
}
|
|
|
|
|
2021-12-27 23:57:15 +00:00
|
|
|
export interface IMacadminsResponse {
|
|
|
|
macadmins: null | {
|
|
|
|
munki: null | IMunkiData;
|
2021-12-29 23:19:26 +00:00
|
|
|
mobile_device_management: null | IMDMData;
|
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[];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
last_enrolled_at: string;
|
|
|
|
seen_time: string;
|
|
|
|
refetch_requested: boolean;
|
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;
|
|
|
|
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;
|
|
|
|
team_id: number;
|
2021-11-12 19:43:29 +00:00
|
|
|
pack_stats: IPackStats[];
|
2021-08-16 14:30:19 +00:00
|
|
|
team_name: string;
|
|
|
|
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;
|
|
|
|
mdm?: IMDMData;
|
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;
|
2021-03-03 16:51:39 +00:00
|
|
|
}
|