This App provides filtering logic (whitelisting) for events in Splunk. It has been originally
developped to migrate from Alert Manager Suppression rule (https://github.com/alertmanager/alert_manager) to Splunk Enterprise Security and not losing the whitelisting work that has been done previously, but you can use Event Masker on every dashboard or query in Splunk search bar.
Event Masker consists in multiple components:
For documentation, see https://github.com/scrt/event_masker
We also published articles about Event Masker and its features on our blog, see https://blog.scrt.ch/category/analytics-2/
Install this app into Splunk Searh Head (standalone) by doing the following:
When update this app, please restart Splunk. Some time, you need to refresh Splunk cache (https://<your_splunk_url>/en-US/_bump)
Once the app is installed, you can open "Event Masker" app from the main launcher. You need to create at least 1 rule to use it.
Once the masking rule has been created, just add the following command at the very end of the Splunk Savedsearch/Correlation search. Transforming command must be used at the left of this command.
index=<index> | table <field1>, <field2> | mask scope=<the_scope_of_the_created_masking_rule>
If you have set startDate and endDate fields, you must set timefield option. You should write the name of your time field with the format %Y-%m-%d %H:%M:%S.%f.
Example :
index=<index> | table <field1>, <field2>, _time_ | eval _time=strftime(_time,"%Y-%m-%d %H:%M:%S.%f") |mask scope=<the_scope_of_the_created_masking_rule> timefield="_time"
The search will be launched and if everything is correct, the events that were to be masking should not appear in the set of results.
To check that the masking rule and the search have been correctly implemented, go to the Event Masker Logs
dashboard.
You have to know : If conditions, validity perriod or error occurs, Event Masker return splunk search without modification.
By default, you need to be Splunk Admin (admin
group) or Enterprise Security Admin (ess_admin
group) to see Event Masker and make modifications on rules. To give read-only capabilities to a specific user, you have to add it in Enterprise Security Analyst or User groups (ess_analyst
or ess_user
).
To ensure that application logging works as expected, the groups mentioned previously (admin
and ess_admin
) needs to have the right to write in _internal index. This capability will provide logs regarding modifications made by users on Event Masker rules.
In Event Masker Rules list (default page):
Add rule need at least title and scope
Renaming a rule has no impact in mask command
To use multiple rule as the same time, you can use the same scope as another rule and use it in mask command
AND rule need at least 2 conditions
To edit a rule, click on title field
"Start Date" and "End date" are available to filter your events with a specific timerange. You must use timefield option to do that. If you not set these fields, your rule will mask events all the time.
* Import file must have the following JSON format :
[
{
"title": "rule1",
"description": "description1",
"type": "normal",
"match_type": "any",
"scope": "scope1",
"comment": "comment1",
"startDate": "2021-04-01T16:00",
"endDate": "2021-07-14T15:59",
"modificationDate": "2021-04-30T15:57",
"modificationUser": "admin",
"creationDate": "2021-04-30T15:56",
"disabled": false,
"creationUser": "admin",
"conditions": [
{
"field": "condition1",
"operator": "is",
"value": "value1",
"iscasesensitive": true,
"comment": "My comment on my condition"
}
]
},
{
"title": "rule2",
"description": "description2",
"type": "normal",
"match_type": "all",
"scope": "scope2",
"comment": "comment2",
"startDate": "",
"endDate": "",
"modificationDate": "2021-04-30T15:58",
"modificationUser": "admin",
"creationDate": "2021-04-30T15:58",
"disabled": false,
"creationUser": "admin",
"conditions": [
{
"field": "condition2",
"operator": "ends with",
"value": "value2",
"iscasesensitive": false,
"comment": "My comment on my condition"
},
{
"field": "condition2",
"operator": "starts with",
"value": "value2",
"iscasesensitive": false,
"comment": "My comment on my condition"
}
]
}
]
Do not forget that fields title, scope and match_type are mandatory (and conditions, of course)
In Event Masker rule editor (edit conditions):
Right click on the table displays a context menu that enables you to add/delete a row or copy/paste data. You can also save as CSV the table and order data by headers.
Values can be copied from splunk search result and pasted in the table bellow. This add row automatically.
Use "fieldname" (without quotes) to refer to a field from results
By default, values are case insensitive
Do not forget : All of the conditions must be true for a valid application. Make sure it works by testing your rules (for example : search * | table myfield | mask scope="rule scope")
Splunk multi-value (MV) field are supported by Event Masker but at this time, masking rule hide the whole line when conditions are matched.
It is possible that importing and exporting takes time and freeze the browser. This will be patched in a future version but for now, take the opportunity to have a coffee :coffee:
Go to the following website if you need support:
http://answers.splunk.com/
You can access to the source-code and get technical details about the app at:
https://github.com/scrt/event_masker/
Feel free to create issues and/or pull requests on the repo !
Many thanks to:
This project use external lib under MIT Licence to works :
DataTables and Select/Buttons extensions
Jexcel (Jspreadsheet CE)
Jsuites
Text.js
Thanks to the developers of these libs.
This project is protected by CC BY-NC 4.0.
Bug fix :
- Fix rule list sort
- Fix text area override when resizing browser windows.
- Fix empty form in some case on whitelist specific event
- Fix quote removed on whitelist notable
- Fix wrong rule conditions in logs
- Fix log rotation
- Fix Copy paste in EventMasker form
- Fix multi value issue
- Fix and update panels in Event Masker Overview
- Fix and update panels in Audit dashboard logs
- Fix and update panels in Event Masker logs
Update :
- Update external lib
- Add compatibility with SearchHead Cluster
New features :
Enhancements :
Bugfix :
As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.