Using Ollama & Fabric to build Sigma rules
Last updated
Last updated
In this blog we are going to learn how to use an oper source LLM (Ollama) to build SIgma rules. First we will run tests, analyze the logs in Splunk, and run a command to build our sigma from the Splunk raw log we identified.
Step 1: Collect Data
Start by gathering detailed network information from your Windows machine using the following commands:
ipconfig /all
This command provides comprehensive details about all network interfaces, including IP addresses, DNS servers, and other configuration settings.
netsh interface show interface
Use this command to view the status of network interfaces, including whether they are enabled or disabled and their current state.
arp -a
Display the ARP (Address Resolution Protocol) table, which maps IP addresses to MAC addresses on the local network.
nbtstat -n
Show the NetBIOS name table for the local computer, which is useful for troubleshooting network name resolution issues.
net config
View the configuration of the local network services, including network-related settings.
Use the following Splunk search command to view the raw log data:
This command searches for logs within the specified index and displays the raw log data in a table format. Copy the raw log data for the next step.
To automate the process of creating Sigma rules, you need to have Fabric installed and configured. Fabric is an automation tool that can streamline various tasks.
Ensure that Ollama is installed. Ollama is used to build Sigma rules from raw log data. Refer to the installation instructions to ensure Ollama is correctly configured on your machine.
With Fabric and Ollama set up, you can now create Sigma rules from your raw log data. Use the following command to process the data and generate Sigma rules:
This command performs the following actions:
pbpaste
: Retrieves the raw log data from your clipboard.
fabric --pattern create_sigma_rules
: Uses Fabric to process the data and create Sigma rules.
--model llama3.1:8b
: Specifies the model to be used by Fabric for rule creation.
--stream
: Indicates that the data should be processed in streaming mode.
After running the command, review the output of the model. You can then copy and paste the generated Sigma rule into your text editor or SIEM (Security Information and Event Management) system of choice.