Threat hunting with Hunt and OQL in Security Onion

Hunt and OQL let analysts search network and host events for behavior that no alert caught yet, then pivot to packets, cases and detections. This page explains how to plan and run those hunts.

On this page

When Hunt and OQL threat hunting in Security Onion fits your SOC

Alerts only fire on activity someone has already written a rule for, so a SOC that relies on alerts alone has no systematic way to find intrusions that match no signature. Hunting closes that gap by searching event data for behavior that looks wrong, even when no alert exists. In Security Onion, that work happens in Hunt, a view of the Security Onion Console where analysts query the stored network and host data using Onion Query Language (OQL). The data available to those queries comes from the components named in the platform: Suricata, Zeek and Elastic Fleet agents. If your team cannot yet say which of those sources cover your critical segments and endpoints, confirm that coverage before you write any hunt, because a hunt can only find what was collected.

Build hunting capability in-house when you have analysts who already know your network and can turn a question such as "which hosts resolved a rare domain and then sent large outbound transfers" into a repeatable query. Hunting also needs time that is not spent on alert queues, so confirm that your staffing allows protected hunt blocks. The work recurs: each hunt is a hypothesis that may be repeated, refined or retired, and successful hunts should become detections that your team maintains. Ask whether analysts can explain their queries to the next shift and whether findings are documented in a way that survives staff changes.

Consider a partner when the hunting gap is wider than query skill, for example when the grid is new, when sensors and search nodes are still being sized, or when a regulator or customer expects evidence of a hunting program that your team cannot yet produce. A partner can design the first hunt library, check that data sources are collected as intended, and train analysts on OQL. Before engaging anyone, ask for a written scope that names the sources to be covered, the hunts to be delivered, the handover method and who keeps the detections running after the engagement ends.

A hunt moves from question to detection in five hand-offs

The diagram starts with a scoped question and an OQL query run in Hunt, then follows the results through grouping and sorting, a pivot to PCAP or a case, and a decision point. A hunt that produces a repeatable signal moves into the Detections interface, where the analyst tunes it as a NIDS, Sigma or YARA rule. Check at each hand-off that the evidence still points to the same activity, because a pivot can change the question.

Hunt phases from scoped query to a tuned detection or documented close.

How OQL queries, grouping and sankey views work together

The OQL query decides which events enter the hunt, and the grouping, sorting and sankey views decide what you notice in them. Start with a narrow filter that describes the behavior you suspect, such as outbound connections to rarely seen destinations or a process name that appears only on a few hosts. A broad query returns volume you cannot reason about, while a precise one gives you a population small enough to compare. Treat the query as a hypothesis you can state in one sentence, and write it so a colleague could rerun it and get the same result.

Grouping turns the filtered population into counts, which is where outliers and rare values stand out. Group by a field such as a destination address, user, or event category, then sort so the smallest buckets appear first. A value that appears on one host or in one hour is often more useful than the most common value, because routine traffic fills the top of the list. Before you act on a rare value, check whether it is a single sensor artifact or a repeated pattern. Sankey views answer a different question: how fields relate. Choose a source, a destination and a protocol, and the flow diagram shows which sources talk to which destinations over which protocols. Look for a single source fanning out to many destinations, or an unusual protocol carrying traffic between normal endpoints.

Confirm exact field names, grouping limits and sankey field options against the Security Onion documentation for your installed version, because these change between releases and between the 2.x and 3.x lines. The same hunt can return different field names after an upgrade, so record the query text and the version alongside your findings. Keep the sankey view for relationship questions and use the grouped table for counts, then pivot from any interesting value into PCAP or a case so the evidence chain stays intact.

Which hunt approach fits which question

Use an exploratory hunt when you suspect something is wrong but cannot yet name it, such as unusual outbound traffic from a segment or a spike in failed logons. The data is the live grid: Suricata alerts, Zeek logs and Elastic Agent events already indexed on your manager and search nodes. Analyst time is front-loaded, because the first hours go to learning which fields and groupings reveal normal behavior. The output is a short list of anomalies worth a hypothesis, not a verdict.

  • Data needed: Several days of indexed network and endpoint events on the search nodes, with time ranges wide enough to show a baseline.
  • Analyst time: High early effort for grouping, sorting and sankey views, then a narrowing phase once a pattern stands out.
  • Output: A written list of candidate patterns, each with the query that produced it and the reason it was kept or dropped.
  • Watch for: Hunts with no stated question tend to end with no finding and no record of what was ruled out.

