Sigma rules are generic signatures used for log searching or threat detection in SIEM systems. To write a sigma rule for detecting an Nmap process being run on a MacBook, you would focus on the process creation events logged by the operating system. On macOS, process creation events can be monitored using the native Unified Logging System, or by third-party tools such as osquery.
Below is an example of a sigma rule that could be used to detect the execution of Nmap on a MacBook:
title: Detect Nmap Scan Process
id: 6a6f5e35-b3e2-4fa0-9a9a-c1d3e5e5d5c2
status: experimental
description: Detects the execution of the Nmap network scanning tool on a MacBook.
author: Your Name
date: 2023/04/01
references:
- https://nmap.org/
logsource:
product: macos
service: process_creation
category: process_monitoring
detection:
selection:
ProcessName:
- 'nmap'
condition: selection
falsepositives:
- Legitimate network scanning by administrators or security personnel
level: medium
tags:
- attack.discovery
- attack.t1046
In this rule:
title describes the purpose of the rule.
id is a unique identifier for the rule.
status is the development stage of the rule (experimental, stable, etc.).
description provides a brief overview of what the rule detects.
author is the creator of the rule.
date is when the rule was created.
references could include a link to the Nmap website or related documentation.
logsource describes where the logs are coming from—in this case, macOS process creation logs.
detection outlines the criteria for triggering the rule. Here, it looks for a process name of 'nmap'.
condition is what must be met for the detection to be considered a match.
falsepositives lists scenarios where the rule might trigger on non-malicious activity.
level indicates the severity of the detection.
tags provide additional context for the detection, such as the associated ATT&CK technique.
Please note that this is a generic template and the actual implementation will depend on the logging and SIEM tools in use within the environment. The ProcessName field, for example, might need to be adjusted to match the exact field name used by your logging system for process names. Additionally, you may need to tailor the rule to specify the path of the Nmap binary if necessary. Also, ensure that your logging system is configured to capture command-line arguments if you want to detect specific flags or options used with Nmap.