Bitdefender Hypervisor Memory Introspection
alerts.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _ALERTS_H_
6 #define _ALERTS_H_
7 
8 #include "exceptions.h"
9 #include "intronet.h"
10 
14 typedef union _GENERIC_ALERT
15 {
35 
36 extern GENERIC_ALERT gAlert;
37 
40  _In_ QWORD Cr3,
41  _Out_ INTRO_EXEC_CONTEXT *ExecContext
42  );
43 
46  _In_ QWORD Rip,
47  _In_ QWORD Cr3,
48  _In_ BOOLEAN Execute,
49  _Out_ INTRO_CODEBLOCKS *CodeBlocks
50  );
51 
52 void
55  );
56 
57 QWORD
59  _In_ QWORD ProtectionFlag,
61  );
62 
63 QWORD
65  _In_ QWORD ProtectionFlag,
66  _In_opt_ const void *Process,
68  _In_ QWORD AdditionalFlags
69  );
70 
71 void
73  _In_ BOOLEAN CopyInstruction,
74  _Out_ INTRO_CPUCTX *CpuContext
75  );
76 
77 void
79  _In_ const WIN_DRIVER_OBJECT *DriverObject,
80  _Out_ INTRO_DRVOBJ *EventDrvObj
81  );
82 
83 void
85  _In_opt_ const KERNEL_DRIVER *Driver,
86  _Out_ INTRO_MODULE *EventModule
87  );
88 
89 void
92  _Out_ INTRO_MODULE *EventModule
93  );
94 
95 void
98  _Out_ INTRO_PROCESS *EventProcess
99  );
100 
101 void
103  _In_ QWORD ProcessCr3,
104  _Out_ INTRO_PROCESS *EventProcess
105  );
106 
107 void
109  _Out_ INTRO_PROCESS *EventProcess
110  );
111 
112 void
114  _In_ const EXCEPTION_UM_ORIGINATOR *Originator,
115  _Out_ EVENT_EPT_VIOLATION *EptViolation
116  );
117 
118 void
120  _In_ const EXCEPTION_KM_ORIGINATOR *Originator,
121  _Out_ EVENT_EPT_VIOLATION *EptViolation
122  );
123 
124 void
126  _In_ const EXCEPTION_VICTIM_ZONE *Victim,
127  _Out_ EVENT_EPT_VIOLATION *EptViolation
128  );
129 
130 void
132  _In_ const EXCEPTION_VICTIM_ZONE *Victim,
133  _In_ const EXCEPTION_KM_ORIGINATOR *Originator,
134  _Out_ EVENT_MSR_VIOLATION *MsrViolation
135  );
136 
137 void
139  _In_ const EXCEPTION_VICTIM_ZONE *Victim,
140  _In_ const EXCEPTION_KM_ORIGINATOR *Originator,
141  _Out_ EVENT_DTR_VIOLATION *DtrViolation
142  );
143 
144 void
146  _In_ const EXCEPTION_VICTIM_ZONE *Victim,
147  _In_ const EXCEPTION_KM_ORIGINATOR *Originator,
148  _Out_ EVENT_CR_VIOLATION *CrViolation
149  );
150 
151 void
153  _In_ const KERNEL_DRIVER *Driver,
154  _Out_ INTRO_MODULE *EventModule
155  );
156 
157 void
159  _In_ const LIX_TASK_OBJECT *Task,
160  _Out_ INTRO_PROCESS *EventProcess
161  );
162 
163 void
165  _Out_ INTRO_PROCESS *EventProcess
166  );
167 
168 void
170  _In_ const EXCEPTION_VICTIM_ZONE *Victim,
171  _Out_ INTRO_WRITE_INFO *WriteInfo
172  );
173 
174 void
178  );
179 
180 INTSTATUS
182  _In_ DPI_EXTRA_INFO *CollectedExtraInfo,
184  _In_ WIN_PROCESS_OBJECT *VictimProcess,
185  _Out_ INTRO_DPI_EXTRA_INFO *ExtraInfo
186 
187  );
188 
189 #endif // _ALERTS_H_
#define _In_opt_
Definition: intro_sal.h:16
enum _INTRO_ACTION_REASON INTRO_ACTION_REASON
The reason for which an INTRO_ACTION was taken.
_Bool BOOLEAN
Definition: intro_types.h:58
#define _Out_
Definition: intro_sal.h:22
QWORD IntAlertCoreGetFlags(QWORD ProtectionFlag, INTRO_ACTION_REASON Reason)
Returns the flags for an alert.
Definition: alerts.c:366
INTSTATUS IntAlertFillDpiExtraInfo(DPI_EXTRA_INFO *CollectedExtraInfo, INTRO_PC_VIOLATION_TYPE PcType, WIN_PROCESS_OBJECT *VictimProcess, INTRO_DPI_EXTRA_INFO *ExtraInfo)
Fills the collected DPI extra information.
Definition: alerts.c:1371
EVENT_CONNECTION_EVENT Connection
Definition: alerts.h:30
Event structure for CR violation.
Definition: intro_types.h:1346
EVENT_XCR_VIOLATION Xcr
Definition: alerts.h:19
EVENT_EXCEPTION_EVENT Exception
Definition: alerts.h:28
#define _In_
Definition: intro_sal.h:21
Event structure for process creation/termination.
Definition: intro_types.h:1910
Event structure for process creation violation events.
Definition: intro_types.h:1767
void IntAlertMsrFill(const EXCEPTION_VICTIM_ZONE *Victim, const EXCEPTION_KM_ORIGINATOR *Originator, EVENT_MSR_VIOLATION *MsrViolation)
Saves information about a MSR write attempt in an event.
Definition: alerts.c:1150
void IntAlertFillWinProcess(const WIN_PROCESS_OBJECT *Process, INTRO_PROCESS *EventProcess)
Saves information about a windows process inside an alert.
Definition: alerts.c:689
Event structure for integrity violations on monitored structures.
Definition: intro_types.h:1572
EVENT_MODULE_LOAD_VIOLATION ModuleLoad
Definition: alerts.h:32
Event structure for module loading and unloading.
Definition: intro_types.h:1945
EVENT_DTR_VIOLATION Dtr
Definition: alerts.h:20
INTRO_PC_VIOLATION_TYPE
Process creation violation flags.
Definition: intro_types.h:1651
Event structure for agent injection and termination.
Definition: intro_types.h:2345
EVENT_MODULE_EVENT Module
Definition: alerts.h:26
Holds code block patterns information.
Definition: intro_types.h:1041
Describes a user-mode originator.
Definition: exceptions.h:994
int INTSTATUS
The status data type.
Definition: introstatus.h:24
Event structure for illegal paging-structures modifications.
Definition: intro_types.h:1540
Describes a kernel-mode originator.
Definition: exceptions.h:943
void IntAlertCrFill(const EXCEPTION_VICTIM_ZONE *Victim, const EXCEPTION_KM_ORIGINATOR *Originator, EVENT_CR_VIOLATION *CrViolation)
Saves information about a CR write attempt in an event.
Definition: alerts.c:1210
EVENT_PROCESS_CREATION_VIOLATION ProcessCreation
Definition: alerts.h:31
EVENT_CR_VIOLATION Cr
Definition: alerts.h:18
EVENT_TRANSLATION_VIOLATION Translation
Definition: alerts.h:22
void IntAlertFillCpuContext(BOOLEAN CopyInstruction, INTRO_CPUCTX *CpuContext)
Fills the current CPU context for an alert.
Definition: alerts.c:492
EVENT_CRASH_EVENT Crash
Definition: alerts.h:27
Event structure for guest OS crashes.
Definition: intro_types.h:1967
EVENT_EPT_VIOLATION Ept
Definition: alerts.h:16
Describes a kernel driver.
Definition: drivers.h:30
void IntAlertFillVersionInfo(INTRO_VIOLATION_HEADER *Header)
Fills version information for an alert.
Definition: alerts.c:327
QWORD IntAlertProcGetFlags(QWORD ProtectionFlag, const void *Process, INTRO_ACTION_REASON Reason, QWORD AdditionalFlags)
Returns the flags for an alert.
Definition: alerts.c:425
INTSTATUS IntAlertFillCodeBlocks(QWORD Rip, QWORD Cr3, BOOLEAN Execute, INTRO_CODEBLOCKS *CodeBlocks)
Fills the code blocks pattern for an alert.
Definition: alerts.c:71
void IntAlertEptFillFromKmOriginator(const EXCEPTION_KM_ORIGINATOR *Originator, EVENT_EPT_VIOLATION *EptViolation)
Fills kernel mode originator information inside an EPT alert.
Definition: alerts.c:832
GENERIC_ALERT gAlert
Global alert buffer.
Definition: alerts.c:27
void IntAlertFillLixKmModule(const KERNEL_DRIVER *Driver, INTRO_MODULE *EventModule)
Saves information about a kernel module inside an alert.
Definition: alerts.c:1235
Event structure for detections provided by additional scan engines.
Definition: intro_types.h:1865
void IntAlertFillWriteInfo(const EXCEPTION_VICTIM_ZONE *Victim, INTRO_WRITE_INFO *WriteInfo)
Fills the write information for an alert.
Definition: alerts.c:521
EVENT_MEMCOPY_VIOLATION Injection
Definition: alerts.h:21
void IntAlertEptFillFromVictimZone(const EXCEPTION_VICTIM_ZONE *Victim, EVENT_EPT_VIOLATION *EptViolation)
Fills the victim information inside an EPT alert.
Definition: alerts.c:868
EVENT_PROCESS_EVENT Process
Definition: alerts.h:25
Holds information about a driver object.
Definition: windrvobj.h:13
Event structure for MSR violation.
Definition: intro_types.h:1316
unsigned long long QWORD
Definition: intro_types.h:53
An endpoint.
Definition: intronet.h:26
Event structure for suspicious module load into processes.
Definition: intro_types.h:1838
Memory access violations that cross a process boundary.
Definition: intro_types.h:1434
void IntAlertFillWinProcessCurrent(INTRO_PROCESS *EventProcess)
Saves information about the current Windows process inside an alert.
Definition: alerts.c:781
Holds the context in which an execution attempt was detected.
Definition: intro_types.h:1116
Holds information about a memory write attempt.
Definition: intro_types.h:978
Event structure for GDTR/IDTR descriptor tables modifications.
Definition: intro_types.h:1625
Holds all the alert types.
Definition: alerts.h:14
Describes the modified zone.
Definition: exceptions.h:893
EVENT_MSR_VIOLATION Msr
Definition: alerts.h:17
EVENT_AGENT_EVENT Agent
Definition: alerts.h:29
void IntAlertFillDriverObject(const WIN_DRIVER_OBJECT *DriverObject, INTRO_DRVOBJ *EventDrvObj)
Saves driver object information inside an alert. Available only for Windows guests.
Definition: alerts.c:592
void IntAlertEptFillFromUmOriginator(const EXCEPTION_UM_ORIGINATOR *Originator, EVENT_EPT_VIOLATION *EptViolation)
Fills user mode originator information inside an EPT alert.
Definition: alerts.c:807
Common violation header.
Definition: intro_types.h:1189
EVENT_INTROSPECTION_MESSAGE Message
Definition: alerts.h:24
Event structure for process exceptions.
Definition: intro_types.h:1983
union _GENERIC_ALERT GENERIC_ALERT
Holds all the alert types.
void IntAlertFillWinProcessByCr3(QWORD ProcessCr3, INTRO_PROCESS *EventProcess)
Saves information about a Windows process inside an alert. The process is searched by its kernel CR3...
Definition: alerts.c:756
EVENT_INTEGRITY_VIOLATION Integrity
Definition: alerts.h:23
void IntAlertDtrFill(const EXCEPTION_VICTIM_ZONE *Victim, const EXCEPTION_KM_ORIGINATOR *Originator, EVENT_DTR_VIOLATION *DtrViolation)
Saves information about a DTR write attempt in an event.
Definition: alerts.c:1176
Describes a driver object.
Definition: intro_types.h:945
void IntAlertFillWinUmModule(const WIN_PROCESS_MODULE *Module, INTRO_MODULE *EventModule)
Fills information about a user mode module inside an alert.
Definition: alerts.c:653
Event structure for connections.
Definition: intro_types.h:2006
Holds the CPU context for an event.
Definition: intro_types.h:962
void IntAlertFillConnection(const INTRONET_ENDPOINT *Connection, EVENT_CONNECTION_EVENT *Event)
Saves information about a guest connection in an event.
Definition: alerts.c:1331
Event structure for EPT violations.
Definition: intro_types.h:1215
void IntAlertFillLixCurrentProcess(INTRO_PROCESS *EventProcess)
Saves the current Linux process inside an event.
Definition: alerts.c:1310
void IntAlertFillWinKmModule(const KERNEL_DRIVER *Driver, INTRO_MODULE *EventModule)
Saves kernel module information inside an alert.
Definition: alerts.c:617
Structure for keeping the relevant DPI violation information.
Definition: intro_types.h:1685
Describes a user-mode or kernel-mode module.
Definition: intro_types.h:925
Describes a guest process.
Definition: intro_types.h:901
EVENT_ENGINES_DETECTION_VIOLATION EngineDetection
Definition: alerts.h:33
void IntAlertFillLixProcess(const LIX_TASK_OBJECT *Task, INTRO_PROCESS *EventProcess)
Saves information about a Linux process inside an event.
Definition: alerts.c:1264
INTSTATUS IntAlertFillExecContext(QWORD Cr3, INTRO_EXEC_CONTEXT *ExecContext)
Fills the current execution context.
Definition: alerts.c:31
Event structure for XCR violation.
Definition: intro_types.h:1378
Event structure for plain data/message passing.
Definition: intro_types.h:1899
This structure describes a running process inside the guest.
Definition: winprocess.h:83