<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows Security Logging and Other Esoterica : Tips</title><link>http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx</link><description>Tags: Tips</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Mapping pre-Vista Security Event IDs to Security Event IDs in Vista+</title><link>http://blogs.msdn.com/ericfitz/archive/2009/06/10/mapping-pre-vista-security-event-ids-to-security-event-ids-in-vista.aspx</link><pubDate>Thu, 11 Jun 2009 02:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9725278</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/9725278.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=9725278</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=9725278</wfw:comment><description>&lt;P&gt;I've written twice (&lt;A title="Vista Security Events Get Noticed" href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx"&gt;here&lt;/A&gt; and &lt;A title="Documentation on the New Security Events" href="http://blogs.msdn.com/ericfitz/archive/2007/07/31/documentation-on-the-windows-vista-and-windows-server-2008-security-events.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/07/31/documentation-on-the-windows-vista-and-windows-server-2008-security-events.aspx"&gt;here&lt;/A&gt;) about the relationship between the "old" event IDs (5xx-6xx) in WS03 and earlier versions of Windows, and between the "new" security event IDs (4xxx-5xxx)&amp;nbsp;in Vista and beyond.&lt;/P&gt;
&lt;P&gt;In short, EventID(WS03) + 4096 = EventID(WS08) for almost all security events in WS03.&lt;/P&gt;
&lt;P&gt;The exceptions are the logon events.&amp;nbsp; The logon success events (540, 528) were collapsed into a single event 4624 (=528 + 4096).&amp;nbsp; The logon failure events (529-537, 539) were collapsed into a single event 4625 (=529+4096).&lt;/P&gt;
&lt;P&gt;Other than that, there are cases where old events were deprecated (IPsec IIRC), and there are cases where new events were added (&lt;A title="DS Auditing in WS08" href="http://technet.microsoft.com/en-us/library/cc731607.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc731607.aspx"&gt;DS Change&lt;/A&gt;).&amp;nbsp; These are all new instrumentation and there is no “mapping” possible- e.g. the new DS Change audit events are complementary to the old DS Access events; they record something different than the old events so you can’t say that the old event xxx = the new event yyy because they aren’t equivalent.&amp;nbsp; The old event means one thing and the new event means another thing; they represent different points of instrumentation in the OS, not just formatting changes in the event representation in the log.&lt;/P&gt;
&lt;P&gt;Of course I explained earlier &lt;A title="Why we renumbered the security events in Vista" href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx"&gt;why&lt;/A&gt; we renumbered the events, and (in the same place) why the difference is "+4096" instead of something more human-friendly like "+1000".&amp;nbsp; The bottom line is that the event schema is different, so by changing the event IDs (and not re-using any), we force existing automation to be updated rather than just misinterpreting events when the automation doesn't know the version of Windows that produced the event.&amp;nbsp; We realized it would be painful but it is nowhere near as painful as if every event consumer had to be aware of, and have special casing for, pre-Vista events and post-Vista events with the same IDs but different schema.&lt;/P&gt;
&lt;P&gt;So if you happen to know the pre-Vista security events, then you can quickly translate your existing knowledge to Vista by adding 4000, adding 100, and subtracting 4.&amp;nbsp; You can do this in your head.&lt;/P&gt;
&lt;P&gt;However if you're trying to implement some automation, you should avoid trying to make a chart with "&amp;lt;Vista" and "&amp;gt;=Vista" columns of event ID numbers, because this will likely result in mis-parsing one set of events, and because you'll find it frustrating that there is not a 1:1 mapping (and in some cases no mapping at all).&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9725278" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Minimizing Directory Service Audit Event Noise</title><link>http://blogs.msdn.com/ericfitz/archive/2008/09/04/minimizing-directory-service-audit-event-noise.aspx</link><pubDate>Fri, 05 Sep 2008 00:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8925692</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/8925692.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=8925692</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=8925692</wfw:comment><description>&lt;P&gt;I've written before on &lt;A class="" title="Reducing the noise in the security event log" href="http://blogs.msdn.com/ericfitz/archive/2005/01/11/350848.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2005/01/11/350848.aspx"&gt;noise reduction&lt;/A&gt; in the Windows security event log.&amp;nbsp; I've also written to describe &lt;A class="" title="How object access events are generated" href="http://blogs.msdn.com/ericfitz/archive/2006/10/26/how-are-object-access-events-generated.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2006/10/26/how-are-object-access-events-generated.aspx"&gt;how object access auditing works&lt;/A&gt;.&amp;nbsp; But, I still get questions on how to reduce noise from object access events.&amp;nbsp; The other day I got&amp;nbsp;that question, specific to Directory Service objects,&amp;nbsp;on an internal discussion list so I thought I'd clean up the answer a bit and share it with the world.&amp;nbsp; In general the same is true for any type of object, although there are a few more knobs to control for DS objects.&lt;/P&gt;
&lt;P&gt;Object access audit is generated when the system access control list (SACL) on the object matches the access that was performed on ALL of the following conditions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Object&amp;nbsp;- the object that was accessed must have either an explicit or inherited SACL.&amp;nbsp; The access performed is compared against the ACEs in that SACL.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Success or failure of activity - every audit access control entry (ACE) in a SACL will be either of type AUDIT_SUCCESS or AUDIT_FAILURE.&amp;nbsp; The access performed must match the access type of the ACE for the rest of the ACE to be considered.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;User account - the accessing user's token is compared against each ACE matching the access type.&amp;nbsp; If the user, or a group the user belongs to, matches the SID in the ACE, then an audit might be generated.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Access - the access being performed must match the audited accesses in the access mask in an otherwise&amp;nbsp;matching ACE.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The specific auditing algorithm is discussed &lt;A class="" title="Access Check and Audit Generation" href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsce_ctl_tmvc.mspx" mce_href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsce_ctl_tmvc.mspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;So the way to reduce the number of audit events (566 on Windows Server 2003, 4662 on Windows Server 2008, or one of the &lt;A class="" title="Windows Server 2008 DS Change Auditing" href="http://blogs.msdn.com/controlpanel/blogs/be%20placed%20in%20a%20product,%20please%20go%20to%20the" mce_href="http://blogs.msdn.com/controlpanel/blogs/be placed in a product, please go to the"&gt;new DS Change events&lt;/A&gt; on Windows Server 2008) is to cause one or more of those conditions to fail, except in the specific cases that you care about.&lt;/P&gt;
&lt;P&gt;The SACL which will generate the most audit events is "Everyone:Success &amp;amp; Failure:All accesses" on the domain head with OI,CI (object inherit &amp;amp; container inherit flags) for all object types.&amp;nbsp; This SACL matches all of the above conditions in all cases.&amp;nbsp; (Incidentally I think that this is pretty close to the default SACL- with the exception of failures-&amp;nbsp;for Windows 2000 Active Directory installations, and SACLs are not updated when DCs are upgraded from version to version.&amp;nbsp; Windows Server 2003 has much more conservative SACLs for new installations of AD.)&lt;/P&gt;
&lt;P&gt;To reduce noise, I offer the following suggestions, addressing each of the above conditions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Audit only the objects that you care about.&amp;nbsp; User accounts and groups already are well-audited with "Account Management" auditing, so don't audit them with DS access.&amp;nbsp; Perhaps audit OUs, or other DS objects.&amp;nbsp; Use the Object Type and attribute type restrictions that you have in DS Access auditing.&amp;nbsp; Also, in Windows Server 2008, you can affect auditing on a per-object basis &lt;A class="" title="Windows Server 2008 DS Change Auditing" href="http://blogs.msdn.com/controlpanel/blogs/be%20placed%20in%20a%20product,%20please%20go%20to%20the" mce_href="http://blogs.msdn.com/controlpanel/blogs/be placed in a product, please go to the"&gt;by adjusting the SearchFlags attribute&lt;/A&gt; in the AD schema for the object.&amp;nbsp; SACLs are more easily reversed so are probably a more acceptable method of controlling audit for most organizations.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Audit successful accesses only.&amp;nbsp; Failed accesses are common and are NOT indicative of any security problem; in fact many failures are not even explicit requests by the user but are just normal requests made by the OS, and the OS will re-try with less access if the operation fails.&amp;nbsp; In my experience failure auditing is primarily useful for troubleshooting, not for security.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Audit the "Everyone" group.&amp;nbsp; Although this matches any user, you will not accidentally miss any accesses that you care about due to failing to audit a user account who has access to the objects in question.&amp;nbsp; The only time that you would NOT audit "Everyone" is if you had an application or service account which was very noisy; in that case you'd need to create a group with all accounts EXCEPT the noisy accounts, and audit that group.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Audit only the accesses that you care about.&amp;nbsp; Specifically, read accesses occur much more often (in my experience, a conservative estimate is about a 100:1 ratio) than write accesses.&amp;nbsp; If you restrict your auditing to "write" type accesses (including change, delete, change permissions, create, etc.) then you will end up generating far fewer events.&amp;nbsp; Auditing for read access is very noisy.&amp;nbsp; If you must audit for reads, consider auditing fewer objects, perhaps only auditing reads on the container object instead of the objects in the&amp;nbsp;container,&amp;nbsp;or on one "interesting" object in any given container as a "canary".&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8925692" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Tracking User Logon Activity Using Logon Events</title><link>http://blogs.msdn.com/ericfitz/archive/2008/08/20/tracking-user-logon-activity-using-logon-events.aspx</link><pubDate>Thu, 21 Aug 2008 02:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8882820</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/8882820.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=8882820</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=8882820</wfw:comment><description>&lt;P&gt;I get the question fairly often, how to use the logon events in the audit log to track how long a user was using their computer and when they logged off.&lt;/P&gt;
&lt;P&gt;As I have written about previously, &lt;A class="" title="The Trouble with Logoff Events" href="http://blogs.msdn.com/ericfitz/archive/2007/05/08/the-trouble-with-logoff-events.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/05/08/the-trouble-with-logoff-events.aspx"&gt;this method of user activity tracking is unreliable&lt;/A&gt;.&amp;nbsp; It works in trivial cases (e.g. single machine where the user doesn't have physical access to the power switch or power cord), and it works most of the time in simple cases where there is good network connectivy and the user is not trying to evade detection.&amp;nbsp; If the user has physical access to the machine-- for example, can pull out the network or power cables or push the reset button-- and if the user is actively trying to evade time tracking, then the only reliable solution is to surreptitiously put a video camera (subject to local laws) in&amp;nbsp;a place that can monitor the user's presence in front of the keyboard (yes I am aware of research done to track sound of keyboard clicks, etc.).&lt;/P&gt;
&lt;P&gt;There is no way to instrument the OS to account for someone who just backs away from the keyboard and walks away.&amp;nbsp; The screen saver, if configured, will come on after a configurable delay since the last keypress or mouse movement.&amp;nbsp; Yes, if you know the SS delay then you could just work that into your calculations.&amp;nbsp; However the workstation does not lock until the screen saver is dismissed (some of you might have noticed that when you bump the mouse to dismiss the screensaver, sometimes you see your desktop for a fraction of a second- that’s because your machine isn’t locked while the screen saver is being displayed).&amp;nbsp; And the events don't tell you whether the workstation was locked or auto-locked so you don't really know whether to add in the screen saver delay factor.&amp;nbsp; Plus, prior to Windows Vista, there is no workstation lock event at all, only an unlock event, which is constructed in a way which makes it difficult to correlate with the original logon event.&lt;/P&gt;
&lt;P&gt;So the bottom line is, I don't advocate or recommend this method for tracking the time a user spends at the keyboard.&amp;nbsp; If I were hypothetically called as an expert witness, I would testify that such a method is unreliable and trivially circumvented.&amp;nbsp; You have been warned, I've beaten that dead horse enough I guess.&lt;/P&gt;
&lt;P&gt;Given that you are disregarding all my contrary advice, how are you going to accomplish this?&lt;/P&gt;
&lt;P&gt;First, we need a general algorithm.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Use time (for a given logon session) = Logoff time - logon time&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now, what about the cases where the user powers off the machine, or it bluescreens, or a token leak prevents the logoff event from being generated, etc.?&amp;nbsp; We can use the BEGIN_LOGOFF event to handle token leak cases.&amp;nbsp; We can use the shutdown event in cases where the user does not log off.&amp;nbsp; And in case of crashes, the only event we can use is the startup event.&amp;nbsp; Note that each of these introduces increasing levels of uncertainty.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Logoff time = (logoff time | begin_logoff time | shutdown time | startup time)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is good, but what about the time the workstation was locked?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Workstation lock time = unlock time - lock time&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;Total workstation lock time (for a given logon session) = SUM(workstation lock time)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How about remote desktop &amp;amp; terminal server sessions, and fast user switching?&amp;nbsp; You can connect and disconnect from logon sessions, during which time the user technically isn't using the computer.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Session idle time = session connect time - session disconnect time&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;Total session idle time (for a given logon session) = SUM(session idle time)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How about times when the machine was idle?&amp;nbsp; We can estimate that by looking at the time the screen saver was in place and adding the screen saver timeout.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Console idle time = (screen saver dismiss time - screen saver invoke time + screen saver delay)&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;Total console idle time = SUM(console idle time)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Putting all of this together and modifying our original formula, we get:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Use time (for a given logon session)&amp;nbsp;=&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; Logoff time - logon time&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(workstation lock time)&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(session idle time)&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(console idle time)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When we expand it, it is not quite so pretty:&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Use time (for a given logon session)&amp;nbsp;=&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; ( (logoff time | begin_logoff time | shutdown time | startup time) - logon time )&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(unlock time - lock time)&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(session connect time - session disconnect time)&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - SUM(screen saver dismiss time - screen saver invoke time + screen saver delay)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have to be very careful that you only look at events that are properly contained chronologically between two other appropriate events, to avoid accidentally pairing the wrong logon and logoff events, or pairing a lock workstation event from one logon session with a different logon session.&amp;nbsp; The best correlation field is the Logon ID field, the next best are timestamp and user name.&amp;nbsp; At various times you need to examine all of these fields.&lt;/P&gt;
&lt;P&gt;Now, which event IDs correspond to all of these real-world events?&lt;/P&gt;
&lt;P&gt;They are all found in the Security event log.&amp;nbsp; The pre-Vista events (ID=5xx) all have event source=Security.&amp;nbsp; The Vista/WS08 events (ID=4xxx) all have event source=Microsoft-Windows-Security-Auditing.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;512 / 4608&amp;nbsp; STARTUP&lt;BR&gt;513 / 4609&amp;nbsp; SHUTDOWN&lt;BR&gt;528&amp;nbsp;/ 4624&amp;nbsp;&amp;nbsp;LOGON&lt;BR&gt;538 / 4634&amp;nbsp; LOGOFF&lt;BR&gt;551 / 4647&amp;nbsp; BEGIN_LOGOFF&lt;BR&gt;N/A / 4778&amp;nbsp; SESSION_RECONNECTED&lt;BR&gt;N/A / 4779&amp;nbsp; SESSION_DISCONNECTED&lt;BR&gt;N/A / 4800&amp;nbsp; WORKSTATION_LOCKED &lt;BR&gt;* / 4801&amp;nbsp;&amp;nbsp;&amp;nbsp; WORKSTATION_UNLOCKED&lt;BR&gt;N/A / 4802&amp;nbsp; SCREENSAVER_INVOKED&lt;BR&gt;N/A / 4803&amp;nbsp; SCREENSAVER_DISMISSED&lt;BR&gt;&lt;BR&gt;* prior to Windows Vista, there was no event for locking the workstation.&amp;nbsp; Unlocking the workstation generated&amp;nbsp;a pair of events, a logon event and a logoff event (528/538) with logon type 7.&amp;nbsp; These events had the same user name as the "original" logon session and were completely enclosed chronologically by the logon/logoff events for the "real" logon session, but did not contain the Logon ID of the original logon session or other unambiguous correlator.&amp;nbsp; This makes correlation of these events difficult.&lt;/P&gt;
&lt;P&gt;All of these events are generated in the Logon/Logoff audit policy category, although on Windows Vista and Windows Server 2008 they are scattered among the various subcategories in this audit policy category.&amp;nbsp; The &lt;A class="" title="Windows Server 2008 Security Events" href="http://blogs.msdn.com/ericfitz/archive/2008/04/16/windows-server-2003-security-events-posted.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2008/04/16/windows-server-2003-security-events-posted.aspx"&gt;audit event spreadsheet&lt;/A&gt; that Ned wrote has all the policy subcategory mappings as well as the event descriptions.&lt;/P&gt;
&lt;P&gt;Sorry that this is more of a do-it-yourself than a solution-in-a-box, but this is pretty difficult to script and so far I haven't worked on a project that required this.&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8882820" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Rants/default.aspx">Rants</category></item><item><title>Ned on Auditing</title><link>http://blogs.msdn.com/ericfitz/archive/2008/04/19/ned-on-auditing.aspx</link><pubDate>Sun, 20 Apr 2008 06:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8410872</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/8410872.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=8410872</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=8410872</wfw:comment><description>&lt;P&gt;I often talk about Ned, who is the current subject matter expert in Microsoft product support for the auditing feature in the US (Fadi is your guy in the Middle East and we have a couple of guys in Europe).&amp;nbsp; Well, Ned has a blog and I thought I'd point you guys there.&amp;nbsp; His &lt;A class="" title="Ned blogs about Windows Auditing" href="http://blogs.technet.com/askds/archive/tags/audit/default.aspx" mce_href="http://blogs.technet.com/askds/archive/tags/audit/default.aspx"&gt;recent posts on auditing&lt;/A&gt; include a description of how to deploy the special groups logon auditing feature with group policy.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8410872" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>You learn something new every day- Logon Type 0</title><link>http://blogs.msdn.com/ericfitz/archive/2008/02/26/you-learn-something-new-every-day-logon-type-0.aspx</link><pubDate>Tue, 26 Feb 2008 23:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7909612</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/7909612.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=7909612</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=7909612</wfw:comment><description>&lt;P&gt;Today I encountered something new in the logon event- I thought that was old hat and I knew all there was to know about that but I guess I was wrong.&lt;/P&gt;
&lt;P&gt;The logon event (&lt;A class="" title="Events 528 and 540" href="http://blogs.msdn.com/ericfitz/archive/2004/12/09/279282.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2004/12/09/279282.aspx"&gt;528/540&lt;/A&gt; prior to Windows Vista, 4624 in Vista and Windows Server 2008) has a field called a Logon Type.&amp;nbsp; This is a code that is passed into the logon API that tells the authentication system in Windows which policy to check the logon against.&amp;nbsp; Windows has separate policy checks for network logons, interactive logons, etc., so that you can allow users to access a system in some ways but not in others.&lt;/P&gt;
&lt;P&gt;The logon type code is, in C/C++ parlance, an enumerated value- it's an ordered list of numeric values, each with&amp;nbsp;an associated name, and these are defined in a publicly available file in the source code (ntsecapi.h).&amp;nbsp; In the source code, the values are always referenced by name.&lt;/P&gt;
&lt;P&gt;Today on one of the internal aliases someone actually found a logon event with a logon type of 0- I have never personally seen one of these before and 0 is not defined in the &lt;A class="" title="SECURITY_LOGON_TYPE enumeration" href="http://msdn2.microsoft.com/en-us/library/aa380129.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa380129.aspx"&gt;SECURITY_LOGON_TYPE&lt;/A&gt; enumeration, so I would have assumed that it was a bug- but it turns out that we are &lt;A class="" title="Win32_LogonSession WMI Class" href="http://msdn2.microsoft.com/en-us/library/aa394189.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa394189.aspx"&gt;aware&lt;/A&gt; of this case and use it occasionally for system logons.&lt;/P&gt;
&lt;P&gt;So there you are.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7909612" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Why does Windows XP generate so many logon failure events?</title><link>http://blogs.msdn.com/ericfitz/archive/2007/11/09/why-does-windows-xp-generate-so-many-logon-failure-events.aspx</link><pubDate>Sat, 10 Nov 2007 02:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6031509</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/6031509.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=6031509</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=6031509</wfw:comment><description>&lt;P&gt;I got the question last week, why there are so many logon failure events on Windows XP when it is not domain joined.&lt;/P&gt;
&lt;P&gt;The short answer is, by design.&amp;nbsp; (Yes, bad design.)&lt;/P&gt;
&lt;P&gt;The longer answer is that the shell team is working around the fact that there is no "tell me if this user account has a blank password" API.&lt;/P&gt;
&lt;P&gt;When in a workgroup (not domain joined), Windows XP displays a welcome screen that has little pictures (called "tiles") for each user who is permitted to log on to the computer.&lt;/P&gt;
&lt;P&gt;The shell team wanted the experience that when you click on a tile, that you will immediately be logged on if your password is blank (we have good data that a large percentage of home users have blank passwords).&amp;nbsp; They only want you to be prompted for a password if you actually have a password.&amp;nbsp; Fair enough, and it also helps with accessibility for people for whom typing is challenging.&lt;/P&gt;
&lt;P&gt;The XP Welcome Screen, when it is initialized each time it is to be displayed, attempts to log on each user for which a tile will be displayed,&amp;nbsp;using a blank password.&amp;nbsp; Users with non-blank passwords will cause failures in this case (other users will cause logon success events followed by &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;logoff success&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; events). &lt;SPAN style="COLOR: red"&gt;[2007-11-21 correction]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The Welcome Screen uses the result of these logon attempts to decide whether to display a password box when you select a user's tile.&amp;nbsp; If the user has a blank password, they will be logged on instead of being prompted for a password.&lt;/P&gt;
&lt;P&gt;Why are they&amp;nbsp;logging on the account?&amp;nbsp; Well&amp;nbsp;it turns out to be the easiest way to tell if your password is&amp;nbsp;blank.&amp;nbsp;&amp;nbsp;We don't have a "is your password blank" API- that would be a security disaster- and we would prefer that the shell team not go mucking about in the SAM, retrieving hashes&amp;nbsp;and computing the blank password hash for each account so that it could compare them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I asked for this behavior to be changed prior to XP's release.&amp;nbsp; Specifically I asked that the blank password check be moved from Welcome screen initialization to tile selection- this would still cause logon failures but many fewer of them.&amp;nbsp; I was declined.&amp;nbsp; I asked for fixes to it in SP1 and SP2 and was declined.&amp;nbsp; At this point we will not be revisiting this "feature"; the Welcome Screen was redesigned to eliminate this problem.&lt;/P&gt;
&lt;P&gt;The shell team who designed the Welcome Screen did not feel that auditing was a common scenario for workgroup machines, and I didn't (and still don't) have any business case to dispute that.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6031509" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>List of Windows Server 2003 Events</title><link>http://blogs.msdn.com/ericfitz/archive/2007/10/12/list-of-windows-server-2003-events.aspx</link><pubDate>Fri, 12 Oct 2007 21:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5428381</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/5428381.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=5428381</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=5428381</wfw:comment><description>&lt;P&gt;So a long time ago, back in my days of&amp;nbsp;providing technical support for Windows NT 4.0,&amp;nbsp;I published "&lt;A class="" title="Security Event Descriptions, MSFT Knowledge Base Article Q174074" href="http://support.microsoft.com/kb/174074/en-us" mce_href="http://support.microsoft.com/kb/174074/en-us"&gt;Security Event Descriptions&lt;/A&gt;".&amp;nbsp; This article was the "schema" so to speak, for the Windows NT 4.0 security event log events.&lt;/P&gt;
&lt;P&gt;Technically Windows events are not schematized until Windows Vista; or put another way the schema is implicit based on the instrumentation in the code- since the event is raised by some function in the code, the "schema" could be interpreted as the parameter order in the call to that function.&lt;/P&gt;
&lt;P&gt;Anyway security monitoring types love that article, but I hate it.&amp;nbsp; It's just better than nothing.&amp;nbsp; It doesn't state which events map to which audit policy categories.&amp;nbsp; It does tell you whether the event is a succss or failure event but it doesn't alert you to the cases where the same event is used for success and failure (e.g. event 560).&lt;/P&gt;
&lt;P&gt;When Windows 2000 came around and we added two new audit policy categories (DS Access and Account Logon [which was a huge naming blunder]), I wrote an article for the Windows 2000 security events.&amp;nbsp; However it was so large I broke it into &lt;A class="" title="Windows 2000 Security Event Descriptions (Part 1 of 2)" href="http://support.microsoft.com/kb/299475/en-us" mce_href="http://support.microsoft.com/kb/299475/en-us"&gt;two&lt;/A&gt; &lt;A class="" title="Windows 2000 Security Event Descriptions (Part 2 of 2)" href="http://support.microsoft.com/kb/301677/EN-US/" mce_href="http://support.microsoft.com/kb/301677/EN-US/"&gt;articles&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I didn't write an article for Windows Server 2003.&amp;nbsp; At first I didn't think it was necessary because we propagated all the WS03 events to the &lt;A class="" title="Technet Events and Errors Message Center" href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx" mce_href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx"&gt;Technet Events &amp;amp; Errors Message Center&lt;/A&gt; web site.&amp;nbsp; I wrote custom content for the top 30 or so events by volume of searches&lt;/P&gt;
&lt;P&gt;(On a side note, did you ever wonder what happens when you click the "More Information" link at the bottom of the Event Viewer event description?&amp;nbsp; We send the event source, event ID, OS version and so forth to the Technet E&amp;amp;E site and display the content that is returned.&amp;nbsp; We count the number of hits for each OS Version/Source/Event ID combination and then our writing teams pester the component owners to populate that content.)&lt;/P&gt;
&lt;P&gt;Anyway, I was making excu^h^h er, explaining why I didn't write the KB articles for Windows Server 2003 security events.&amp;nbsp; So I thought the E&amp;amp;E message center would be all that anyone needed.&amp;nbsp; It didn't strike me as that important that you had to have seen the event (or at least know it exists) before you could use the site.&amp;nbsp; However since then I have received a large number of requests for the event definitions, mainly from people who were creating security event management solutions.&lt;/P&gt;
&lt;P&gt;So here's what I have for you, courtesy of Ned, one of the audit log posse here at Microsoft.&amp;nbsp; If you want a complete list of WS03 security events, then I suggest you look at &lt;A class="" title="Windows Server 2003 Security Guide: Audit Policy" href="http://www.microsoft.com/technet/security/prodtech/windowsserver2003/w2003hg/s3sgch04.mspx#EKH" mce_href="http://www.microsoft.com/technet/security/prodtech/windowsserver2003/w2003hg/s3sgch04.mspx#EKH"&gt;chapter 4 of the Windows Server 2003 Security Guide&lt;/A&gt;.&amp;nbsp; This documents the event IDs of all the security events on Windows Server 2003.&amp;nbsp; Plus, it groups them by policy category, in case you ever wanted to know what you are in for if you enable one of the categories for audit.&amp;nbsp; If you want the layout of the event (what data is in the description field, and in what order) then just look for that specific event on the &lt;A class="" title="Technet Events and Errors Message Center" href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx" mce_href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx"&gt;Technet E&amp;amp;E&lt;/A&gt; site or click the link in the bottom of the event description in Event Viewer.&lt;/P&gt;
&lt;P&gt;I've already described how the Vista and Windows Server 2008 (and subsequent releases) event systems are &lt;A class="" title="Eric's Blog Post on Vista Event Schema" href="http://blogs.msdn.com/ericfitz/archive/2007/07/31/documentation-on-the-windows-vista-and-windows-server-2008-security-events.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/07/31/documentation-on-the-windows-vista-and-windows-server-2008-security-events.aspx"&gt;self-documenting&lt;/A&gt;, so I won't go into that further here.&lt;/P&gt;
&lt;P&gt;One last tip: If you own &lt;A class="" title="OpsMgr 2007 Home Page" href="http://www.microsoft.com/systemcenter/opsmgr/default.mspx" mce_href="http://www.microsoft.com/systemcenter/opsmgr/default.mspx"&gt;Microsoft System Center Operations Manager 2007&lt;/A&gt;, then you can search for a file called EventSchema.xml on the media.&amp;nbsp; It is an XML document that describes one possible normalization all the security events from Windows 2000 forward, and the semantic content of the normalized events.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;2007-10-31 UPDATE: There is also an event-id-to-audit-policy-category map &lt;/SPAN&gt;&lt;A class="" title=Technet href="http://technet2.microsoft.com/windowsserver/en/library/6847e72b-9c47-42ab-b3e3-691addac9f331033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/windowsserver/en/library/6847e72b-9c47-42ab-b3e3-691addac9f331033.mspx?mfr=true"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5428381" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Help!  Someone has deleted events from my Windows event log!</title><link>http://blogs.msdn.com/ericfitz/archive/2007/08/10/help-someone-has-deleted-events-from-my-windows-event-log.aspx</link><pubDate>Sat, 11 Aug 2007 01:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4325901</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/4325901.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=4325901</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=4325901</wfw:comment><description>&lt;P&gt;From time to time I hear this, and it usually turns out not to be the case.&lt;/P&gt;
&lt;P&gt;I'll begin with a little background.&lt;BR&gt;&lt;BR&gt;First, The eventlog service does not have (and never did have) any public or private API to delete individual events- there is a log clear API but nothing else.&amp;nbsp; The eventlog team thought about implementing selective delete for Vista (there were some internal groups asking for it) but a lot of us security types yelled at them and nothing came of it.&amp;nbsp; Logs are logs, not databases- if you want selective delete, export the events you want to a database and have at it.&lt;/P&gt;
&lt;P&gt;Second, there is no getting around the &lt;A class="" title="Ten Immutable Laws of Security" href="http://www.microsoft.com/technet/archive/community/columns/security/essays/10imlaws.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/archive/community/columns/security/essays/10imlaws.mspx?mfr=true"&gt;10 Immutable Laws of Security&lt;/A&gt;, particularly law #6 (a computer is only as secure as the administrator is trustworthy) and law #2 (if a bad guy can alter the operating system on your computer, it's not your computer anymore).&lt;/P&gt;
&lt;P&gt;What this means is that, no matter if we implemented the most advanced, coolest, 1337est event-signing/real-time-exporting/writing-to-optical-media-and-a-line-printer-too event system, IT DOESN'T MATTER IF THE ATTACKER IS THE ADMINISTRATOR- all we do is reduce the window of time that that person has to do his dirty work.&amp;nbsp; Now I will admit there is value in those features, but if such an evil person were to use his powers of debugging to open the services.exe process (where eventlog lives) and inject&amp;nbsp;a thread which alters the eventlog data structures in memory in real time, prior to commit to disk, then none of that stuff would help us.&amp;nbsp; As a matter of fact such tools exist, they are not theoretical.&amp;nbsp; I haven't seen the Vista versions yet but there's no technical reason why such a tool could not be built for Vista.&lt;/P&gt;
&lt;P&gt;However, the cases I've seen of apparent gaps in event logs have a much more mundane explanation: the "Retain X days" event retention policy.&amp;nbsp; This is an evil setting; if people truly understood it they wouldn't use it.&amp;nbsp; Prepare to truly understand it.&lt;/P&gt;
&lt;P&gt;&amp;lt;puts on lab coat&amp;gt;&lt;/P&gt;
&lt;P&gt;Imagine you have a finite space S to store resources of type R.&amp;nbsp; You get a constant incoming stream of R's, and put each of them into S.&amp;nbsp; Now imagine that S is full and a new R arrives.&amp;nbsp; You have two choices:&lt;BR&gt;&amp;nbsp;&lt;BR&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw the new R away.&lt;BR&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove one or more of the old R's from S (enough so that the new R can fit into S) and put the new R into S.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;When selecting&amp;nbsp;which old R's to discard, the generally accepted best practice is that you should&amp;nbsp;throw away the oldest R first- in other words freshness is a priority.&amp;nbsp; Of course if you wanted to optimize for space you could just pick the smallest old R equal to or larger than the new R, but that would cause ordering problems if you wanted to maintain sequential access.&amp;nbsp; You could even pick one or more old R's at random but that would be too arbitrary for most structured purposes like logging.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;Now imagine that you had an additional constraint: you can throw away old R's, but only if they're more than X days old.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;Now your choices are:&lt;BR&gt;&amp;nbsp;&lt;BR&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw the new R away, or&lt;BR&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw away one or more of the old R's, &lt;EM&gt;if and only if&lt;/EM&gt; there are enough R's that are older than X.&lt;/P&gt;
&lt;P&gt;If there are no R's older than X, you may not discard any old R's and since you have a fixed size buffer S and there is no room for the new R, you&amp;nbsp;MUST choose option 1- throw away the new R.&amp;nbsp; You have no other choices.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;This is the situation with event log.&amp;nbsp; "&lt;EM&gt;Retain X days&lt;/EM&gt;" actually CAUSES event loss (as does "&lt;EM&gt;Overwrite as needed&lt;/EM&gt;").&amp;nbsp; However, &lt;EM&gt;Overwrite as needed&lt;/EM&gt; causes &lt;EM&gt;predictable&lt;/EM&gt; event loss (oldest events gone).&amp;nbsp; &lt;EM&gt;Retain X days&lt;/EM&gt; causes unpredictable event loss (if the log is full and there are no events older than X days, then NEW events are thrown away until there are some events older than X days).&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Detecting gaps in your log&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Can we detect if someone has deleted events out of your log?&lt;/P&gt;
&lt;P&gt;At the end of the day, the event log is an ordered list of data structures (called event records), with each having a pointer to the next.&amp;nbsp; There is also a unique, monotonically increasing sequence number associated with each event record.&lt;/P&gt;
&lt;P&gt;A clever attacker will have disabled the instrumentation that causes the event to be raised; eventlog will never have been involved so there will be no gap (but no event).&lt;/P&gt;
&lt;P&gt;A less clever or less resourceful attacker who deletes an event from the log, probably will not go fix up the sequence numbers for the rest of the log (in fact the attacker might not even fix up the pointers, causing the eventlog service to crash or hang).&lt;/P&gt;
&lt;P&gt;We can use this priciple to our advantage.&amp;nbsp; By examining each event and looking at its sequence number, we can look for gaps in the stream and, although we can never be sure that there was no tampering, we can often tell when there was tampering.&lt;/P&gt;
&lt;P&gt;Here's a VBScript that demonstrates this concept.&amp;nbsp; I don't provide VBScript support; you're on your own on this one.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;'EventLogGapDetector.vbs&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;' (c) 2007 Microsoft Corporation, All Rights Reserved&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;' &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;strComputer = "." &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;Set objWMIService = GetObject("winmgmts:\\" &amp;amp; strComputer &amp;amp; "\root\CIMV2") &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;Set colItems = objWMIService.ExecQuery( _&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;"SELECT * FROM Win32_NTLogEvent ",,48)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;iPrev = 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;first = true&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;gapdetected = false&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;newgapdetected = false&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;currlogfile = ""&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;oldlogfile = ""&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;For Each objItem in colItems&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;iCurrent =&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;CInt(objItem.RecordNumber)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;currlogfile = objItem.Logfile&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if ((iCurrent &amp;lt;&amp;gt; (iPrev-1)) and (not (first)) and currlogfile=oldlogfile) then newgapdetected = true&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (newgapdetected) then Wscript.Echo "Gap detected, log file = " &amp;amp; currlogfile &amp;amp; ", last record = " &amp;amp; iPrev &amp;amp; ", current record = " &amp;amp; objItem.RecordNumber&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (newgapdetected) then gapdetected = true&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;iPrev = CInt(objItem.RecordNumber)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;first = false&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;newgapdetected = false&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;oldlogfile = currlogfile&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #1f497d; FONT-FAMILY: 'Courier New'; mso-themecolor: dark2"&gt;if not (gapdetected) then Wscript.Echo "No gaps detected."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;Eric&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face=Calibri&gt;The information provided in this post is provided "AS-IS" with no warranty, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4325901" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Documentation on the Windows Vista and Windows Server 2008 Security Events</title><link>http://blogs.msdn.com/ericfitz/archive/2007/07/31/documentation-on-the-windows-vista-and-windows-server-2008-security-events.aspx</link><pubDate>Wed, 01 Aug 2007 00:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4153099</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/4153099.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=4153099</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=4153099</wfw:comment><description>&lt;P&gt;I'm hearing lots of complaints that we don't have &lt;A class="" title="Microsoft Knowledge Base" href="http://support.microsoft.com/kb/299475" mce_href="http://support.microsoft.com/kb/299475"&gt;KB articles&lt;/A&gt; on these yet.&amp;nbsp; Doriansoft has a &lt;A class="" title=Doriansoft href="http://eventlogs.blogspot.com/2007/04/4096-security-events-lane.html" mce_href="http://eventlogs.blogspot.com/2007/04/4096-security-events-lane.html"&gt;blog post&lt;/A&gt; complaining that the "&lt;A class="" href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx"&gt;add 4096&lt;/A&gt;" rule doesn't work because we collapsed the logon events into a single success event and failure event (from 2 success events [528, 540] and&amp;nbsp;10 failure events [529-537, 539]).&lt;/P&gt;
&lt;P&gt;Well, In Vista and beyond the event log is self-documenting.&amp;nbsp; From an elevated command prompt (one with admin privileges), type the following:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;wevtutil gp Microsoft-Windows-Security-Auditing /ge /gm:true&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This example dumps only the 360 or so unique security event messages (publisher=Microsoft-Windows-Security-Auditing); other publishers can be enumerated with the &lt;STRONG&gt;ep&lt;/STRONG&gt; switch of wevtutil.&lt;/P&gt;
&lt;P&gt;Event messages can be formatted as XML using the /f switch, see the command-line help.&lt;/P&gt;
&lt;P&gt;As a side note, this is, in slightly different format, the same information we publish in the KB, and a KB article is in the works.&lt;/P&gt;
&lt;P&gt;Why did we renumber the events?&amp;nbsp; As explained in my earlier &lt;A class="" href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx" mce_href="http://blogs.msdn.com/ericfitz/archive/2007/04/18/vista-security-events-get-noticed.aspx"&gt;post&lt;/A&gt;, we changed the internal detail of each event so much (to improve understandability, readability, consistency, etc.) that we would have broken essentially all existing automation anyway.&amp;nbsp; By renumbering the events we made the automation break in as obvious a way as possible, and also made it as clear as possible that THESE ARE DIFFERENT EVENTS.&lt;/P&gt;
&lt;P&gt;The "add 4096" rule is not meant to imply that the events are the same, but rather allows you to find the new equivalent event, if you have knowledge of the old event.&amp;nbsp; Simply renumbering your automation will not make it work.&amp;nbsp; It's a mental aid for you, the Windows security professional.&lt;/P&gt;
&lt;P&gt;[2007-10-12 Update: changed tags]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4153099" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>The Trouble With Logoff Events</title><link>http://blogs.msdn.com/ericfitz/archive/2007/05/08/the-trouble-with-logoff-events.aspx</link><pubDate>Tue, 08 May 2007 23:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2487738</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/2487738.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=2487738</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=2487738</wfw:comment><description>&lt;P&gt;A lot of you guys probably are using your SEM/SEIM systems to record logon and logoff activity without much of a second thought.&lt;/P&gt;
&lt;P&gt;I just thought I'd bring one problem to your attention.&lt;/P&gt;
&lt;P&gt;Logoff events are not strictly reliable.&lt;/P&gt;
&lt;P&gt;From an engineering sense they are deterministic.&amp;nbsp; However like many audit events, if you don't really think about how they work you might make assumptions that aren't correct.&amp;nbsp; And you know what they say about assumptions...&lt;/P&gt;
&lt;P&gt;Anyway, here's the problem.&amp;nbsp; There is nothing that requires a client to notify you when the client decides to stop using your services.&amp;nbsp; So for network logon sessions, the "logoff" event often just means "I got tired of waiting with reserved resources allocated for the client, so I reclaimed the resources.&amp;nbsp; I'll give the client more resources if they come back (and can authenticate)".&amp;nbsp; In other words- timeout.&lt;BR&gt;&lt;BR&gt;You cannot, with protocols, force a client to notify you that they're done.&amp;nbsp; Nice clients will if they can.&amp;nbsp; Sometimes they physically&amp;nbsp;can't notify you (this could be what we used to call the "backhoe and a beer" problem in&amp;nbsp;my years in product support&amp;nbsp;that is completely beyond the client's control).&amp;nbsp; Sometimes they just choose not to notify you.&amp;nbsp; I myself have designed software which just tore down the network connection when done or at the first sign of trouble, and started over again from scratch, rather than go through sophisticated "goodbye" or "fault" semantics.&amp;nbsp; A robust server can handle the situation and will notice fairly quickly, reclaiming any reserved resources and generating any necessary audit trail.&amp;nbsp; However I have seen software that has such expensive connection set-up that they hang on to connections for dear life long after everyone else would have turned out the lights and gone home.&amp;nbsp; The funny&amp;nbsp;thing is that half the time they don't realize that their client crashed, lost its state (that they were depending on for reconnection) and rebooted, and has reconnected with a new session.&amp;nbsp; But I digress.&lt;/P&gt;
&lt;P&gt;For interactive logon sessions, there is no guarantee of a logoff event either.&amp;nbsp; There is no law of physics that forces a logoff audit if I pull the power cord out while I'm plugged in.&lt;/P&gt;
&lt;P&gt;Plus, I've talked about token leaks before haven't I?&amp;nbsp; Maybe not?&lt;/P&gt;
&lt;P&gt;Windows logon events technically mean that we have created a data structure called a logon session.&amp;nbsp; Associated with a logon session are one or more data structures called tokens.&amp;nbsp; Each token has a number associated with it called a reference count, which is just a count of how many&amp;nbsp;processes&amp;nbsp;are using it at any given time.&amp;nbsp; The reference count starts at 1 and goes up whenever a new process starts and down when the process terminates.&amp;nbsp; It also goes up when a process specifically asks for a reference to a token and goes down when the process releases that reference.&amp;nbsp; When the last process (your shell program, Explorer) releases its reference to your token, the token's reference count drops to zero.&amp;nbsp; When the reference count drops to zero we destroy the token and the logon session associated with the token; the logoff event means the logon session was destroyed.&amp;nbsp; For network logons we use a thread token that is given back to the service that asked to log you on; that token is usually assigned to a thread that does work on your behalf.&amp;nbsp; It's all a little more complex than this in real life but this is basically how it works.&lt;/P&gt;
&lt;P&gt;Anyway many applications, particularly server applications, request references to tokens, and then forget to release the references.&amp;nbsp; This causes the reference counts to never drop to zero, and prevents us from generating the logoff event as a result.&lt;/P&gt;
&lt;P&gt;To work around this we added the "Begin logoff" event (551) in Windows Server 2003, which can be interpreted as a logoff event, but this doesn't cover all cases.&amp;nbsp; There are still some cases where logoff events are not generated due to poorly behaving applications.&amp;nbsp; We fix all known instances of this in the operating system before we release Windows, and we test it rather thoroughly, but we can't promise that your applications will not leak tokens.&amp;nbsp; If you encounter this you can troubleshoot by isolating each application until the token leak goes away, and then working with that application vendor.&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2487738" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Descriptions/default.aspx">Descriptions</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Enumerating Stuff in AD when all you see is GUIDs in Audit Records</title><link>http://blogs.msdn.com/ericfitz/archive/2007/05/03/enumerating-control-access-rights-and-other-ad-stuff.aspx</link><pubDate>Thu, 03 May 2007 23:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2402438</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/2402438.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=2402438</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=2402438</wfw:comment><description>&lt;P&gt;A lot of things in Active Directory audit events show up as GUIDs but are not translated.&amp;nbsp; Why is that?&lt;/P&gt;
&lt;P&gt;Well,&amp;nbsp;the&amp;nbsp;Event Viewer in Windows&amp;nbsp;only translate one kind of AD guid, the objectGUID.&amp;nbsp; However AD uses GUIDs in several ways.&amp;nbsp; For instance, group policy objects have a common name (CN) which is a string-ized GUID.&amp;nbsp; Control Access Rights have a rightsGuid.&lt;/P&gt;
&lt;P&gt;If you, my intrepid log analyzer, want to build your own reference charts so that you can translate these, you can use the "LDP" tool.&amp;nbsp; This utility is in the Windows 2000 Server Resource Kit and the Support Tools for &lt;A title="Windows XP Support Tools Download" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38&amp;amp;DisplayLang=en"&gt;Windows XP&lt;/A&gt; and Windows Server 2003, and it's built into Windows Server 2008.&lt;/P&gt;
&lt;P&gt;Complete instructions on how to use LDP are beyond the scope of this post.&amp;nbsp; However the basic procedure is this:&lt;/P&gt;
&lt;P&gt;1. "Connect" to a domain controller.&lt;BR&gt;2. "Bind" to the DC by entering your credentials (in WS08, LDP.EXE lets you bind with your current logged-on account's&amp;nbsp;identity without providing credentials).&amp;nbsp; For our purposes an ordinary user account is fine, we're just going to query.&lt;BR&gt;3.&amp;nbsp; Use "Search" from the browse menu to find the stuff you're interested in; it will print out in the right-hand pane.&lt;/P&gt;
&lt;P&gt;Here are some things you can enumerate, and the Search settings you'll use in LDP.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Control Access Rights&lt;/STRONG&gt;&lt;BR&gt;Base DN: CN=Configuration,DC=yourdomain,DC=com&lt;BR&gt;Filter: objectClass=controlaccessright&lt;BR&gt;Scope: subtree&lt;BR&gt;Options/Attributes: name;rightsGuid;&lt;/P&gt;
&lt;P&gt;Then just&amp;nbsp;click the&amp;nbsp;"Run" button- Voila!&amp;nbsp; You can cut &amp;amp; paste the results into a text file that you can use whenever you need to look up a CAR.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Schema Objects (properties, etc.)&lt;BR&gt;&lt;/STRONG&gt;&lt;EM&gt;There are too many schema attributes to enumerate them all (well you can with a lot of custom search settings like increasing buffer sizes and timeouts&amp;nbsp;but I'm not going to advise you to beat up your AD). So here is how to look up a particular property.&lt;/EM&gt;&lt;BR&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;Base DN: CN=Schema,CN=configuration,DC=yourdomain,DC=com&lt;BR&gt;Filter: schemaIDGUID=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: red; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin"&gt;bf967a8d-0de6-11d0-a285-00aa003049e2&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin"&gt;&amp;nbsp;&amp;nbsp; &lt;B style="mso-bidi-font-weight: normal"&gt;&amp;lt;-- your property GUID goes here&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;BR&gt;Scope: subtree&lt;BR&gt;Options/Attributes: name;schemaIDGUID;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;STRONG&gt;Group Policy Objects&lt;BR&gt;&lt;/STRONG&gt;&lt;EM&gt;For some reason group policy objects have a common name which is a GUID, even though all AD objects already have GUIDs.&amp;nbsp; This seems really weird to me (I would use a different word than weird but our company values include being respectful).&amp;nbsp; Anyway if you want to find out the "friendly" name of a GPO, here's what you do.&lt;/EM&gt;&lt;BR&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;Base DN: DC=yourdomain,DC=com&lt;BR&gt;Filter: CN=&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: red; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;{6ac1786c-016f-11d2-945f-00c04fb984f9}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin"&gt;&amp;nbsp; &lt;B style="mso-bidi-font-weight: normal"&gt;&amp;lt;-- your&amp;nbsp;GPO name&amp;nbsp;goes here, complete with curly braces&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;BR&gt;Scope: subtree&lt;BR&gt;Options/Attributes: displayName;cn;distinguishedName;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;Anyway with these examples you should be well on your way.&amp;nbsp; You can always change the attribute list that the search returns to "*;" (yes, add the semicolon) to tell you all the properties of each object, but I've tried to show you how to list only the most interesting ones.&amp;nbsp; Microsoft Press has a book on &lt;A title="MSDN Active Directory Schema Reference" href="http://msdn2.microsoft.com/en-us/library/ms675085.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms675085.aspx"&gt;Active Directory schema&lt;/A&gt; that's part of the MSDN Active Directory Developer's Reference Library, but it's dated (pre-Windows 2000 RTM) and all the material is available on &lt;A title=MSDN href="http://msdn.microsoft.com/" target=_blank mce_href="http://msdn.microsoft.com"&gt;MSDN&lt;/A&gt; if you do a little &lt;A title="Windows Live Search" href="http://search.live.com/" target=_blank mce_href="http://search.live.com"&gt;searching&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: red; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;STRONG&gt;&lt;EM&gt;[2009-06-12 Updated to describe LDP in Windows Server 2008 and clarification of GUID translation]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2402438" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Where do I get my information on Windows auditing?</title><link>http://blogs.msdn.com/ericfitz/archive/2007/02/06/where-do-i-get-my-information-on-windows-auditing.aspx</link><pubDate>Wed, 07 Feb 2007 01:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1614210</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/1614210.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=1614210</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=1614210</wfw:comment><description>&lt;P&gt;You might want to know where I go to get my information on audit events and so forth.&lt;/P&gt;
&lt;P&gt;Mostly I go to the source code or one of our developers.&amp;nbsp; For continuity-of-employment reasons I won't be posting a link to that here ;-)&amp;nbsp; We have some old specs and some new specs but sometimes the code doesn't function quite like the spec says it should so I usually go to the code instead of the spec.&lt;/P&gt;
&lt;P&gt;However you can download the &lt;A class="" title="Platform SDK Download" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c2b1e300-f358-4523-b479-f53d234cdccf&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c2b1e300-f358-4523-b479-f53d234cdccf&amp;amp;DisplayLang=en"&gt;Windows Platform SDK&lt;/A&gt; for free, and it includes all the header files which define all the Windows error codes and so forth.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I also search my email with Outlook 2007's &lt;A class="" title="Outlook 2007 Instant Search" href="http://office.microsoft.com/en-us/outlook/HA012305851033.aspx?pid=CH100788821033" mce_href="http://office.microsoft.com/en-us/outlook/HA012305851033.aspx?pid=CH100788821033"&gt;Instant Search&lt;/A&gt; feature (yes that was a blatant plug).&amp;nbsp; A lot of times I find that I answered a question or had a discussion about something a long time ago.&amp;nbsp; This has become less useful lately as the legal guys are making us delete all our old email.&amp;nbsp; I am trying to capture some of this kind of content in this blog since hopefully it will outlive my email :-)&amp;nbsp; Maybe I will write a book.&lt;/P&gt;
&lt;P&gt;I use the &lt;A class="" title="TechNet Events &amp;amp; Errors" href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx" mce_href="http://www.microsoft.com/technet/support/ee/ee_advanced.aspx"&gt;Technet Events &amp;amp; Errors&lt;/A&gt; web site.&amp;nbsp; This is the site where Event Viewer goes for content when you click the link in the bottom of an event.&amp;nbsp; Not all events are populated (actually only a small percentage have hand-written content).&lt;/P&gt;
&lt;P&gt;I use &lt;A class="" title="Windows Live Search" href="http://www.live.com/?searchonly=true" mce_href="http://www.live.com/?searchonly=true"&gt;Windows Live Search&lt;/A&gt; or sometimes that other search engine to search the internet for content, but only rarely.&amp;nbsp; Sometimes I go to Randy Smith's web site, &lt;A class="" title="Ultimate Windows Security Encyclopedia" href="http://www.ultimatewindowssecurity.com/encyclopedia.html" mce_href="http://www.ultimatewindowssecurity.com/encyclopedia.html"&gt;Ultimate Window Security&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Anyway these are all my primary sources.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;STRONG&gt;2007-02-08 Updated Platform SDK download link per PSDK group advice&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1614210" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Determining Whether a User Logged on Using A Smart Card</title><link>http://blogs.msdn.com/ericfitz/archive/2007/02/05/determining-whether-a-user-logged-on-using-a-smart-card.aspx</link><pubDate>Tue, 06 Feb 2007 03:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1607707</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/1607707.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=1607707</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=1607707</wfw:comment><description>&lt;P&gt;I get asked the question pretty regularly how to determine from the security log whether a user logged on using a smart card or not.&lt;/P&gt;
&lt;P&gt;The short answer is, you can't be absolutely certain.&amp;nbsp; The longer answer is, well, you&amp;nbsp;can be&amp;nbsp;pretty certain&amp;nbsp;for the time being, especially if you're not running any non-Microsoft Kerberos code.&lt;/P&gt;
&lt;P&gt;First you&amp;nbsp;need to know that you can&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;only&lt;/STRONG&gt;&lt;/EM&gt; log on using a smart card in Windows&amp;nbsp;when you authenticate to a domain&amp;nbsp;using the Kerberos protocol.&amp;nbsp; There is a cached logon mechanism in Windows XP so you can log on using your smart card when a domain controller is unavailable but Windows will attempt to acquire domain credentials automatically for you, under the hood, when you log on this way, and you won't be able to touch any other machine on the network using domain authentication until you authenticate to the DC.&lt;/P&gt;
&lt;P&gt;Now for you guys that are not Kerberos gurus, there are three phases to Kerberos authentication:&lt;/P&gt;
&lt;P&gt;1. Authentication Service Request (AS-REQ) &amp;amp; Reply, where the client presents credentials to a KDC and obtains a ticket-granting ticket.&lt;/P&gt;
&lt;P&gt;2. Ticket-Granting Service Request (TGS-REQ) &amp;amp; Reply, where the client presents a TGT to a KDC and obtains a service ticket.&lt;/P&gt;
&lt;P&gt;3. Application Request (AP-REQ or just normal application traffic), where the client presents a service ticket to an application and requests service.&lt;/P&gt;
&lt;P&gt;In Windows, #1 generates &lt;A class="" title="Security Event ID 672" href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=672&amp;amp;EvtSrc=Security&amp;amp;LCID=1033" mce_href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=672&amp;amp;EvtSrc=Security&amp;amp;LCID=1033"&gt;security event ID 672&lt;/A&gt; on the DC (on Windows 2000 the failure event is 675 but in&amp;nbsp;Windows Server 2003&amp;nbsp;the failure event is the same as the success event, 672).&amp;nbsp; Event 672 records who requested the ticket, their IP address, etc., and also includes the kind of credentials they used, called the "patype" or "preauth type", short for "pre-authentication type".&amp;nbsp; Preauth types are discussed in the Kerberos RFC, &lt;A class="" title="RFC 4120" href="ftp://ftp.rfc-editor.org/in-notes/rfc4120.txt" mce_href="ftp://ftp.rfc-editor.org/in-notes/rfc4120.txt"&gt;RFC 4120&lt;/A&gt; in section 7.5.2.&lt;/P&gt;
&lt;P&gt;In Windows, #2 generates &lt;A class="" title="Security Event ID 673" href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=673&amp;amp;EvtSrc=Security&amp;amp;LCID=1033" mce_href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=673&amp;amp;EvtSrc=Security&amp;amp;LCID=1033"&gt;security event ID 673&lt;/A&gt; on the DC (on Windows 2000, the failure event is 676, in WS03, it's 673)&lt;/P&gt;
&lt;P&gt;In Windows, #3 causes a logon event (&lt;A class="" title="Security Event ID 528" href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=528&amp;amp;EvtSrc=Security&amp;amp;LCID=1033" mce_href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=528&amp;amp;EvtSrc=Security&amp;amp;LCID=1033"&gt;528&lt;/A&gt; or &lt;A class="" title="Security Event ID 540" href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=540&amp;amp;EvtSrc=Security&amp;amp;LCID=1033" mce_href="http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20System&amp;amp;ProdVer=5.0&amp;amp;EvtID=540&amp;amp;EvtSrc=Security&amp;amp;LCID=1033"&gt;540&lt;/A&gt;) on the machine that is accessed, if the "application" is the machine itself, that is to say that the "service" is "host\machinename".&lt;/P&gt;
&lt;P&gt;OK, now that the background is out of the way, back to the question.&amp;nbsp; How do I know if it was a smart card logon?&lt;/P&gt;
&lt;P&gt;Well, as mentioned, the preauth type is listed in event 672.&amp;nbsp; Smart cards use public keys for pre-authentication (patype = PKINIT, which is 14, 15, 16, or 17 we learn from RFC 4120).&amp;nbsp; So if you see one of these preauth types in this event on the DC, you know that it was a smart card logon- WRONG!&amp;nbsp; You know actually just that it was a PKINIT logon.&lt;/P&gt;
&lt;P&gt;However, currently the only logons built into Windows that use PKINIT preauth type over Kerberos, are smart card logons.&amp;nbsp; So for the time being you can make the assumption.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1607707" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Trustworthiness of Information in Audit Records</title><link>http://blogs.msdn.com/ericfitz/archive/2006/09/20/763918.aspx</link><pubDate>Wed, 20 Sep 2006 20:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:763918</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/763918.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=763918</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=763918</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I get asked quite often "why is the Workstation name missing from some events?"&amp;nbsp; I've explained that &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ericfitz/archive/2005/08/09/449664.aspx"&gt;&lt;FONT face=Verdana size=2&gt;elsewhere&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;.&amp;nbsp; But this raises another issue that many of you might not have considered, and I want to take a few minutes to explain.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The Windows Security event log is designed to be as trustworthy as possible, and &lt;A href="http://www.commoncriteriaportal.org/public/files/epfiles/ST_VID4025-VR.pdf"&gt;meets&lt;/A&gt; all the &lt;A href="http://www.commoncriteriaportal.org/"&gt;Common Criteria&lt;/A&gt; audit &lt;A href="http://www.commoncriteriaportal.org/public/files/ccpart2v2.3.pdf"&gt;requirements&lt;/A&gt; for audit in our&amp;nbsp;&lt;A href="http://www.commoncriteriaportal.org/public/files/epfiles/ST_VID4025-ST.pdf"&gt;security target&lt;/A&gt; in the&amp;nbsp;&lt;A href="http://www.commoncriteriaportal.org/public/files/ppfiles/capp.pdf"&gt;Controlled Access Protection Profile&lt;/A&gt;&amp;nbsp;for EAL4+.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Basically that means that we log all the events that CC says to log with the information that CC says has to be in those events, that we have access controls in place to the log, that we detect log failure conditions and can be configured to prevent auditable activity in those cases, and that our design and development methodologies conform to the relevant CC requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;We have several basic strategies for ensuring the trustworthiness of the security log and the data in it:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Access control on both the APIs used to log events to the security log, and on the log itself for log access and log management.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;A trusted path from the security subsystem (LSASS.EXE) to the security event log.&amp;nbsp; By this I mean that we spent significant effort to protect the log from casual tampering; only a determined attacker with administrator credentials could cause the auditing system to malfunction in such a way as to prevent, alter or spoof events.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Default access control on the audit APIs to only allow audit generation by code that is isolated from user accounts.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Drawing on trusted sources such as system state whenever possible rather than relying on information passed in from APIs that could be called by a non-privileged user.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I want to address the last two points.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It is the case that most auditors (users of the security event log) want the events to be as "high-level" as possible.&amp;nbsp; I know that you want events that say:&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;"Eric used Excel to change the executive compensation spreadsheet"&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;and&amp;nbsp;not&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;"process ID 1289 running in context S-1-5-21-1235-6780-501 performed a WRITE_DATA on \dosdevices\c\shared files\exec_comp.xls".&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;However the isolation requirement causes us to instrument not in Excel, where we could indeed capture the menu and toolbar actions the user takes, but rather way down deep in the file system, where that information isn't available.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Look at it this way- if Excel could write to the log file, that means that the user running Excel could write to the log file, which means that the log file is no more trustworthy than the user.&amp;nbsp; Obviously this is not desirable if you suspect the user of violating your business policy; the user might just take some action to cover their own tracks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The sacrifice is that the audit is from the system's point of view, not the user's.&amp;nbsp; This makes it harder to interpret, especially when you have an app like Word or Explorer which has unusual file access semantics.&amp;nbsp; But we source all the information from in the file system where it's trustworthy; we don't depend on anything in the user's context telling us what to put in the audit record.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;We often log events that were caused by remote activity.&amp;nbsp; In remote logon cases the &lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;Common Criteria require us to include&amp;nbsp;a "station name", if applicable, where the logon request originated.&amp;nbsp; This poses an unusual problem for us.&amp;nbsp; In order to log the remote station name, we need to know it.&amp;nbsp; However we authenticate the user's credentials, not the workstation's, during a user logon event, and Windows supports multiple authentication protocols that can be transported across multiple network protocols.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It is often the case that the network protocol can't tell us the authenticated name of the machine at the other end of the connection (for example, IP).&amp;nbsp; It is also often the case that the authentication protocol has no facility for transporting the station name (for example, Kerberos) or that the authentication protocol doesn't transport the station name securely (for example, NTLM).&amp;nbsp; It's also the case that when we depend on the logon request to carry the station name, and the name is unauthenticated, that the station name is spoofable by a knowledgable attacker at the other end of the connection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The bottom line is that sometimes to meet the "station name" Common Criteria requirement we were forced to include unauthenticated information ("workstation name") in the audit record.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Another problem is that many of you asked me, quite emphatically, to add IP addresses to Window Security events so that you can correlate these events with network device logs and other information about the network.&amp;nbsp; When I proposed this for Windows Server 2003 there was a very vigorous debate internally because many people on the team were reluctant to add unauthenticated, spoofable information to the security event log.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The utility of the information, coupled with the number and intensity of the requests, won out in the end.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Also, I pointed out that IP address is not very spoofable in authentication traffic.&amp;nbsp; Since the traffic is encrypted, requires a response by the client back to the server, and that response depends on the server's response to the client's initial request, and since all our authentication protocols travel over TCP, the spoofability is very low- an attacker must be in the same collision domain as one of the endpoints or must control an intervening router.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;That's just some food for thought.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=763918" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category></item><item><title>A good 3rd-party reference to the Windows security event log</title><link>http://blogs.msdn.com/ericfitz/archive/2006/03/20/555778.aspx</link><pubDate>Mon, 20 Mar 2006 21:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:555778</guid><dc:creator>Eric Fitzgerald</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ericfitz/comments/555778.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ericfitz/commentrss.aspx?PostID=555778</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ericfitz/rsscomments.aspx?PostID=555778</wfw:comment><description>&lt;FONT face=Tahoma size=2&gt;Randy Franklin Smith has a site with a very good&amp;nbsp;&lt;/FONT&gt;&lt;A href="http://www.ultimatewindowssecurity.com/encyclopedia.html"&gt;&lt;FONT face=Tahoma size=2&gt;reference&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma size=2&gt; to security event log events.&amp;nbsp; Randy also does training on Windows security log analysis.&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=555778" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ericfitz/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.msdn.com/ericfitz/archive/tags/News/default.aspx">News</category></item></channel></rss>