Confirm with your team how far back the grid retains indexed data, because the exploratory baseline is only as long as that retention.

Hunt configuration choices and when each fits

This table compares the main configuration choices for an OQL hunt: how you scope the time range and data source, whether you group or read raw events, which view you pivot through, and where a finished hunt goes. Read each row for the condition that favors it and the cost you accept, such as noise versus coverage. Confirm exact Hunt and sankey behavior in your installed version before you standardize on a method.

ChoiceWhen it fitsTrade-off to weigh
Narrow time range and single data sourceConfirming a specific indicator or an alert window already under investigationFast and low noise, but misses activity that happened outside the window or in other sources
Wide time range across all dataLooking for slow or patient activity, or scoping an incident with an unknown startBetter coverage, but results are larger, slower to review and easier to misread
Grouping by fieldsFinding outliers, rare values and common patterns across many eventsQuick to see the shape of the data, but individual events that matter can be hidden inside a group
Raw event reviewReading the exact fields, sequence and context of a small result setPrecise, but time-consuming and impractical for large result sets without a narrowing query first
Sankey viewFollowing how fields such as source, destination and protocol relate across many recordsGood for spotting unexpected connections, but flow totals can hide low-volume events
Tabular pivotChecking exact values, counts and timestamps before you act on a patternEasier to verify and share, but slower for seeing relationships across several fields
Save as a caseActivity needs analyst judgment, collaboration or a documented record of findingsPreserves context for the investigation, but does not by itself create reusable detection logic
Save as a detection candidateThe same query pattern is repeatable, specific and produces few false positives in your dataAutomates future matching, but requires tuning and review to avoid noise from benign activity
Pivot to PCAP for network contextPacket-level evidence would confirm or rule out a suspicion raised by a huntStrongest evidence for network events, but only covers traffic that was captured and retained

How to set up a hunting workflow on a Security Onion grid

This sequence takes a Security Onion deployment from confirmed data flow to a hunt that has been checked against known events, documented as a repeatable path, and carried into a detection. Each step ends with a check so the team knows it is ready for the next one.

  1. Confirm the deployment type and data flow

    Start by confirming which deployment type the grid runs. Security Onion offers Import, Evaluation, Standalone and Distributed types, and Distributed (a manager node, one or more sensor nodes and one or more search nodes) is the recommended design for production. The grid administrator checks that sensor and search data is arriving in the Console for each monitored segment. Confirm that the manager is healthy as well, because the architecture documentation notes that search nodes stop indexing when they cannot reach the manager's Redis service. Done means every sensor you expect shows events for the last few hours in the Console, with no gaps for a segment you know is busy.

  2. Grant analyst roles to hunters

    The grid administrator assigns hunters the analyst roles their work requires, and keeps write access for hunting and case actions limited to people who need it. Confirm with your own access policy which accounts may save searches, create cases and change detections, because those permissions shape what a hunter can do after a finding. Test each account by logging in and running a basic query, then opening an alert and a case. Done means every hunter can query and pivot in the Console, and the people who need to escalate can open and update cases.

  3. Agree a hypothesis library

    Before running queries, the team writes a short library of hunt hypotheses. Each entry states what behavior the hunt looks for, which data source should show it (Suricata, Zeek or Elastic Agent events), the fields involved, and what a benign explanation would look like. Include the owner and the date of the last review. The SOC lead signs off on the library so analysts start from the same questions. Done means each hypothesis has a named owner, a data source and a note on expected benign activity, and the library is stored where every hunter can edit it.

  4. Run the first hunt with OQL

    A hunter takes one hypothesis and writes an Onion Query Language search for it in the Hunt interface. Keep the first query narrow, using a time range and a single data source, and then use grouping and sorting to see which values dominate the results. Save the query and note the number of matching events and the fields used. Done means the query runs without errors, returns a result set the hunter can explain, and is saved with its hypothesis name so another analyst can rerun it.

  5. Verify results against known events

    Test the query against events you already understand before trusting it. Pick a known benign activity, such as a scheduled scan or a software update, and a known malicious sample or previous incident if one is available in your data. Confirm the query returns the known activity and that it does not miss the known bad case. If you loaded evidence with so-import-pcap or so-import-evtx, include it in this check. Done means the hunter can state the expected hits and misses for each test case, and the query has been adjusted to match.

  6. Pivot to PCAP and open a case

    When a result looks suspicious, the hunter pivots from the event to its related network traffic and, where available, to the full packet capture from Suricata. Note the timestamps, source and destination hosts, and the relevant sessions. Then open a case, add the events and captured traffic as evidence, and record the hunt's hypothesis and query in the case notes. Done means the case contains the query, the evidence and a short written conclusion, and a second analyst can follow the path from the hunt to the finding without asking the hunter.

  7. Record the path to a detection

    If the hunt finds activity worth monitoring continuously, the team decides whether to build a detection. The Detections interface manages NIDS rules loaded into Suricata, Sigma rules loaded into ElastAlert and YARA rules loaded into Strelka, and it supports tuning and suppression for NIDS rules. Record which rule type fits the finding, the query used, the expected false positives and the owner who will tune the rule. Test the rule against the same known events from the verification step before enabling it. Done means the detection is either deployed with its tuning notes or the hunt record states why no detection was created.

