- How to set event log security locally or by using Group Policy
- Summary
- Configure event log security locally
- Modify your local policy to permit customization of the security of your event logs
- Use the computer’s local group policy to set your application and system log security
- Use group policy to set your application and system log security for a domain, site, or organizational unit in Active Directory
- Use group policy to set your application and system log security
- References
- Журналирование Windows EventLog и система оповещения для администраторов
- Журнал событий (Event Logging)
- Win32: централизованное протоколирование событий
- Предисловие
- Теория
- Рекомендации по протоколированию событий
- События в журнале
- Элементы журнала событий
- Журналы
- Источники событий
- Практика
- Файл сообщений
- Категории событий
- Идентификаторы событий
- Строки сообщений
- Регистрация источника событий
- Использование журнала событий
- Послесловие
How to set event log security locally or by using Group Policy
You can customize security access rights to their event logs in Windows Server 2012. These settings can be configured locally or through Group Policy. This article describes how to use both of these methods.
Original product version: В Windows Server 2012 Standard, Windows Server 2012 Datacenter
Original KB number: В 323076
Summary
You can grant users one or more of the following access rights to event logs:
You can configure the security log in the same way. However, you can change only Read and Clear access permissions. Write access to the security log is reserved only for the Windows Local Security Authority (LSA).
You can use an Administrative Template Policy for the purpose. The path for the System Eventlog, for example, is:
Computer Configuration\Administrative Templates\Windows Components\Event log Service\System
The setting is configure log access and it takes the same Security Descriptor Definition Language (SDDL) string.
Microsoft suggests moving to this method once you are on Windows Server 2012.
Configure event log security locally
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
For example, the Application log Security Descriptor is configured through the following registry value: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomSD
The Security Descriptor for each log is specified by using SDDL syntax. For more information about SDDL syntax, see the Platform SDK, or see the article mentioned in the References section of this article.
To construct an SDDL string, note that there are three distinct rights that pertain to event logs: Read, Write, and Clear. These rights correspond to the following bits in the access rights field of the ACE string:
The following is a sample SDDL that shows the default SDDL string for the Application log. The access rights (in hexadecimal) are bold-faced for illustration:
O:BAG:SYD:(D;; 0xf0007 ;;;AN)(D;; 0xf0007 ;;;BG)(A;; 0xf0007 ;;;SY)(A;; 0x5 ;;;BA)(A;; 0x7 ;;;SO)(A;; 0x3 ;;;IU)(A;; 0x2 ;;;BA)(A;; 0x2 ;;;LS)(A;; 0x2 ;;;NS)
For example, the first ACE denies Anonymous Users read, write, and clear access to the log. The sixth ACE permits Interactive Users to read and write to the log.
Modify your local policy to permit customization of the security of your event logs
Back up the %WinDir%\Inf\Sceregvl.inf file to a known location.
Open %WinDir%\Inf\Sceregvl.inf in Notepad.
Scroll to the middle of file, and then put the pointer immediately before [Strings].
Insert the following lines:
Scroll to the end of the file, and then insert the following lines:
AppLogSD=»Event log: Specify the security of the application log in Security Descriptor Definition Language (SDDL) syntax»
SysLogSD=»Event log: Specify the security of the System log in Security Descriptor Definition Language (SDDL) syntax»
Save and then close the file.
Select Start, select Run, type regsvr32 scecli.dll in the Open box, and then press ENTER.
In the DllRegisterServer in scecli.dll succeeded dialog box, select OK.
Use the computer’s local group policy to set your application and system log security
Use group policy to set your application and system log security for a domain, site, or organizational unit in Active Directory
To view the group policy settings that are described in this article in the Group Policy editor, first complete the following steps, and then continue to the Use group policy to set your application and system log security section:
Use a text editor such as Notepad to open the Sceregvl.inf in the %Windir%\Inf folder.
Add the following lines to the [Register Registry Values] section:
MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomSD,1,%AppCustomSD%,2
MACHINE\System\CurrentControlSet\Services\Eventlog\Security\CustomSD,1,%SecCustomSD%,2
MACHINE\System\CurrentControlSet\Services\Eventlog\System\CustomSD,1,%SysCustomSD%,2
MACHINE\System\CurrentControlSet\Services\Eventlog\Directory Service\CustomSD,1,%DSCustomSD%,2
MACHINE\System\CurrentControlSet\Services\Eventlog\DNS Server\CustomSD,1,%DNSCustomSD%,2
MACHINE\System\CurrentControlSet\Services\Eventlog\File Replication Service\CustomSD,1,%FRSCustomSD%,2
Add the following lines to the [Strings] section:
AppCustomSD=»Eventlog: Security descriptor for Application event log»
SecCustomSD=»Eventlog: Security descriptor for Security event log»
SysCustomSD=»Eventlog: Security descriptor for System event log»
DSCustomSD=»Eventlog: Security descriptor for Directory Service event log»
DNSCustomSD=»Eventlog: Security descriptor for DNS Server event log»
FRSCustomSD=»Eventlog: Security descriptor for File Replication Service event log»
Save the changes you made to the Sceregvl.inf file, and then run the regsvr32 scecli.dll command.
Start Gpedit.msc, and then double-click the following branches to expand them:
Computer Configuration
Windows Settings
Security Settings
Local Policies
Security Options
View the right panel to find the new Eventlog settings.
Use group policy to set your application and system log security
In the Active Directory Sites and Services snap-in or the Active Directory Users and Computers snap-in, right-click the object for which you want to set the policy, and then select Properties.
Select the Group Policy tab.
If you must create a new policy, select New, and then define the policy’s name. Otherwise, go to step 5.
Select the policy that you want, and then select Edit.
The Local Group Policy MMC snap-in appears.
Expand Computer Configuration, expand Windows Settings, expand Security Settings, expand Local Policies, and then select Security Options.
Double-click Event log: Application log SDDL, type the SDDL string that you want for the log security, and then select OK.
Double-click Event log: System log SDDL, type the SDDL string that you want for the log security, and then select OK.
References
For more information about SDDL syntax and about how to construct an SDDL string, see Security Descriptor String Format.
Журналирование Windows EventLog и система оповещения для администраторов
Некоторое количество времени(года три) назад, в попытке найти способ экспорта Windows EventLog, была найдена возможность в удобном виде осуществлять аудит различных событий происходящих на сервере.
Microsoft своими «добрыми» технологиями сделала Windows практически несовместимым со штатными системами журналирования событий(syslog), но оставила небольшую лазейку которую можно использовать.
Лазейка представляет собой комбинацию SNMP trap и программы экспорта системных событий evntwin.
Для работы связки нужен настроенный snmptrapd, а также активированный сервис SNMP на windows сервере (добавляется через «добавление/удаление компонентов»).
Первым делом нужно настроить сервер на который будут сбрасываться сообщения из Eventlog.
После того как сервис настроен, запускаем программу evntwin.exe
technet.microsoft.com/en-us/library/cc759390%28WS.10%29.aspx
Как она выглядит видно на следующем скриншоте.
Принцип использования evntwin прост. Вы выбираете категорию и код события которые Вас интересуют и добавляете их в список. При наступлении события сообщение одновременно будет сохранено в EventLog, а также будет «трапнуто» на сервер мониторинга.
На сервере мониторинга в snmptrapd.conf нужно добавить строку обработчика.
Сам обработчик написан мной на perl, код можно взять по ссылке trapd.pl(Не рекомендуется копипастить подсвеченный код из поста, лучше взять по ссылке). Он разбирает входящие trap сообщения и формирует письмо администраторам.
Hostname: bdc.mydoman.ru
Source: UDP: [192.168.0.3]:1081
Change Password Attempt:
Target Account Name:pupkin_v
Target Domain:MYDOM
Target Account ID:%
Caller User Name:pupkin_v
Caller Domain:MYDOM
Caller Logon ID:(0x0,0x39B1BD)
Hostname: sadc.mydomain.ru
Source: UDP: [192.168.0.4]:1074
User Account Locked Out:
Target Account Name:ivanov_v
Target Account ID:%
Caller Machine Name:MX
Caller User Name:SADC$
Caller Domain:MYDOM
Caller Logon ID:(0x0,0x3E7)
Hostname: sadc.mydomain.ru
Source: UDP: [192.168.0.4]:1072
Logon Failure:
Reason:Unknown user name or bad password
User Name:Popov_V
Domain:MYDOM
Logon Type:3
Logon Process:Advapi
Authentication Package:Negotiate
Workstation Name:SADC
Caller User Name:SADC$
Caller Domain:MYDOM
Caller Logon ID:(0x0,0x3E7)
Caller Process ID:580
Source Network Address:192.168.0.20
Source Port:36018
Так как мы подписаны только на интересующие нас сообщения, мы не видим остального системного мусора из EventLog.
Очень удобна данная система при вирусных эпидемиях типа Kido, когда сразу нельзя понять откуда пошло всё размножаться или при брутфорсе системных паролей. Потому что чётко виден Logon Failure и имя машины с которой была неудачная попытка.
Спокойной Вам работы.
PS: готовый конфиг с представленными на скриншоте категориями лежит тут
Журнал событий (Event Logging)
Win32: централизованное протоколирование событий
Автор: Серебряков Алексей (Smooky)
QUIBECK INC.
Источник: RSDN Magazine #3-2007
Опубликовано: 14.11.2007
Исправлено: 10.12.2016
Версия текста: 1.0
Предисловие
Для решения этой проблемы операционная система Windows предоставляет такой сервис и программный интерфейс, как Eventlog. Этот инструментарий относится к числу базовых сервисов Windows, т.е. поставляется с самой системой и система сама же его использует. Стоит заметить, что эта возможность есть только у систем семейств WinNT/XP, т.к. приложение для протоколирования событий является сервисом. Также стоит заметить, что в Windows Vista и Windows Longhorn этот сервис существенно переработан, новый вариант в этой статье рассматриваться не будет.
Мы не будем также рассматривать этот замечательный инструмент с точки зрения администраторов, сборщиков журналов и прочих персон, которые призваны управлять системой. Итак, приступим.
Теория
Рисунок 1.
Наверное, почти все разработчики используют в своих программах протоколирование событий при выявлении ошибок, отладке и диагностировании приложений. Но даже после успешного сбора и просмотра статистики иной раз бывает сложно проанализировать, что же всё-таки случилось и в каком месте? Так вот, сервис «Журнал событий» является стандартным, централизованным способом сбора статистики и просмотра сообщений о событиях, поступающих от приложений, сервисов операционной системы и аппаратных устройств. Средство для просмотра этих событий является оснасткой Microsoft Management Console. В Windows XP Rus эта оснастка запускается так: Пуск->Настройка->Панель управления->Администрирование->Просмотр Событий (Event Viewer).
ПРЕДУПРЕЖДЕНИЕ При использовании сервиса протоколирования в журнал следует записывать достаточно важные и нужные сведения о происшедших ошибках, которые действительно потом могут помочь разработчикам разобраться, что же произошло с приложением. Не следует, например, писать в системный журнал с периодичностью 100нс сообщения о том, что пользователь случайно удалил файл readme.txt. Журнал событий – это не средство трассировки. Рекомендации по протоколированию событийСообщение в журнале событий – это, прежде всего, информация, способная помочь вам, администратору и даже пользователю понять, какая проблема возникла в приложении и как её устранить. В частности, это событие может предназначаться специалисту технической поддержки в вашей компании, и даже ему будет тоскливо читать сообщение: «Процесс А не смог прочитать 0x05 байт 0x2-ого сектора дисковода В». Поэтому идеальное сообщение должно помочь пользователю ответить на следующие вопросы: Могут пригодиться и следующие рекомендации: Соглашения о стиле содержания сообщения: Это неполный список рекомендаций, взятый из MSDN. На самом деле в популярных книгах, например, у Саттера, есть более интересные рекомендации. События в журналеВ журнал можно записывать пять типов событий. Все типы событий достаточно понятно классифицированы, определены и могут включать много дополнительной информации. Каждое событий, которое мы посылаем из своего приложения, может иметь только один тип. Определены следующие типы событий:
Поскольку запись в журнал может происходить нечасто, в тексте сообщения следует достаточно полно описывать происшедшее событие. Следует достаточно понятно описывать событие, так как информацию о событии, до того как она попадёт к разработчику, может просмотреть, например, администратор системы и не придав ей особого значения, просто проигнорировать.
|