Content 3
Content 3
strategies in QRadar
Mar 2022
The agenda
2 IBM Security
The basics
/store/ariel/[db]/[db_specific_structure1]/…/[year]/[month]/[day]/[hour]/
file1
file2
…
fileN
PostgreSQL – Contains configuration data, meta data and some security artifacts
such as Offenses, Assets, Vulnerabilities, Reference Data etc.
3 IBM Security
The basics - Core QRadar architecture at 10K feet
4 IBM Security
How Ariel works
Ariel limits –
6 IBM Security
Search basics
Ways to search:
▪ Classic UI
▪ Basic search – visual query building
▪ Advanced Search – using Ariel Query Language (AQL)
▪ Quick Filter
▪ REST API (AQL)
▪ New search experience – Analyst Workflow application (Visual + AQL builder)
▪ /opt/qradar/bin/ariel_query (REST API/AQL based CLI)
7 IBM Security
AQL
Most ingested data is held within two Ariel tables: events and flows.
AQL allows users to structure queries to pull data from a database table, then
manipulate the data as required to customize to the desired format.
10
10 IBM Security
AQL
[SELECT *, column_name1, column_name2, … , column_nameN]
[FROM table_name]
[WHERE condition clauses]
[GROUP BY column_reference*]
[HAVING condition clause]
[ORDER BY column_reference*]
[LIMIT numeric_value]
[PARAMETERS list]
[TIMEFRAME]
NOTES:
- Mandatory operators are in red, everything else is optional.
- By default, advanced searches without a timeframe executed from the UI query
against the last 5 minutes of Ariel data, while from the API query the last 1 minute.
11 IBM Security
AQL
What fields are available in AQL?
Documentation - https://www.ibm.com/docs/en/qsip/7.4?topic=language-event-flow-
simarc-fields-aql-queries
API - GET - /ariel/databases/{database_name}
UI – Ctrl + spacebar
12 IBM Security
Simple examples
SELECT LOGSOURCETYPENAME(devicetype)lstn,COUNT() c
FROM events
GROUP BY devicetype ORDER BY c DESC LIMIT 5
14 IBM Security
Simple examples
• What are the top log source types sending over 10000 events?
15 IBM Security
AQL – Quotation mark usage
Quotation mark usage is a common question for new users as they develop their own
queries in QRadar and a common source of errors. Here is what you need to know.
Single-quotes
Use single-quotes characters to specify literal values or variable characters.
This includes:
Double-quotes
Use double-quotes characters around column names that contain spaces or non-ASCII
characters. For AQL, this includes:
17 IBM Security
Finding what you are looking for
18 IBM Security
Simple analytics
19 IBM Security
Advanced analytics
21 IBM Security
Data enrichment
22 IBM Security
Full text search, pattern matching etc.
Ways to search:
• Payload/Property contains / matches / LIKE / MATCHES
• Quick Filter
23 IBM Security
Full text search, pattern matching etc.
24 IBM Security
Advanced Search topics – Quick Filter
▪ Is Quick Filter aware of the normalized event properties in QRadar like Source IP?
▪ No, Quick Filter operates on the index built from the raw payload and is not aware
of the normalized QRadar fields which are extracted and set by DSMs in QRadar.
25 IBM Security
Advanced Search topics – Quick Filter
Text is split using whitespace and punctuation as delimiters, “meaningless” words &
delimiters are dropped, tokens are indexed
̶ Example 1:
• Message: Hello world, I am a string!
• Tokens: am hello i string world
• Not tokenized: , ! a
̶ Example 2:
• Message: abc=blah|url=https://www4.dot.com|user=root
• Tokens: abc blah https root url user www4.dot.com
• Not tokenized: = | : //
̶ Example 3:
• Message: Sep 1 11:27:49 152.7.19.18 sshd(pam_unix)[11467]: authentication failure;
logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=1.2.3.13 user=root
• Tokens: 0 1 1.2.3.13 11 11467 152.7.19.18 27 49 authentication euid failure logname
nodevssh pam rhost root ruser sep sshd tty uid unix user
• Not tokenized: : ( ) [ ] ; : =
26 IBM Security
Advanced Search topics – Quick Filter
Boolean logic
• a b – search for messages that contain either a or b
• a AND b – search for messages that contain both a and b
• NOT a AND (b OR c) - search for messages that do not contain a and contain b or c
Wildcards
• b?t - search for messages with words of exactly 3 letters, starting with b and ending with t. Example -
bat, bot etc
• b??t - search for messages with words of exactly 4 letters, starting with b and ending with t. Example -
boat, boot etc
• b*t – search for messages with words of any length, starting with b and ending with t. Example - bat,
bot etc
• *axe* - search for messages with words of any length that contain axe
Regex
• /[br]oot/ - search for messages with words of exactly 4 letters, starting with either b or r
• /(b|r)oot/ - search for messages with words of exactly 4 letters, starting with either b or r
• /hack{2}/ - search for messages where the word hack appears exactly twice
• /hack{2,}/ - search for messages where the word hack appears at least twice
• /.*\.doc/ - search for messages containing .doc
Proximity
• “user hacker”~2 - search for messages with words user and hacker at most two words apart
27 IBM Security
Advanced Search topics – Quick Filter
28 IBM Security
Advanced Search topics – Quick Filter
Search tips:
• Loosen the search criteria to find things
• Use as strict criteria as possible for best performance when possible
Example 1:
Log message = 1.2.3.4:/john_big_admin/1.pdf
Quick Filter 1 = “john_big_admin”. Log not found!
Quick Filter 2 = /.*john_big_admin.*/. Log not found!
Quick Filter 3 = john AND big AND admin. Log not found!
Quick Filter 4 = *john* AND *big* AND *admin*. Log found!
Optimal Quick Filter – admin* AND john AND big → But not too important for
performance as long as a wildcard/prefix query is already used, i.e. admin* AND
john* AND big* is expected to perform similarly
29 IBM Security
Advanced Search topics
30 IBM Security
Search performance best practices
Use Case: Find all users that interacted with “spam.ru” domain in the past month
32 IBM Security
Search performance investigation real-world example
Case 1 – Top log source by EPS (Pulse default widget)
33 IBM Security
Search performance investigation real-world example
Solution 1 – Use QRadar default aggregated data view
34 IBM Security
Search performance investigation real-world example
Case 2 – Average event rate (EPS) (Pulse default widget)
35 IBM Security
Search performance investigation real-world example
Case 2 – Average event rate (EPS) (Pulse default widget)
36 IBM Security
Search performance investigation real-world example
Solution 2 – Used an indexed criteria, provide and explicit timeframe for the inner
query, fix the sort order
37 IBM Security
Search performance investigation real-world example
Solution 2 – Used an indexed criteria, provide and explicit timeframe for the inner
query, fix the sort order
38 IBM Security
Conclusion
39 IBM Security
References:
• Searching Events and Flows in QRadar
• Ariel Query Language
• Searching Your QRadar Data Efficiently: Part 2 - Leveraging Indexed Values
• QRadar Quick Filter search options
• QRadar Pulse app
• QRadar Deployment Intelligence app
40 IBM Security
THANK YOU
FOLLOW US ON:
ibm.com/security
securityintelligence.com
xforce.ibmcloud.com
@ibmsecurity
youtube/user/ibmsecuritysolutions
© Copyright IBM Corporation 2016. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind,
express or implied. Any statement of direction represents IBM's current intent, is subject to change or withdrawal, and represent only goals and objectives. IBM, the IBM logo, and other IBM products
and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service
marks of others.
Statement of Good Security Practices: IT system security involves protecting systems and information through prevention, detection and response to improper access from within and outside your
enterprise. Improper access can result in information being altered, destroyed, misappropriated or misused or can result in damage to or misuse of your systems, including for use in attacks on others.
No IT system or product should be considered completely secure and no single product, service or security measure can be completely effective in preventing improper use or access. IBM systems,
products and services are designed to be part of a lawful, comprehensive security approach, which will necessarily involve additional operational procedures, and may require other systems, products
or services to be most effective. IBM does not warrant that any systems, products or services are immune from, or will make your enterprise immune from, the malicious or illegal conduct of any party.
BACKUP
42 IBM Security
How Ariel works – high level
43 IBM Security
How Ariel works – lower level
44 IBM Security
How Ariel works – lowest level
45 IBM Security
Bonus – Qradar search performance retrospective
Searching
1 TB of data
in less than
1 second
on
1 xx28
With LazySearch
all searches using
filters over
indexed properties
perform like
needle-in-a-
haystack!
Needle in haystack search, returning 100’s of results
46 IBM Security