Turning a successful hunt into a Security Onion detection

A hunt becomes a detection only after you decide which engine should own the logic. Choose the rule type by what the evidence looks like. Network behavior that Suricata sees in traffic, such as a protocol pattern, a suspicious domain or a beacon signature, usually belongs in a NIDS rule loaded into Suricata. Log-based behavior, such as a sequence of authentication or process events, usually fits a Sigma rule loaded into ElastAlert. File content that you can match on bytes or strings belongs in a YARA rule loaded into Strelka. Confirm this mapping against the detection docs for your release before you write the rule, because the Console manages each type differently. Once the rule exists, the Console's Detections interface lets you modify NIDS rules, suppress them and apply threshold controls. Sigma rules take custom filters instead, so plan the tuning path for each rule type up front.

Before the rule reaches production, run it against benign traffic from your own environment. Use the period and sensors where the hunt found the activity, and count how many alerts the rule would have raised on normal business work such as software updates, backups, scanners and admin tools. Record the false positives, decide whether each one is a scoping problem or a condition that should be excluded, and retest after each change. Keep the hunt OQL query, the time range, the data sources and the results in the rule's rationale so a later analyst can see why the rule exists and what it was meant to catch. Treat that record as part of the detection, not an afterthought.

Rule content must be reviewed by the team that will own the alert before it is enabled. That team, usually the SOC or detection engineering group, should confirm severity, expected volume, triage steps, and which case template or playbook applies. If the owners cannot describe what a true positive looks like, the rule is not ready. Ask them to agree on a suppression policy and a review date, and confirm who may change thresholds later. The sibling guidance on alert triage and case templates covers the workflow after the alert fires, so use that as the next step once the owners have signed off.

Security and access considerations for hunting data

Hunting in Security Onion puts full packet capture, event data and case records in front of analysts, so access and audit decisions matter as much as the queries themselves. The cards below cover who can see what, how hunts and pivots are recorded, and what the platform reaches out to fetch during updates.

Separate analyst and limited analyst roles

Decide which people can run open-ended hunts across all indexed data and which can only work alerts and cases they are assigned. Hunt access reaches the same network metadata and packet data as the alert queue, so a role that can pivot to PCAP needs a clear reason. Review role assignments against your SOC roster and confirm how roles are set in the version you run.

Architecture docs

Treat packet capture as sensitive data

Full packet capture can contain credentials, session tokens, personal data and regulated records carried in cleartext or in files that Suricata reassembles. Restrict who can open PCAP pivots, decide how long captures are kept, and check that storage and backups follow the same classification as the systems they came from. Ask your data owners whether capture of certain segments should be excluded.

