Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

rmaudit.c File Reference

#include <nt.h>
#include <ntlsa.h>
#include <ntos.h>
#include <ntrmlsa.h>
#include "sep.h"
#include "adt.h"
#include "adtp.h"
#include "rmp.h"

Go to the source code of this file.

Functions

VOID SepRmSetAuditLogWrkr (IN PRM_COMMAND_MESSAGE CommandMessage, OUT PRM_REPLY_MESSAGE ReplyMessage)
VOID SepRmSetAuditEventWrkr (IN PRM_COMMAND_MESSAGE CommandMessage, OUT PRM_REPLY_MESSAGE ReplyMessage)


Function Documentation

VOID SepRmSetAuditEventWrkr IN PRM_COMMAND_MESSAGE  CommandMessage,
OUT PRM_REPLY_MESSAGE  ReplyMessage
 

Definition at line 51 of file rmaudit.c.

References ASSERT, _SE_AUDITING_STATE::AuditOnFailure, _SE_AUDITING_STATE::AuditOnSuccess, FALSE, PAGED_CODE, ReplyMessage(), SeAuditingState, SeDetailedAuditing, SepAdtAuditingEnabled, SepAdtInitializeBounds(), and TRUE.

00058 : 00059 00060 This function carries out the Reference Monitor Set Audit Event 00061 Command. This command enables or disables auditing and optionally 00062 sets the auditing events. 00063 00064 00065 Arguments: 00066 00067 CommandMessage - Pointer to structure containing RM command message 00068 information consisting of an LPC PORT_MESSAGE structure followed 00069 by the command number (RmSetAuditStateCommand) and a single command 00070 parameter in structure form. 00071 00072 ReplyMessage - Pointer to structure containing RM reply message 00073 information consisting of an LPC PORT_MESSAGE structure followed 00074 by the command ReturnedStatus field in which a status code from the 00075 command will be returned. 00076 00077 Return Value: 00078 00079 VOID 00080 00081 --*/ 00082 00083 { 00084 00085 PPOLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions; 00086 POLICY_AUDIT_EVENT_TYPE EventType; 00087 00088 PAGED_CODE(); 00089 00090 SepAdtInitializeBounds(); 00091 00092 ReplyMessage->ReturnedStatus = STATUS_SUCCESS; 00093 00094 // 00095 // Strict check that command is correct one for this worker. 00096 // 00097 00098 ASSERT( CommandMessage->CommandNumber == RmAuditSetCommand ); 00099 00100 // 00101 // Extract the AuditingMode flag and put it in the right place. 00102 // 00103 00104 SepAdtAuditingEnabled = (((PLSARM_POLICY_AUDIT_EVENTS_INFO) CommandMessage->CommandParams)-> 00105 AuditingMode); 00106 00107 // 00108 // For each element in the passed array, process changes to audit 00109 // nothing, and then success or failure flags. 00110 // 00111 00112 EventAuditingOptions = ((PLSARM_POLICY_AUDIT_EVENTS_INFO) CommandMessage->CommandParams)-> 00113 EventAuditingOptions; 00114 00115 00116 for ( EventType=AuditEventMinType; 00117 EventType <= AuditEventMaxType; 00118 EventType++ ) { 00119 00120 SeAuditingState[EventType].AuditOnSuccess = FALSE; 00121 SeAuditingState[EventType].AuditOnFailure = FALSE; 00122 00123 if ( EventAuditingOptions[EventType] & POLICY_AUDIT_EVENT_SUCCESS ) { 00124 00125 SeAuditingState[EventType].AuditOnSuccess = TRUE; 00126 } 00127 00128 if ( EventAuditingOptions[EventType] & POLICY_AUDIT_EVENT_FAILURE ) { 00129 00130 SeAuditingState[EventType].AuditOnFailure = TRUE; 00131 } 00132 } 00133 00134 // 00135 // Set the flag to indicate that we're auditing detailed events. 00136 // This is merely a timesaver so we can skip auditing setup in 00137 // time critical places like process creation. 00138 // 00139 00140 // 00141 // Despite what the UI may imply, we never audit failures for detailed events, since 00142 // none of them can fail for security related reasons, and we're not interested in 00143 // auditing out of memory errors and stuff like that. So just set this flag when 00144 // they want to see successes and ignore the failure case. 00145 // 00146 // We may have to revisit this someday. 00147 // 00148 00149 if ( SeAuditingState[AuditCategoryDetailedTracking].AuditOnSuccess && SepAdtAuditingEnabled ) { 00150 00151 SeDetailedAuditing = TRUE; 00152 00153 } else { 00154 00155 SeDetailedAuditing = FALSE; 00156 } 00157 00158 return; 00159 }

VOID SepRmSetAuditLogWrkr IN PRM_COMMAND_MESSAGE  CommandMessage,
OUT PRM_REPLY_MESSAGE  ReplyMessage
 

Definition at line 164 of file rmaudit.c.

References DbgPrint, PAGED_CODE, ReplyMessage(), and SepAdtSetAuditLogInformation().

00171 : 00172 00173 This function carries out the Reference Monitor Set Audit Log 00174 Command. This command stores parameters related to the Audit Log. 00175 00176 Arguments: 00177 00178 CommandMessage - Pointer to structure containing RM command message 00179 information consisting of an LPC PORT_MESSAGE structure followed 00180 by the command number (RmSetAuditStateCommand) and a single command 00181 parameter in structure form. 00182 00183 ReplyMessage - Pointer to structure containing RM reply message 00184 information consisting of an LPC PORT_MESSAGE structure followed 00185 by the command ReturnedStatus field in which a status code from the 00186 command will be returned. 00187 00188 Return Value: 00189 00190 None. A status code is returned in ReplyMessage->ReturnedStatus 00191 00192 --*/ 00193 00194 { 00195 // 00196 // Strict check that command is correct one for this worker. 00197 // 00198 00199 /* BUGWARNING - SCOTTBI - Auditing is disabled 00200 00201 ASSERT( CommandMessage->CommandNumber == RmSetAuditLogCommand ); 00202 00203 */ 00204 00205 PAGED_CODE(); 00206 00207 #if DBG 00208 DbgPrint("Security: RM Set Audit Log Command Received\n"); 00209 #endif 00210 00211 // 00212 // Call private function in Auditing Sub-component to do the work. 00213 // 00214 00215 SepAdtSetAuditLogInformation( 00216 (PPOLICY_AUDIT_LOG_INFO) CommandMessage->CommandParams 00217 ); 00218 00219 ReplyMessage->ReturnedStatus = STATUS_SUCCESS; 00220 }


Generated on Sat May 15 19:45:29 2004 for test by doxygen 1.3.7