public class SensitiveDataValidator
extends java.lang.Object
The data from all collectors is validated before it's recorded locally.
It's necessary to make sure that the data is correct and it doesn't contain personal or proprietary information.
Validation is performed right before logging in guaranteeCorrectEventId(EventLogGroup, EventContext)
and guaranteeCorrectEventData(EventLogGroup, EventContext)
.
Therefore, each collector should define data scheme and rules which will be used in validation.
Rules are stored in a separate repository, IDE loads rules from the server during runtime.
To register rules for a new group or change existing ones, create an issue.
There are 3 types of rules:
EnumWhiteListRule
RegexpWhiteListRule
CustomWhiteListRule
and validates dynamic data like action id or file type, e.g.
"{util#class_name}" checks that the value is a class name from platform, JB plugin or a plugin from JB plugin repository.ClassNameRuleValidator
There is also a list of common event data fields which doesn't require validation
because they are always validated in FeatureUsageData
, e.g. "plugin", "lang", etc.
Example:
ActionsCollectorImpl
).{ "event_id" : [ "{enum:action.invoked|custom.action.invoked}" ], "event_data" : { "action_id" : [ "{util#action}" ], "class" : [ "{util#class_name}" ], "context_menu" : [ "{enum#boolean}" ], "current_file" : [ "{util#current_file}" ], "input_event" : [ "{util#shortcut}" ], "place" : [ "{util#place}" ], "plugin" : [ "{util#plugin}" ], "plugin_type" : [ "{util#plugin_type}" ] } }
FileTypeUsagesCollector
).{ "event_id" : ["{enum:file.in.project}" ], "event_data" : { "file_type" : [ "{util#file_type}" ] } }
Modifier and Type | Field and Description |
---|---|
protected WhitelistGroupRulesStorage |
myWhiteListStorage |
Modifier | Constructor and Description |
---|---|
protected |
SensitiveDataValidator(WhitelistGroupRulesStorage storage) |
Modifier and Type | Method and Description |
---|---|
static SensitiveDataValidator |
getIfInitialized(java.lang.String recorderId) |
static SensitiveDataValidator |
getInstance(java.lang.String recorderId) |
WhitelistGroupRulesStorage |
getWhiteListStorage() |
java.util.Map<java.lang.String,java.lang.Object> |
guaranteeCorrectEventData(EventLogGroup group,
EventContext context) |
java.lang.String |
guaranteeCorrectEventId(EventLogGroup group,
EventContext context) |
void |
update() |
ValidationResultType |
validateEvent(EventLogGroup group,
EventContext context) |
protected SensitiveDataValidator(WhitelistGroupRulesStorage storage)
public static SensitiveDataValidator getInstance(java.lang.String recorderId)
public static SensitiveDataValidator getIfInitialized(java.lang.String recorderId)
public WhitelistGroupRulesStorage getWhiteListStorage()
public java.lang.String guaranteeCorrectEventId(EventLogGroup group, EventContext context)
public java.util.Map<java.lang.String,java.lang.Object> guaranteeCorrectEventData(EventLogGroup group, EventContext context)
public ValidationResultType validateEvent(EventLogGroup group, EventContext context)
public void update()