2016-06-13 01:05 PM
Hello
I'm trying to create an ESA Rule for a windows system, where an account is created, and then the user is logged in.
Basically when an account is created the user_dst is Administrator but the user_src is the account name in this case mynewuser4
When the user logs in this is in the user_dst of the event.
I think there is a mistake in the part highlighted below, but I cant work out what it is.
My rule is:
/*
This basic template is a placeholder for defining basic EPL content that can be
installed and executed in ESA. The sample below is the minimum that would be
required to get started.
Version: 3.0
*/
/*
Module debug section. If this is empty then debugging is off.
*/
/* EPL section. If there is no text here it means there were no statements. */
module Module_575ec959e4b003f2f0b9a8da;
@Name('Module_575ec959e4b003f2f0b9a8da_Alert')
@Description('User Account Created and then logged in')
@RSAAlert(oneInSeconds=0)
@Name('Result') SELECT * FROM Event(
/* Statement: User Account Created */
(event_desc .toLowerCase() LIKE '%account was created%' and user_src is not null)
OR
/* Statement: User Logged In */
(event_desc .toLowerCase() LIKE '%successfully logged on%' and user_dst is not null)
).win:time(10 Minutes)
MATCH_RECOGNIZE (
MEASURES E1 as e1_data , E2 as e2_data
PATTERN (E1 E2)
DEFINE
E1 as (E1.event_desc .toLowerCase() LIKE '%account was created%'),
E2 as ( (E2.event_desc .toLowerCase() LIKE '%successfully logged on%') and E2.user_dst=E1.user_src)
);
However, I cant seem to get it to fire.
Here are some logs to trigger the alert:
Account Created:
%NICWIN-4-Security_4720_Microsoft-Windows-Security-Auditing: Security,rn=137057075 cid=8360 eid=540,Mon Jun 13 16:52:47 2016,4720,Microsoft-Windows-Security-Auditing,,Audit Success,DWAUGH03.waugh.local,User Account Management,,A user account was created. Subject: Security ID: S-1-5-21-3929296122-4034834785-506100842-500 Account Name: administrator Account Domain: WAUGH Logon ID: 0x1724b0 New Account: Security ID: S-1-5-21-3929296122-4034834785-506100842-700269 Account Name: mynewuser4 Account Domain: WAUGH Attributes: SAM Account Name: mynewuser4 Display Name: mynewuser 4 User Principal Name: mynewuser4@waugh.local Home Directory: - Home Drive: - Script Path: - Profile Path: - User Workstations: - Password Last Set: <never> Account Expires: <never> Primary Group ID: 513 Allowed To Delegate To: - Old UAC Value: 0x0 New UAC Value: 0x15 User Account Control: Account Disabled 'Password Not Required' - Enabled 'Normal Account' - Enabled User Parameters: - SID History: - Logon Hours: <value not set> Additional Information: Privileges -
Account Successfully Logged on
%NICWIN-4-Security_4624_Microsoft-Windows-Security-Auditing: Security,rn=137057111 cid=5140 eid=540,Mon Jun 13 16:52:58 2016,4624,Microsoft-Windows-Security-Auditing,,Audit Success,DWAUGH03.waugh.local,Logon,,An account was successfully logged on. Subject: Security ID: S-1-0-0 Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 New Logon: Security ID: S-1-5-21-3929296122-4034834785-506100842-700269 Account Name: mynewuser4 Account Domain: WAUGH Logon ID: 0x2acc0100 Logon GUID: {3EE5F4CB-6D96-A1CE-21A2-EAAE2938446C} Process Information: Process ID: 0x0 Process Name: - Network Information: Workstation Name: Source Network Address: 192.168.123.15 Source Port: 34729 Detailed Authentication Information: Logon Process: Kerberos Authentication Package: Kerberos Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon session is created. It is generated on the computer that was accessed. The 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. The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network). The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on. The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Logon GUID is a unique identifier that can be used to correlate this event with a KDC event. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
The above worked on the ESPER Tryout page but not on my Security Analytics ESA Box
2016-06-13 01:57 PM
Trying now with:
@Name('Result') SELECT * FROM PATTERN [every
a=Event(event_desc .toLowerCase() LIKE '%account was created%' and user_src is not null)
->
b=Event(event_desc .toLowerCase() LIKE '%successfully logged on%' and user_dst is not null AND b.user_dst =a.user_src)
WHERE timer:within(600 seconds)
];
2016-06-13 02:09 PM
Here is my working Rule:
/*
This basic template is a placeholder for defining basic EPL content that can be
installed and executed in ESA. The sample below is the minimum that would be
required to get started.
Version: 3.0
*/
/*
Module debug section. If this is empty then debugging is off.
*/
/* EPL section. If there is no text here it means there were no statements. */
module Module_575ec959e4b003f2f0b9a8da;
@Name('Module_575ec959e4b003f2f0b9a8da_Alert')
@Description('User Account Created and then logged in')
@RSAAlert(oneInSeconds=0)
@Name('Result') SELECT * FROM PATTERN @SuppressOverlappingMatches
[every
a=Event(event_desc .toLowerCase() LIKE '%account was created%' and user_src is not null)
->
b=Event(event_desc .toLowerCase() LIKE '%successfully logged on%' and user_dst is not null AND b.user_dst =a.user_src)
WHERE timer:within(600 seconds)
];