# Help with correlation rules

**URL:** <https://forum.opensearch.org/t/help-with-correlation-rules/25803>\
**Category:** Security Analytics\
**Created:** [July 16, 2025, 9:58am UTC](https://forum.opensearch.org/t/help-with-correlation-rules/25803 "2025-07-16T09:58:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kin0sh](https://avatars.discourse-cdn.com/v4/letter/k/e47774/32.png) [@Kin0sh](https://forum.opensearch.org/u/Kin0sh)\
**Post date:** [July 16, 2025, 9:58am UTC](https://forum.opensearch.org/t/help-with-correlation-rules/25803/1 "2025-07-16T09:58:59Z")

</div>

Hello everyone

I’m trying to create the following rule:  
A windows event log is received in one data stream, it is necessary to take the value of one of the lines (subject name), and compare this value with the value of another document in another index.

Sigma has a very good example using aliases

> **[Sigma Correlation Rules Specification](https://sigmahq.io/sigma-specification/specification/sigma-correlation-rules-specification.html#field-name-aliases-example)**
>
> Sigma rule specification

I tried to do the same in detection rules, but when I try to save the “name” line in the rule, it is not saved and does not give any errors.  
Can you tell me which plugin can I use to implement this request?  
P.S. What is all this for?  
For example, when powershell is launched on a PC, I want to check that the user who launched it is in a certain group in active directory or has a certain position. I unload the active directory structure (memberOf and title) using a python script into a separate index.

Thank you for any help

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [July 17, 2025, 12:42pm UTC](https://forum.opensearch.org/t/help-with-correlation-rules/25803/2 "2025-07-17T12:42:18Z")

</div>

@Kin0sh I don’t think this is a use case for correlation rules. Seems more like monitor rules. However as far as I know the cross-index joins are not currently supported.

This would need to be implemented using external script to either update the original log line with relevant field that you can use to create monitor alert from. Or alert externally after checking the second index.

There **is** a way to configure a monitor based on details from another index, using something like this:

```auto
POST _plugins/_alerting/monitors
{
  "name": "Unauthorized user detection",
  "monitor_type": "query_level_monitor",
  "enabled": true,
  "schedule": {
    "period": {
      "interval": 1,
      "unit": "MINUTES"
    }
  },
  "inputs": [
    {
      "search": {
        "indices": ["windows-events"],
        "query": {
          "size": 10,
          "query": {
            "bool": {
              "must_not": [
                {
                  "terms": {
                    "subject_name.keyword": {
                      "index": "allowed-users",
                      "id": "valid_admins",
                      "path": "usernames"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  ],
  "triggers": [
    {
      "query_level_trigger": {
        "name": "Unauthorized user used PowerShell",
        "severity": "3",
        "condition": {
          "script": {
            "source": "ctx.results[0].hits.total.value > 0",
            "lang": "painless"
          }
        },
        "actions": [
          {
            "name": "Send Slack",
            "destination_id": "....",
            "message_template": {
              "source": "User {{ctx.results.0.hits.hits.0._source.subject_name}} is not allowed to run this command."
            }
          }
        ]
      }
    }
  ]
}

```

However this would require a flattened list on “allowed-users” index. Which would also need to be updated with new users when necessary.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [September 15, 2025, 12:42pm UTC](https://forum.opensearch.org/t/help-with-correlation-rules/25803/3 "2025-09-15T12:42:36Z")

</div>

Closed on September 15, 2025, 12:42pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
