Multiple Criteria Sensor
Looking into DataSiren today and was noticed how many of the current email fields in the audit results clearly aren't emails. At first look it looks like @m_walker has already created all the components to do this better but It's not clear to me how I would go about combining them.
For an effective sensor for email addresses we'd want to look for the intersection of columns
- with names like '%email% (
find_columns_with_names_like
) - that are strings (
get_columns_by_type
) - with values matching something like
^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$
(search_sample_columns_samples_for_pattern
)
What I can't figure out is how I am supposed to combine these in a sensor without departing from what I am seeing in the code today. Would I create another template combining these and then a sensor to run that template? That doesn't seem like a great pattern.
Is there an good way to do this today?