在Splunk中对数据进行脱敏
在我的很多客户都问过,如何在Splunk中对数据进行脱敏。通常这么做的目的是为了保护个人隐私信息或者符合安全法规的要求。在这篇博客中,我们会讨论在Splunk中对数据进行脱敏的一些方法。 在这篇博客中,我们所有操作都基于以下数据来实现: sourcetype=vendor_sales sample_log: [15/Dec/2016:07:36:56] VendorID=5069 Code=A AcctID=4397877757846973 [15/Dec/2016:07:21:15] VendorID=3108 Code=M AcctID=6347267702474393 其中我们需要将AcctID的前12为隐藏起来,只保留最后4位置 Splunk可以在index phase的时候使用SEDCMD对数据进行脱敏,基于以上实验数据,我们可以用以下配置来实现: props.conf [vendor_sales] SEDCMD-lacct = s/AcctID=\d{12}(\d{4})/AcctID=xxxxxxxxxxxx\1/g 这样Splunk在index数据之前会对AcctID进行脱敏,脱敏后的结果为: sample_log-Masked: [15/Dec/2016:07:36:56] VendorID=5069 Code=A AcctID=xxxxxxxxxxxx6973 [15/Dec/2016:07:21:15] VendorID=3108 Code=M AcctID=xxxxxxxxxxxx4393 TRANSFORMS 在Splunk中同时可以通过transform来实现: 在props.conf中定义transform: props.conf [vendor_sales] TRANSFORMS-anonymize = AcctID-anonymizer 同时在transforms.conf文件中定义脱敏的正则: transforms.conf [AcctID-anonymizer] REGEX = (?m)^(.*)AcctID=\d{12}+(\d{4}.*)$ FORMAT…
Continue reading...
