# How to test Elasticsearch rules?

**URL:** <https://discuss.elastic.co/t/how-to-test-elasticsearch-rules/329448>\
**Category:** Elastic Security\
**Tags:** detection-rules\
**Created:** [April 5, 2023, 3:02pm UTC](https://discuss.elastic.co/t/how-to-test-elasticsearch-rules/329448 "2023-04-05T15:02:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iojas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iojas/32/117987_2.png) [@iojas](https://discuss.elastic.co/u/iojas)\
**Post date:** [April 5, 2023, 3:02pm UTC](https://discuss.elastic.co/t/how-to-test-elasticsearch-rules/329448/1 "2023-04-05T15:02:26Z")

</div>

I have successfully installed the elastic-agent on Kubernetes cluster and see them showing up in the fleet.

I turned on bunch of rules, I see them as enabled. now I want to be able to trigger one of those rules. something simple like `Suspicious CronTab Creation or Modification`.

I ssh into the node that fleet is monitoring and create a crontab. I waited for 15 minutes but I don't see any execution for this rule getting triggered.

what am I missing here?

---

<div class="post-metadata">

**Author:** ![Jonhnathan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonhnathan/32/98445_2.png) [@Jonhnathan](https://discuss.elastic.co/u/Jonhnathan)\
**Post date:** [April 17, 2023, 7:23pm UTC](https://discuss.elastic.co/t/how-to-test-elasticsearch-rules/329448/2 "2023-04-17T19:23:34Z")

</div>

Hey @iojas, that rule aims to detect Suspicious CronTab creation or modification on MacOS systems.

To trigger the rules is essential to understand them first. For example, to trigger `Suspicious CronTab Creation or Modification`, you need to create a file in the `/private/var/at/tabs/` directory using a process other than `/usr/bin/crontab`, which is MacOS specific.

We also provide some scripts to trigger rules in the detection rules [repo](https://github.com/elastic/detection-rules/tree/main/rta), that you can use to some of the rules.

Let me know if you have questions.  
J

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 15, 2023, 7:24pm UTC](https://discuss.elastic.co/t/how-to-test-elasticsearch-rules/329448/3 "2023-05-15T19:24:25Z")

</div>

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