# Creating SIGMA Rule

### **Rules to be followed**

Following are some basic rules to be followed while writing a sigma rule:&#x20;

* Follows YAML format, use only spaces (no tabs).&#x20;
* All values are case-insensitive strings &#x20;
* You can make use of wildcard characters '\*' and '?' in strings e.g., `'*\cmd.exe'`
* Wildcards can be escaped with '\\' e.g., `'*'`
* Special Field Values:&#x20;
  * Null values are defined with `'null'`&#x20;
  * Empty value is defined with `''`

> **Note:** It is strongly advisable to use an IDE like VSCode (free from Microsoft) to edit / work with Sigma files. They natively support YAML formatting and can help you save a lot of heartburn w\.r.t to YAML formatting.

### Creating New Rule from Portal

Steps on creation/modification and deployment of new/existing sigma rules from within Blusapphire SIEM Portal.

**Step 1:** From Blusapphire portal, navigate to “Rule Management" page available under “Entity Behavior” menu item.

![Rule Management](/files/AuW6FE9ub22ds0FZqYrG)

**Step 2:** To create a new rule, click on “New” button available on top right side. As described earlier in this document:&#x20;

1. Provide an appropriate rule name

![Rule Title/Name](/files/eFaqXVSFgPFNjwvLiWYt)

2\. Provide the required metadata fields

![Rule Meta Information](/files/JpJDOsn9ISDStuBRhuqc)

3\. Provide required Logsource as per specifications, define the search-identifiers (selection/filters) for the rule and the condition expression.

![Define Logsource and Detection attributes](/files/JhvhjhLmadK9KqD4foT0)

5\. Finally check, validate and save the new rule.

![Check and Validate new rule](/files/eiomrbwMKKc5s6k7h95L)

6\. Newly created rules will be enabled by default.

![Newly Created Rule](/files/P6U9MR7fhdwCywzSyIzf)

### Update Existing Rule from Portal

To update an existing rule from portal, Navigate to “Rule Management" page under “Entity Behavior” menu item.

1. Use filters to search for an existing rule

![Filter Existing Rule](/files/jsQ88V4E6wv8C62DwOOs)

&#x20;2\. Make the required changes in the rule, validate and save.

![Update Existing Rule](/files/edFyT04a4pFYjDVp5eUM)

{% embed url="<https://www.youtube.com/watch?v=yB3AkJ6m3hc>" %}
SIGMA Rule Creation
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blusapphire.io/older-releases/use-cases/sigma-rules/creating-sigma-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
