Hi,
It seems the first part is solved like this
input {
beats {
port => 5044
}
}
output {
if [service][type] == "auditd" {
syslog {
appname => "security"
host => "172.16.60.12"
port => "514"
protocol => "tcp"
rfc => "rfc5424"
codec => "line"
}
stdout {}
}
elasticsearch {
hosts => "localhost:9200"
user => "elastic"
password => "*****"
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
}
So, I can send auditd logs to SIEM and everything to Elasticsearch.
Now, I want to do the same for Windows Security Events, but it seems it requires slightly different approach
My latest attemp was this for output conditional, but it does not catch anything. Windows logs are sent by winlogbeat to logstash to the same port
if [log_name] == "Security" {
Any idea how to filter everything in Windows Security Events?
A sample event looks like this
"message" => "An account was successfully logged on.\n\nSubject:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tWINSRV$\n\tAccount Domain:\t\tWORKGROUP\n\tLogon ID:\t\t0x3E7\n\nLogon Type:\t\t\t5\n\nImpersonation Level:\t\tImpersonation\n\nNew Logon:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tSYSTEM\n\tAccount Domain:\t\tNT AUTHORITY\n\tLogon ID:\t\t0x3E7\n\tLogon GUID:\t\t{00000000-0000-0000-0000-000000000000}\n\nProcess Information:\n\tProcess ID:\t\t0x1d0\n\tProcess Name:\t\tC:\Windows\System32\services.exe\n\nNetwork Information:\n\tWorkstation Name:\t-\n\tSource Network Address:\t-\n\tSource Port:\t\t-\n\nDetailed Authentication Information:\n\tLogon Process:\t\tAdvapi \n\tAuthentication Package:\tNegotiate\n\tTransited Services:\t-\n\tPackage Name (NTLM only):\t-\n\tKey Length:\t\t0\n\nThis event is generated when a logon session is created. It is generated on the computer that was accessed.\n\nThe subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.\n\nThe logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).\n\nThe New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.\n\nThe network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.\n\nThe impersonation level field indicates the extent to which a process in the logon session can impersonate.\n\nThe authentication information fields provide detailed information about this specific logon request.\n\t- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.\n\t- Transited services indicate which intermediate services have participated in this logon request.\n\t- Package name indicates which sub-protocol was used among the NTLM protocols.\n\t- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.",
"@timestamp" => 2019-06-20T09:21:58.366Z,
"agent" => {
"type" => "winlogbeat",
"id" => "208c3de3-a1dc-41f1-9616-7c23424bd6d6",
"ephemeral_id" => "e245ec55-6a2d-4c0d-8b91-e4e0f2c2d1f0",
"version" => "7.1.1",
"hostname" => "winsrv"
},
"log" => {
"level" => "information"
},
"@version" => "1",
"event" => {
"kind" => "event",
"action" => "Logon",
"created" => "2019-06-21T14:32:35.006Z",
"code" => 4624
},
"winlog" => {
"provider_name" => "Microsoft-Windows-Security-Auditing",
"keywords" => [
"Audit Success"
],
"record_id" => 7489,
"process" => {
"thread" => {
"id" => 908
},
"pid" => 472
},
"opcode" => "Info",
"task" => "Logon",
"channel" => "Security",
"version" => 1,
"provider_guid" => "{54849625-5478-4994-A5BA-3E3B0328C30D}",
"computer_name" => "winsrv",
"event_data" => {
"IpPort" => "-",
"IpAddress" => "-",
"TargetUserSid" => "S-1-5-18",
"SubjectLogonId" => "0x3e7",
"TransmittedServices" => "-",
"SubjectUserName" => "WINSRV$",
"WorkstationName" => "-",
"SubjectDomainName" => "WORKGROUP",
"ProcessName" => "C:\Windows\System32\services.exe",
"ImpersonationLevel" => "%%1833",
"AuthenticationPackageName" => "Negotiate",
"ProcessId" => "0x1d0",
"TargetUserName" => "SYSTEM",
"LogonType" => "5",
"KeyLength" => "0",
"SubjectUserSid" => "S-1-5-18",
"TargetDomainName" => "NT AUTHORITY",
"LmPackageName" => "-",
"TargetLogonId" => "0x3e7",
"LogonGuid" => "{00000000-0000-0000-0000-000000000000}",
"LogonProcessName" => "Advapi "
},
"api" => "wineventlog",
"event_id" => 4624
},
"host" => {
"architecture" => "x86_64",
"id" => "cc734299-d910-4f9c-ac26-36eb408de643",
"name" => "winsrv",
"hostname" => "winsrv",
"os" => {
"family" => "windows",
"platform" => "windows",
"name" => "Windows Server 2012 R2 Datacenter",
"version" => "6.3",
"kernel" => "6.3.9600.19376 (winblue_ltsb_escrow.190520-1700)",
"build" => "9600.19377"
}
}
}
{
"tags" => [
"beats_input_codec_plain_applied"
],
"ecs" => {
"version" => "1.0.0"
},
Thanks