Getting Data In

Blacklisting DNS queries with nullQueue

geoffmx
Explorer

I am attempting to blacklist DNS queries using nullQueue.

props.conf

# Blacklist domains
[msad:nt6:dns]
TRANSFORMS-blacklistdomain01 = bl_subdom_domain01_com
TRANSFORMS-blacklistdomain02 = bl_domain02_com

transforms.conf

[bl_subdom_domain01_com]
REGEX=query=subdom.domain01.com
DEST_KEY=queue
FORMAT=nullQueue

[bl_domain02_com]
REGEX=query=domain02.com
DEST_KEY=queue
FORMAT=nullQueue

This does not work! Is there something wrong with the syntax I've used?

0 Karma

jeremyhagand61
Communicator

Since you are dropping the file before indexing, your regex needs to match the syntax of the raw event data, not the formatted data.

So if your domain you want to drop is company.com, this will look something like this in the logs:

(3)company(2)com(0)

So you may want to have a regex like this:

\(\d\)company\(\d\)com
0 Karma

geoffmx
Explorer

None of this works, unfortunately. I wonder if I am editing the .conf files in the correct location.

In the splunk etc directory, there are two folders for DNS:

$SPLUNK_HOME/etc/apps/TA-DNSServer-NT6/local, and
$SPLUNK_HOME/etc/deployment-apps/Splunk_TA_microsoft_dns/local

Is there a way to determine the right app directory for a given sourcetype?

0 Karma

nick405060
Motivator

etc/deployment-apps is only for apps that you are pushing out to ufs from a deployment server

so you need to be doing this in the etc/apps directory on your indexer or search head; for your question specifically that's indexer

the directory inside of /etc/apps doesn't matter as much, as long as it's in a local directory, since it's a configuration hierarchy (see btool)

0 Karma

vinod94
Contributor

dyude @geoffmx ,

Can you try this,

props.conf

[msad:nt6:dns]
TRANSFORMS-set= domain1,domain2

transforms.conf

[domain1]
REGEX = query\=subdom\.domain01\.com
DEST_KEY = queue
FORMAT = nullQueue

[domain2]
REGEX = query\=domain02\.com
DEST_KEY = queue
FORMAT = nullQueue

Llet me know if it works for you!

0 Karma

geoffmx
Explorer

I'm not having any luck with this. The nullQueue method did not work. I've even tried blacklisting the domain in inputs.conf

[MSAD:NT6:DNS]
disabled=false
index=msad
blacklist1 = query="domain01\.com"

Escaping the [.] character does not seem to have any effect.

0 Karma

nick405060
Motivator

Is your sourcetype of msad:nt6:dns correct in props?

Here is what I set up yesterday:

me@local$ cat props.conf
[WebViewIIS]
TRANSFORMS-set = setnull_webview,setparsing_webview
me@local$ cat transforms.conf
[setnull_webview]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing_webview]
REGEX = (?i)mycompany-domain
DEST_KEY = queue
FORMAT = indexQueue
0 Karma

geoffmx
Explorer
0 Karma

jaime_ramirez
Communicator

Hi

You must escape the [.] character:

[bl_subdom_domain01_com]
REGEX= query=subdom\.domain01\.com
DEST_KEY=queue
FORMAT=nullQueue

[bl_domain02_com]
REGEX= query=domain02\.com
DEST_KEY=queue
FORMAT=nullQueue

Hope it helps

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...