Generating security language queries
Abstract
A computer-implemented method of generating a security language query from a user input query includes receiving, at a computer system, an input security hunting user query indicating a user intention; selecting, using a trained machine learning model and based on the input security hunting query, an example user security hunting query and corresponding example security language query; generating, using the trained machine learning model, query metadata from the input security hunting query; generating a prompt, the prompt comprising: the input security hunting user query; the selected example user security hunting query and the corresponding example security language query; and the generated query metadata; inputting the prompt to a large language model; receiving a security language query from the large language model corresponding to the input security hunting query reflective of the user intention.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 9 · Forward citations: 1.
Claims (8)
- Claim 1Independent Claim
A computer-implemented method comprising: receiving a training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata; generating a plurality of probe prompts from the training data set, wherein generating each probe prompt comprises: selecting one of the plurality of user security hunting queries as a subject of the probe prompt, and randomly selecting a subset of the plurality of user security hunting queries and corresponding ground truth security language queries as examples for inclusion into the probe prompt; inputting the probe prompts to a large language model; receiving, as output from the large language model, security language queries corresponding to the subjects of the probe prompts; comparing the security language queries for the probe prompts to the corresponding ground truth security language queries; calculating probe scores for the probe prompts based on the comparison; a
- Claim 2Depends on #1
The method of claim 1, wherein the trained model comprises: a base large language model; a pooling layer; a ranking head; and a classification head, wherein the ranking head is trained to select the user security hunting query and corresponding ground truth security language query, and the classification head is trained to generate the query metadata.
- Claim 3Depends on #1
The method of claim 1, comprising generating the training data set by: receiving an initial training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata; receiving a security query set comprising security language queries and corresponding textual descriptions of the security language queries; generating a prompt including: a user security hunting query and corresponding ground truth security language query drawn from the initial training data set, and a security language query and corresponding textual description from the security query set; inputting the prompt to a natural language generation large language model; receiving, as output from the natural language generation large language model, a user security hunting query corresponding to the security language query from the security query set, including the received user security hunting query and the security language query from t
- Claim 4Depends on #1
The method of claim 1, comprising: backtranslating the user security hunting queries to generate backtranslated security hunting queries; and including the backtranslated security hunting queries in the training data set.
- Claim 5Depends on #1
The method of claim 1, comprising: fitting a linear model to the probe scores; generating, from the linear model, rankings indicative of usefulness of the examples included in the probe prompts to the subjects of the probe prompts; wherein training the machine learning model to generate the output scores to select a user security hunting query and corresponding ground truth security language query of the training data set is based on the ranking.
- Claim 6Depends on #5
The method of claim 5, wherein training the machine learning model based on the ranking comprises: selecting a pair of examples from the ranking; inputting the pair of examples to the machine learning model; training the machine learning model to minimize a pairwise cross-entropy loss calculated from the pair of examples.
- Claim 7Depends on #1
The method of claim 1, comprising: generating a plurality of hyperparameter probe prompts, wherein generating each hyperparameter probe prompt comprises: selecting one of the plurality of user security hunting queries as a subject of the hyperparameter probe prompt, and randomly selecting values for a hyperparameter of the machine learning model; inputting the generated hyperparameter probe prompts to the large language model; receiving, as output from the large language model, security language queries corresponding to the subjects of the hyperparameter probe prompt; comparing the received security language queries for the hyperparameter probe prompts to the corresponding ground truth security language queries; calculating hyperparameter probe scores for the hyperparameter probe prompts based on the comparison; and training the machine learning model to select a value for the hyperparameter based on the calculated hyperparameter probe scores.
- Claim 8Independent Claim
A system comprising a processor and a storage, the storage storing computer-readable instructions which, when executed by the processor, cause the system to perform operations comprising: receiving a training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata; generating a plurality of probe prompts from the training data set, wherein generating each probe prompt comprises: selecting one of the plurality of user security hunting queries as a subject of the probe prompt, and randomly selecting a subset of the plurality of user security hunting queries and corresponding ground truth security language queries as examples for inclusion into the probe prompt; inputting the probe prompts to a large language model; receiving, as output from the large language model, security language queries corresponding to the subjects of the probe prompts; comparing the security language queries for the pr
Technical Overview & Description
BACKGROUND Security hunting or threat hunting involves proactively searching for security threats to a computer system. One challenge for security analysts is understanding the structure and format of security data, in order to be effective when performing a security investigation. On average, companies use 20 different security products to protect and defend their assets and intellectual property. Most of these security products use their own proprietary log structure, which is difficult to decipher and understand, and requires a considerable amount of time for an analyst to become proficient in interrogating. Microsoft ® security products (e.g. Microsoft ® Sentinel ® /Defender ® ) employ a query language called Kusto Query Language (KQL) for querying these logs, which is often unfamiliar for junior analysts with limited knowledge of the relevant table and schema definitions. SUMMARY According to one aspect disclosed herein, there is provided a computer-implemented method comprising: receiving an input security hunting user query; selecting, using a trained machine learning model and based on the input security hunting query, an example user security hunting query and corresponding example security language query; generating, using the trained machine learning model, query metadata from the input security hunting query; generating a prompt, the prompt comprising: the input security hunting user query; the selected example user security hunting query and the corresponding example security language query; and the generated query metadata; inputting the prompt to a large language model; receiving a security language query from the large language model corresponding to the input security hunting query. Using a trained machine learning model to select the examples (or “ shots ” ) included in the prompt and to generate appropriate metadata (e.g. table schema data) assists in providing reliable security language queries that closely align to the users intent. According to
Cited By — Indexed Forward Citations (1 of 1 total)
| Patent | Title | Year | Citations |
|---|---|---|---|
| US 12,801,648 B2 | Security countermeasure support system | 2026 | 0 |
References Cited — Backward Prior Art (9)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Brown, et al.,
- “
- Language Models are Few-Shot Learners
- ”
- , In Repository of arXiv:2005.14165v4, Jul. 22, 2020, pp. 1-75.
- International Search Report and Written Opinion received for PCT Application No. PCT/US2023/028905, Dec. 15, 2023, 19 pages.
- Prashant,
- “
- Create a Question-Answer Service using GPT-3 and OpenAI
- ”