Log hunts and case pivots

A hunt that returns sensitive fields or leads to a packet download is an access event your investigators may need to explain later. Confirm which Security Onion and Elasticsearch audit records capture queries, pivots and case changes in your version, and forward them to your central logging. Test that an analyst's search history can be reconstructed during a review.

Control outbound connections during rule updates

Rule and software updates pull content from outside the grid, which conflicts with some network policies. Map each outbound destination used by the manager and update process, restrict it with firewall host groups, and confirm which content is delivered in the ISO for networks without internet access. Document the update source so a changed rule set can be traced to a known release.

Airgap docs

Confirm Pro identity and encryption options

Single sign-on through OIDC, LUKS encryption of data at rest, FIPS mode and an OS STIG profile are features of the paid Security Onion Pro edition, not the free distribution. Decide whether your environment requires them, then confirm current availability, terms and support with the vendor before you plan the design around them. Your identity and key management team should review the integration.

Security Onion Pro

Keep detection content under change control

Hunts that prove useful often become Sigma or Suridata rules, and those rules change what analysts see. Track who approves new detections, who can suppress or threshold them, and how changes are versioned and reviewed. A suppression added quietly during triage can hide the activity the hunt was meant to find.

Detections docs

Questions buyers ask about threat hunting in Security Onion

What drives the cost of building threat hunts in Security Onion?

The main driver is how much hunting logic you need to build and validate, not the query syntax itself. Cost rises with the number of data sources to normalize, the number of hypotheses to turn into repeatable hunts, the depth of pivoting into PCAP, cases and EVTX evidence, and the amount of testing needed before a hunt becomes a detection. Costs are split between one-time work (scoping, building the first hunt set, documenting the workflow and converting successful hunts into detections) and recurring work (reviewing hunts after upgrades, tuning noisy detections and training analysts). Security Onion Pro is a separate licensed product sold on 1 to 5 year terms, so ask any partner whether the quote includes or excludes that license. When you request a quote, ask for each phase, the roles doing the work, the data sources covered and the handover format.

How long does a first threat hunting program take to become useful?

No fixed duration can be given here, because it depends on your deployment type, data volume and how mature your analysts are with OQL. The first useful result usually depends on whether the grid is collecting the network and endpoint data your hypotheses need, so confirm that before anything else. Security Onion's Distributed deployment is the recommended production design, and standing it up is a prerequisite that adds its own time. Ask any partner to split the timeline into grid readiness, the first set of hypotheses run against live data, and the step where a hunt is promoted to a detection. Expect the first cycle to reveal gaps in logging, not only in hunts.

What does our team need to supply before hunting can start?

You need to supply three things: data sources, people and hypotheses. Data sources include the network sensors on your Security Onion grid and any endpoint or device logs you want to correlate, so confirm each source is onboarded and its fields are populated. People means analysts who know your environment, a named owner for detections and someone who can approve changes to production rules. Hypotheses are the questions you want answered, such as unusual remote administration tools or unexpected outbound connections, and they should be written down with the evidence that would confirm or reject them. Hardware must also meet the published minimums for each node role, which you should check in the hardware documentation before procurement.

Can an in-house team run threat hunts in Security Onion without a partner?

Yes, many teams do, provided they have analysts who can write OQL, interpret network and host data, and maintain the grid. Security Onion's Console, Hunt and detection tools are available to the team once the platform is installed and licensed as needed. A partner adds the most value when your team lacks hunting experience, needs a documented first program, or must prepare evidence for an assessment. Be honest with yourself about staffing: a hunt program needs recurring time for hypothesis work, not only a one-off build. If you proceed alone, schedule regular hunt reviews and keep a log of hypotheses, queries and outcomes so the work survives analyst turnover.

What does a fixed-scope threat hunting engagement cover?

