I’m trying to write a rule that checks the value of the “network.dns.questions.name” field, but will only trigger if the value is NOT in a data table using regex matching instead of a static value.
Assuming I have a data table named dns_tunnel_list with below values:
domain_names <« column header
example.invalid
does-not-exist.example.com
googleapis.com
metadata.google.internal
I cannot seem to get right a UDM search query that will ignore values from the above table with a query like below, for example:
metadata.log_type = "GCP_DNS"
metadata.event_type = "NETWORK_DNS"
not network.dns.questions.name in regex %dns_tunnel_list.domain_names
Similarly, for a rule such as below:
rule LOG_SECOPS_005_dns_newly_seen_domain_v2 {
meta:
(snip)
version = "1.0"
events:
$dns.metadata.log_type = "GCP_DNS"
$dns.metadata.event_type = "NETWORK_DNS"
$querying_ip = $dns.principal.ip
$query_name = $dns.network.dns.questions.name
not $query_name in regex %dns_tunnel_list.domain_names
match:
$querying_ip over 1h
condition:
$dns
}
Please, can I get some help.
thanks.

