Splunk Enterprise

Filter user's searchable events by event field value

GindiKhangura
Explorer

I am looking for a way to filter the events that a user can see based on the values of the event. For example, if there are events with the field 'building' and the field has values 'a' through 'z', I would want user 1 to only be able to retrieve events where the building is of a value 'a' though 'g', and user 2 could be given access to events where the building values are 'f' though 'p'.

I have looked into using roles to apply filters, but those are limited to indexed fields and I will have dozens of fields in my events that will need this type of filtering, so it is not a good option.

Additionally, the filtering should be secure so that there is no way for users to bypass that filtering.

Any ideas?

Labels (2)
0 Karma
1 Solution

Chef
Explorer

Search filters by role aren't actually limited to indexed fields, you can do this type of restriction at search-time. An idea I would have is to make an eventtype for each user/field filter.

E.g. eventtype=user_1_building_filter 

index=buildings building IN ("a","b","c") ... etc

eventtype=user_2_building_filter

index=buildings building IN ("f","g","h") ... etc

 

And then you could add these event types into the search filter for each of these user roles.

This way you can make your conditions for each field as an eventtype and it will be quite easy to read in the search filter:

eventtype=user_1_building_filter OR eventtype=user_1_other_filter

 

View solution in original post

0 Karma

Chef
Explorer

Search filters by role aren't actually limited to indexed fields, you can do this type of restriction at search-time. An idea I would have is to make an eventtype for each user/field filter.

E.g. eventtype=user_1_building_filter 

index=buildings building IN ("a","b","c") ... etc

eventtype=user_2_building_filter

index=buildings building IN ("f","g","h") ... etc

 

And then you could add these event types into the search filter for each of these user roles.

This way you can make your conditions for each field as an eventtype and it will be quite easy to read in the search filter:

eventtype=user_1_building_filter OR eventtype=user_1_other_filter

 

0 Karma

GindiKhangura
Explorer

I have not yet found a better solution than what @Chef has shared, so I will mark it as the accepted solution.

Thank you.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti 🎉 —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...