A fixed-scope engagement covers the work listed in an agreed written scope, with deliverables and timelines set before work starts. For hunting in Security Onion, that typically means defining the hypotheses, confirming the data sources, building and testing the OQL hunts, documenting the pivot path to PCAP, cases and evidence imports, and converting any successful hunt into a detection that can be reviewed in the Detections interface. It does not include work outside the written scope, such as unrelated platform rebuilds, and DeployOpen does not issue audit reports or certifications. Ask for the scope as a list of hunts, data sources, environments, handover documents and the acceptance criteria used to close each item.

How do we turn a successful hunt into a detection we can keep?

Turn the hunt into a detection only after you have confirmed the logic is specific enough to avoid noise and that its false positives are understood. In Security Onion, detections are managed in the Console, where NIDS rules loaded into Suricata can be modified, suppressed or given threshold tuning, and Sigma rules loaded into ElastAlert can be filtered with custom filters. Record the hypothesis, the query, the expected fields, the tuning decisions and the owner in a single place so the detection can be reviewed after upgrades. Keep the hunt query and the detection separate so you can rerun the hunt against new data.

What should we ask for in a threat hunting quote?

Ask for a written scope that lists the hypotheses, the data sources in each environment and the number of hunts to be built and tested. Request a phase breakdown with the roles doing each part, the deliverables for each phase and the acceptance criteria used to close the work. Ask which costs are one-time and which recur, such as retainer work for hunt reviews, tuning and upgrades. Confirm whether the quote covers Security Onion Pro licensing, which is sold separately on 1 to 5 year terms, and whether any airgap or offline update work is included. Finally, ask how handover is done so your analysts can run the hunts without the partner.

Where to confirm Security Onion hunting details

Confirm every OQL field name, query operator and hunt workflow against the Security Onion version you actually run before you write a detection from it. Query syntax and field names change between releases, and the 3.x line is a different platform from 2.x in several respects, including the move from Stenographer to Suricata for full packet capture. Start with the Security Onion GitHub repository to match your installed tag against the release notes, and treat the tag you deploy as the reference for everything in this guide.

Use the architecture documentation to confirm where your hunts will run and which components hold the data they search. The Security Onion architecture docs describe how manager, search and sensor roles interact, which matters because search nodes stop indexing if they lose contact with the manager. For the step that turns a hunt into a detection, the Security Onion detections docs explain how NIDS, Sigma and YARA rules are managed in the Console. Check the EOL page before you commit to a version, because the Security Onion EOL page sets the dates on which older releases stop receiving support.

Review the license before you publish hunt content or share queries outside your organization. The Security Onion repository is licensed under the Elastic License 2.0, which is source-available rather than OSI-approved open source. Have your legal or procurement team confirm that your intended use, including any hosted or managed service built on the platform, fits those terms. Record the version, tag and license review in your runbook so that an analyst or auditor can see which query logic was validated against which release.

How DeployOpen scopes and delivers Security Onion hunting work

DeployOpen plans, implements and documents Security Onion inside your own infrastructure, so hunting queries, saved searches and detections run on data you control. We start from a written scope that defines which sensors, data sources and analyst roles the hunting work depends on, then deliver the working setup and the documentation your analysts need to keep using it.

How we scope

  • Confirm the Security Onion deployment type and whether you run a Distributed grid with a manager, sensors and search nodes.
  • Agree which network, endpoint and EVTX data sources must be searchable for the hunts in scope.
  • Define analyst roles, hunt hypotheses and the detections a successful hunt should produce, in writing before work starts.

How we build

  • Validate that the sensor and search node hardware meets the published Security Onion minimums before queries are tuned.
  • Write and test OQL hunts with grouping, sorting and sankey views against your own traffic, then check results against known activity.
  • Configure pivots from hunt results to PCAP and cases, and convert confirmed hunts into detections in the Detections interface.

How we hand over

  • Deliver a hunt library with the query text, purpose, data sources, expected results and known false positives for each hunt.
  • Document the detection rules created from hunts, including their Suricata, Sigma or YARA location and tuning history.
  • Run a walkthrough with your analysts so they can write, save and retest hunts without DeployOpen involved.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial scope is delivered.
  • Review hunt queries after Security Onion upgrades, since the release line and end-of-life dates affect what you maintain.
  • Confirm the support model, response expectations and included upgrade work with DeployOpen in the written quote.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.