| 1 | // TODO-FE: refactor |
| 2 | export interface Agent { |
| 3 | id?: number |
| 4 | agent_id: string |
| 5 | ip_address: string |
| 6 | os: string |
| 7 | hostname: string |
| 8 | label: string |
| 9 | critical_asset: boolean |
| 10 | wazuh_last_seen: string |
| 11 | velociraptor_id: string |
| 12 | velociraptor_last_seen: string |
| 13 | wazuh_agent_version: string |
| 14 | wazuh_agent_status: AgentStatus |
| 15 | velociraptor_agent_version: string |
| 16 | customer_code: null | string |
| 17 | vulnerabilities?: AgentVulnerabilities[] |
| 18 | online?: boolean |
| 19 | quarantined?: boolean |
| 20 | } |
| 21 | |
| 22 | export enum AgentStatus { |
| 23 | Active = "active", |
| 24 | Disconnected = "disconnected", |
| 25 | NotFound = "not found" |
| 26 | } |
| 27 | |
| 28 | export interface AgentVulnerabilities { |
| 29 | id?: string |
| 30 | architecture: string |
| 31 | condition: string |
| 32 | cve: string |
| 33 | cvss2_score: number |
| 34 | cvss3_score: number |
| 35 | detection_time: string |
| 36 | external_references: string[] |
| 37 | name: string |
| 38 | published: string |
| 39 | severity: VulnerabilitySeverity |
| 40 | status: VulnerabilityStatus |
| 41 | title: string |
| 42 | type: VulnerabilityType |
| 43 | updated: string |
| 44 | version: string |
| 45 | } |
| 46 | |
| 47 | export enum VulnerabilitySeverity { |
| 48 | Critical = "Critical", |
| 49 | High = "High", |
| 50 | Low = "Low", |
| 51 | Medium = "Medium", |
| 52 | Untriaged = "Untriaged" |
| 53 | } |
| 54 | |
| 55 | export enum VulnerabilityStatus { |
| 56 | Valid = "VALID" |
| 57 | } |
| 58 | |
| 59 | export enum VulnerabilityType { |
| 60 | Package = "PACKAGE" |
| 61 | } |
| 62 | |
| 63 | export type OutdatedWazuhAgents = Agent[] |
| 64 | |
| 65 | export type OutdatedVelociraptorAgents = Agent[] |
| 66 | |
| 67 | export interface AgentSca { |
| 68 | description: string |
| 69 | fail: number |
| 70 | start_scan: Date |
| 71 | references: string |
| 72 | name: string |
| 73 | pass: number |
| 74 | score: number |
| 75 | end_scan: Date |
| 76 | policy_id: string |
| 77 | total_checks: number |
| 78 | hash_file: string |
| 79 | invalid: number |
| 80 | } |
| 81 | |
| 82 | export interface ScaPolicyResult { |
| 83 | description: string |
| 84 | id: number |
| 85 | reason: string |
| 86 | command: string |
| 87 | rationale: string |
| 88 | condition: "all" | "any" | "none" |
| 89 | title: string |
| 90 | result: "failed" | "not applicable" | "passed" |
| 91 | policy_id: string |
| 92 | remediation: string |
| 93 | compliance: ScaPolicyResultCompliance[] |
| 94 | rules: ScaPolicyResultRule[] |
| 95 | } |
| 96 | |
| 97 | export interface ScaPolicyResultCompliance { |
| 98 | value: string |
| 99 | key: string |
| 100 | } |
| 101 | |
| 102 | export interface ScaPolicyResultRule { |
| 103 | type: "command" | "directory" | "file" | "numeric" | string |
| 104 | rule: string |
| 105 | } |
| 106 | |
| 107 | export interface AgentArtifactData { |
| 108 | id: number |
| 109 | agent_id: string |
| 110 | velociraptor_id: string |
| 111 | customer_code: string | null |
| 112 | artifact_name: string |
| 113 | flow_id: string |
| 114 | bucket_name: string |
| 115 | object_key: string |
| 116 | file_name: string |
| 117 | content_type: string |
| 118 | file_size: number |
| 119 | file_hash: string |
| 120 | collection_time: string |
| 121 | uploaded_by: number | null |
| 122 | notes: string | null |
| 123 | status: string |
| 124 | } |
| 125 | |
| 126 | // Bulk Delete Types |
| 127 | export type BulkDeleteAgentStatus = "disconnected" | "never_connected" | "active" |
| 128 | |
| 129 | export interface BulkDeleteAgentRequest { |
| 130 | agent_ids: string[] |
| 131 | } |
| 132 | |
| 133 | export interface BulkDeleteFilterRequest { |
| 134 | customer_code?: string |
| 135 | status?: BulkDeleteAgentStatus |
| 136 | disconnected_days?: number |
| 137 | } |
| 138 | |
| 139 | export interface BulkDeleteAgentResult { |
| 140 | agent_id: string |
| 141 | success: boolean |
| 142 | message: string |
| 143 | } |
| 144 | |
| 145 | export interface BulkDeleteAgentsResponse { |
| 146 | success: boolean |
| 147 | message: string |
| 148 | total_requested: number |
| 149 | successful_deletions: number |
| 150 | failed_deletions: number |
| 151 | results: BulkDeleteAgentResult[] |
| 152 | } |