Ogamat.AuditProvider
1.0.0
dotnet add package Ogamat.AuditProvider --version 1.0.0
NuGet\Install-Package Ogamat.AuditProvider -Version 1.0.0
<PackageReference Include="Ogamat.AuditProvider" Version="1.0.0" />
paket add Ogamat.AuditProvider --version 1.0.0
#r "nuget: Ogamat.AuditProvider, 1.0.0"
// Install Ogamat.AuditProvider as a Cake Addin #addin nuget:?package=Ogamat.AuditProvider&version=1.0.0 // Install Ogamat.AuditProvider as a Cake Tool #tool nuget:?package=Ogamat.AuditProvider&version=1.0.0
Ogamat.AuditProvider
.Net audit provider for managing and logging into windows event logs (security log, application log)
Nuget
How-to:
Write your own implementation of Ogamat.AuditProvider.AuditProvider class. You need to provide
Policy = your own implementation of Ogamat.AuditProvider.AuditPolicy to allow logging specific event ids
EventLogName = string, name of the event log
LogLocation = enum (application log or security log)
Add methods for logging specififc events. Example:
public class SampleProvider : AuditProvider
{
public SampleProvider(SamplePolicy policy)
: base(policy, "SampleAppEventLog", LogLocation.SecurityLog)
{
}
public void AuditApplicationInitialization(Guid instanceId)
{
ReportAudit(1, true, instanceId);
}
public void AuditApplicationTermination(Guid instanceId)
{
ReportAudit(2, true, instanceId);
}
}
Security event source registration:
EventSourceInstaller.InstallSecurityEventSource(
EventLogName,
null,
null,
null,
Assembly.GetEntryAssembly().Location,
false);
You need to set special policies to use security event log (use secpol.msc Microsoft Management Console):
Local Policies / Audit Policy / Audit object access = Success, Failure
Local Policies / User Rights Assignment / Manage auditing and security log
Local Policies / User Rights Assignment / Generate security audits
and you must be an administrator to register security event source.
Based on article and source code from MSDN Magazine written by Mark Novak from Microsoft
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 1,258 | 3/23/2018 |
Summary of changes made in this release of the package.