-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flesh out support for multiple users in an event #589
Comments
cc @neu5ron, @eternalyperplxed, @vbohata, @willemdh Your thoughts on this would be appreciated, as always :-) |
cc @rw-access if you can comment, or cc the right Endgamer to chime in for this discussion :-) |
Personally I think for clarity, it would be good to nest all user related data under
Found an example logon event where 2 different user names are mentioned:
Original event message:
In the above example, But as you can see this was initiated from my workstation which runs under users Imho it won't be easy to find a solution which match all possible cases where multiple users are in 1 event. We could put But imho we should put Another point is to take some other fields into account at the same time, because together with the user comes also the domain... So we would also need To be continued... Looking forward to other people's opinions.. :) |
@webmat in the current version of ECS (
, however I'm not seeing a field to store the parent process name, which would be equivalent to:
|
@andrew-goldstein Valid point, but let's keep this issue about multiple users :-) Please open a separate issue for this. |
@willemdh I didn't initially envision nesting user within itself. But it may work better than the examples I gave in the issue text. While So I like the idea of nesting user within itself, Would it make sense for user management scenarios? For the "User A creates User B" scenario, would Perhaps as you say, we should not try to find one naming scheme to match all scenarios. Naming ideas, take 2:
|
Another example (I stumbled upon today):
In this case it's for the user Atm I'm doing it like this:
But it seems like
|
Hi @webmat, @willemdh
For in cases 1-4, I think the idea of having nested users field fits very well for the cases I have seen so far and I really like the idea of both having the user.name and the user.target.name as @willemdh mentioned. So, in summary I believe is a very good idea to use the nesting approach but I would choose a different name from user.target.name and user.subject.name (those make me think in windows events). Maybe user.name.primary and secondary? and if we have cases like 5 where there are more "actors" will be possible add more user.name.n-ary fields What do you think? |
Thanks for the detailed information and examples @janniten . Although I totally agree user.subject.name and user.target.name indeed makes you think of windows, imho that doesn't need to be a bad thing? Most organizations are using Active Directory and are used to subject an target user fields. I'm quite sure my Windows security colleagues would really appreciate some known terminology. Also target and subject terminology is used in a lot of documentation etc. Reusing subject and target would imho make things a lot less complex. For your example 5, maybe another solution could be acceptable? Let's think about some workarounds for cases such as 5, before reinventing the wheel. Some wild ideas: |
Hi @willemdh |
Definitely, all of the above is also just imho. 😄 If the majority of ecs desingers think using n-ary fields are our best option, I will definitely follow. So what do you think of |
Sorry I don't follow the idea. Do you mean user.object.name -> user c ? |
@janniten correct |
I think that always the created user should me mapped to the same field. So if we have 'user a logging in as user b creating user c' and user.object.name -> user c, then when we have 'user a creating user b' user.object.name should have user b as value in order to preserve the semantic... and then in that case we will be not using the user.target.name |
What about having multiple users in a user.subject.name? I mean a list of usernames... |
So, not to derail the conversation too much, but i think it would be pretty useful to have a more generic definition of
Therefore, whatever is done, I'd advocate for trying to address the more general use case rather than just adding in support for user's specifically and then having to go back and add support, with slightly different, but similar semantics, for other use cases later on. If we did something like created a general namespace for |
Yes, I'm open to this idea. I've been thinking very rigidly about source/destination about the two sides of a network exchange. This shows also in the relationship between src/dst and client/server, which are meant to add semantic context about each side of that exchange. But there's been so many requests for nesting process, user & so on under source and destination that it's something we should consider as well. Thanks for raising the point, @andrewstucki! |
I wonder if we could solve this problem by having an ECS entry inside another ECS entry. For example if we had a case where "user alice adds user bob to group friends" a very simplified nested ECS might look like this: {
"event": {
"action": "update-group-membership",
"user" : {
"name" : "alice"
},
"child_event" : {
"action": "add-user-to-group",
"user" : {
"name" : "bob"
},
"group" : {
"name" : "friends"
}
}
}
} If on ingest the child_event was also used for indexing it should be possible to retrieve this document with user.name:bob or user.name:alice. One possible downside. If you want to search for all instances where alice does the adding and not bob you have to explicitly ask for the nesting:
But I don't think that is worse than target.user or affected.user. The difference being a generic "child_event" instead of the specific "target" or "affected". This should be a benefit in case we need to do nesting we haven't thought of. For example this should work for the case 5 @janniten mentioned above.
FYI. I don't like the name "child_event" but I haven't thought of anything better. |
@leehinman Imho the child event option is not a good option. My preference still goes to the target and subject option. At least for ms related events... Try explaining an AD admin that targetusername would be called child_event.user.name.. |
I agree with @andrewstucki about having more generic definitions. Regarding to the content of user.name IMHO I think that we should keep the newly created user as auditbeat do it. I put an example of how auditbeat puts the fields in case 5 auditd.summary.actor.primary: user_a @willemdh is not very different about what you are proposing (but without user the subject/target naming) with the only difference that user.name is not the original user but the new user in this case user.actor.primary: user_a Does it makes sense? |
In more complicated systems/logs we are currently facing following:
So to support logging of the events above we will need fields like: "subject.user.name" - admin user name "target.user.name" - user's name "user.name" - user's name If using subject/target, it should be a higher level fields (subject.user, not user.subject), as user is not only one possible subject). So "multiple users" issue looks very complicated. Maybe impossible to implement without the nested objects => Kibana has to support it. |
@willemdh I kept thinking about the user.object.name option and I believe is a good options.
Also I agree that user name who is doing the action should be in the user.name field. Another user-related field that I observed while working with windows events events is the one that glue the actions performed by an user. Could have sense to have a field called user.session.id ? Thank you! |
Nice summary @janniten.. Best model of everything I've seen here. |
all these examples are here: its just going to boil down to semantics, source/target or destination/source or as something like OSSEM uses: reporter, subject, and target because each log is done |
Hi All,
@webmat what do you think? Does it make sense to open a PR in order to propose this addition? |
…module (#15217) Added Audit and Log Management related events, Computer Object Management Events, Distribution Groups Events. Changed user.name field for user management events and related.user mapping. New Events Due to that Windows events are the source of information for Winlogbeat the events 1100, 1102, 1104, 1105, 1108 and 4719 has been added in order to monitor changes in the audit policy configuration, log deletion and other failures in the log subsystem. For event 4719, a human readable description was added in order to know which setting was modified (winlog.event_data.SubCategory) and to which value (winlog.event_data.AuditPolicyChangesDescription). Distribution Groups (Security-Disabled) Management Events were added. Those events are processed in the same way and with the same function that Security Groups (#14299). In order to add information about the nature of the group being managed the type (Security-Disabled/Security-Enabled) and scope (Local,Global,Universal) where added as winlog.group.type and winlog.group.scope. ComputerObject Management events were also added. Changes to ECS mappings In elastic/ecs#678 and elastic/ecs#589 we have been discussing how n-ary relationship between users in an event should be named and mapping into ECS. In #13530 winlog.event_data.TargetUserName has been mapped to user.name but from the reasons exposed in elastic/ecs#678 and elastic/ecs#589 the mapping winlog.event_data.SubjectUserName -> user.name is more appropriate. This mapping was changed. Also, with the adding of related fields in ECS 1.3 and specifically the related.user field (elastic/ecs#694) all the user names appearing in one event were mapped to the related user events. Every time a SubjectUserName or TargetUserName is copied also is added to the related.user field, as well as other users appearing in the event. Event test data were added for all events with the exception of event 1108 which I was not able to reproduce. Co-authored-by: Lee Hinman <57081003+leehinman@users.noreply.github.com> Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
…module (elastic#15217) Added Audit and Log Management related events, Computer Object Management Events, Distribution Groups Events. Changed user.name field for user management events and related.user mapping. New Events Due to that Windows events are the source of information for Winlogbeat the events 1100, 1102, 1104, 1105, 1108 and 4719 has been added in order to monitor changes in the audit policy configuration, log deletion and other failures in the log subsystem. For event 4719, a human readable description was added in order to know which setting was modified (winlog.event_data.SubCategory) and to which value (winlog.event_data.AuditPolicyChangesDescription). Distribution Groups (Security-Disabled) Management Events were added. Those events are processed in the same way and with the same function that Security Groups (elastic#14299). In order to add information about the nature of the group being managed the type (Security-Disabled/Security-Enabled) and scope (Local,Global,Universal) where added as winlog.group.type and winlog.group.scope. ComputerObject Management events were also added. Changes to ECS mappings In elastic/ecs#678 and elastic/ecs#589 we have been discussing how n-ary relationship between users in an event should be named and mapping into ECS. In elastic#13530 winlog.event_data.TargetUserName has been mapped to user.name but from the reasons exposed in elastic/ecs#678 and elastic/ecs#589 the mapping winlog.event_data.SubjectUserName -> user.name is more appropriate. This mapping was changed. Also, with the adding of related fields in ECS 1.3 and specifically the related.user field (elastic/ecs#694) all the user names appearing in one event were mapped to the related user events. Every time a SubjectUserName or TargetUserName is copied also is added to the related.user field, as well as other users appearing in the event. Event test data were added for all events with the exception of event 1108 which I was not able to reproduce. Co-authored-by: Lee Hinman <57081003+leehinman@users.noreply.github.com> Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co> (cherry picked from commit e624aef)
…ent Events - ECS related.user field mapping (#17090) Added Audit and Log Management related events, Computer Object Management Events, Distribution Groups Events. Changed user.name field for user management events and related.user mapping. New Events Due to that Windows events are the source of information for Winlogbeat the events 1100, 1102, 1104, 1105, 1108 and 4719 has been added in order to monitor changes in the audit policy configuration, log deletion and other failures in the log subsystem. For event 4719, a human readable description was added in order to know which setting was modified (winlog.event_data.SubCategory) and to which value (winlog.event_data.AuditPolicyChangesDescription). Distribution Groups (Security-Disabled) Management Events were added. Those events are processed in the same way and with the same function that Security Groups (#14299). In order to add information about the nature of the group being managed the type (Security-Disabled/Security-Enabled) and scope (Local,Global,Universal) where added as winlog.group.type and winlog.group.scope. ComputerObject Management events were also added. Changes to ECS mappings In elastic/ecs#678 and elastic/ecs#589 we have been discussing how n-ary relationship between users in an event should be named and mapping into ECS. In #13530 winlog.event_data.TargetUserName has been mapped to user.name but from the reasons exposed in elastic/ecs#678 and elastic/ecs#589 the mapping winlog.event_data.SubjectUserName -> user.name is more appropriate. This mapping was changed. Also, with the adding of related fields in ECS 1.3 and specifically the related.user field (elastic/ecs#694) all the user names appearing in one event were mapped to the related user events. Every time a SubjectUserName or TargetUserName is copied also is added to the related.user field, as well as other users appearing in the event. Event test data were added for all events with the exception of event 1108 which I was not able to reproduce. Co-authored-by: Lee Hinman <57081003+leehinman@users.noreply.github.com> Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co> Co-authored-by: Anabella Cristaldi <33020901+janniten@users.noreply.github.com> (cherry picked from commit e624aef)
We need to flesh out support for multiple users in an event to ECS, when there is a semantic relationship between them. Here are some use cases (please comment if you see additional use cases):
This has been discussed a bit in the past in #234 , but no concrete plans were made at the time.
ECS currently supports
source.user
anddestination.user
, which may be enough to satisfy the requirements for no 2 above. However sincesource
anddestination
are both designed to represent each side of a network connection, the semantics may be problematic when trying to usesource.user
anddestination.user
for no 1 and 3, as these can be purely local events.Questions
Has anyone used
source.user
anddestination.user
in ECS to model these use cases? If so, did this work well, and are there edge cases where it doesn't work as well?Should we try to model all cases with one naming recommendation for all use cases? As an example, should we always use
user
&affected.user
. Or should we adjust the naming depending on semantics? E.g. 1)user
&affected.user
, 2)source.user
&destination.user
, and a different way for 3).Points to consider
user
as the user initiating the action in an event, rather than nesting both sides. This way searching foruser.name:bob
would return any events where "bob" was doing something. Searching for events affecting "bob" would require searching for the more qualified field name, like e.g.affected.user.name:bob
. Pivoting to find anything related to "bob" can somewhat be done in Kibana by searching for*.name:bob
(not supported via the ES API), or could be done by populatingrelated.user.name
systematically in all sources, then searching forrelated.user.name:bob
.Naming ideas
Please comment with additional naming ideas.
user
&affected.user
user
&target.user
subject.user
&target.user
(like Windows)user
&assumed.user
(privilege escalation)The text was updated successfully, but these errors were encountered: