2021-11-30 18:24:30 +00:00
|
|
|
import PropTypes from "prop-types";
|
2023-07-17 21:09:12 +00:00
|
|
|
import { SelectedPlatformString } from "interfaces/platform";
|
2021-11-30 18:24:30 +00:00
|
|
|
|
|
|
|
// Legacy PropTypes used on host interface
|
|
|
|
export default PropTypes.shape({
|
|
|
|
author_email: PropTypes.string.isRequired,
|
|
|
|
author_id: PropTypes.number.isRequired,
|
|
|
|
author_name: PropTypes.string.isRequired,
|
|
|
|
created_at: PropTypes.string.isRequired,
|
|
|
|
description: PropTypes.string.isRequired,
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
query: PropTypes.string.isRequired,
|
|
|
|
resoluton: PropTypes.string.isRequired,
|
2022-12-14 18:57:57 +00:00
|
|
|
critical: PropTypes.bool,
|
2021-11-30 18:24:30 +00:00
|
|
|
response: PropTypes.string,
|
|
|
|
team_id: PropTypes.number,
|
|
|
|
updated_at: PropTypes.string.isRequired,
|
|
|
|
});
|
|
|
|
|
2022-11-18 16:25:39 +00:00
|
|
|
export interface IStoredPolicyResponse {
|
|
|
|
policy: IPolicy;
|
|
|
|
}
|
|
|
|
|
2023-08-31 15:23:57 +00:00
|
|
|
export interface IPoliciesCountResponse {
|
|
|
|
count: number;
|
|
|
|
}
|
|
|
|
|
2021-08-30 23:02:53 +00:00
|
|
|
export interface IPolicy {
|
|
|
|
id: number;
|
2021-11-24 17:16:42 +00:00
|
|
|
name: string;
|
|
|
|
query: string;
|
|
|
|
description: string;
|
|
|
|
author_id: number;
|
|
|
|
author_name: string;
|
|
|
|
author_email: string;
|
|
|
|
resolution: string;
|
2023-07-17 21:09:12 +00:00
|
|
|
platform: SelectedPlatformString;
|
2021-11-30 18:24:30 +00:00
|
|
|
team_id?: number;
|
|
|
|
created_at: string;
|
|
|
|
updated_at: string;
|
2022-12-14 18:57:57 +00:00
|
|
|
critical: boolean;
|
2021-11-30 18:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Used on the manage hosts page and other places where aggregate stats are displayed
|
|
|
|
export interface IPolicyStats extends IPolicy {
|
2021-08-30 23:02:53 +00:00
|
|
|
passing_host_count: number;
|
|
|
|
failing_host_count: number;
|
2021-12-28 18:07:18 +00:00
|
|
|
webhook: string;
|
2022-04-11 20:21:34 +00:00
|
|
|
has_run: boolean;
|
|
|
|
osquery_policy_ms: number;
|
2021-11-30 18:24:30 +00:00
|
|
|
}
|
|
|
|
|
2022-12-20 15:38:37 +00:00
|
|
|
export interface IPolicyWebhookPreviewPayload {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
query: string;
|
|
|
|
description: string;
|
|
|
|
author_id: number;
|
|
|
|
author_name: string;
|
|
|
|
author_email: string;
|
|
|
|
resolution: string;
|
|
|
|
passing_host_count: number;
|
|
|
|
failing_host_count: number;
|
|
|
|
critical?: boolean;
|
|
|
|
}
|
|
|
|
|
2023-06-02 13:48:17 +00:00
|
|
|
export type PolicyStatusResponse = "pass" | "fail" | "";
|
|
|
|
|
2021-11-30 18:24:30 +00:00
|
|
|
// Used on the host details page and other places where the status of individual hosts are displayed
|
|
|
|
export interface IHostPolicy extends IPolicy {
|
2023-06-02 13:48:17 +00:00
|
|
|
response: PolicyStatusResponse;
|
2021-11-24 17:16:42 +00:00
|
|
|
}
|
|
|
|
|
2022-01-18 15:17:44 +00:00
|
|
|
export interface ILoadAllPoliciesResponse {
|
|
|
|
policies: IPolicyStats[];
|
|
|
|
}
|
|
|
|
|
2022-11-11 21:08:03 +00:00
|
|
|
export interface ILoadTeamPoliciesResponse {
|
|
|
|
policies: IPolicyStats[];
|
|
|
|
inherited_policies: IPolicyStats[];
|
|
|
|
}
|
2021-11-24 17:16:42 +00:00
|
|
|
export interface IPolicyFormData {
|
2022-03-10 15:10:44 +00:00
|
|
|
description?: string | number | boolean | undefined;
|
|
|
|
resolution?: string | number | boolean | undefined;
|
2022-12-14 18:57:57 +00:00
|
|
|
critical?: boolean;
|
2023-07-17 21:09:12 +00:00
|
|
|
platform?: SelectedPlatformString;
|
2022-03-10 15:10:44 +00:00
|
|
|
name?: string | number | boolean | undefined;
|
|
|
|
query?: string | number | boolean | undefined;
|
2021-11-29 19:50:58 +00:00
|
|
|
team_id?: number;
|
2021-12-28 18:07:18 +00:00
|
|
|
id?: number;
|
2021-08-30 23:02:53 +00:00
|
|
|
}
|
2021-12-05 23:12:55 +00:00
|
|
|
|
|
|
|
export interface IPolicyNew {
|
|
|
|
id?: number;
|
2021-12-14 00:21:36 +00:00
|
|
|
key?: number;
|
2021-12-05 23:12:55 +00:00
|
|
|
name: string;
|
|
|
|
description: string;
|
|
|
|
query: string;
|
|
|
|
resolution: string;
|
2022-12-14 18:57:57 +00:00
|
|
|
critical: boolean;
|
2023-07-17 21:09:12 +00:00
|
|
|
platform: SelectedPlatformString;
|
2023-03-30 18:22:41 +00:00
|
|
|
mdm_required?: boolean;
|
2021-12-05 23:12:55 +00:00
|
|
|
}
|