1. Understanding the Rule Files
Argus’s rule files are located in the /var/ossec/rules/ directory. These XML files define how log events are analyzed, categorized, and flagged for alerts. The files are grouped based on different types of data sources (e.g., firewall, syslog, ssh, etc.).
2. Basic Rule Structure
Each rule is structured using XML tags. Here’s an example rule:
<rule id=”100001″ level=”5″>
<decoded_as>syslog</decoded_as>
<field name=”program”>sshd</field>
<description>SSH failed login attempt</description>
<group>ssh,authentication_failed</group>
<pci_dss>6.5.2</pci_dss>
</rule>
Key elements:
id: Unique identifier for the rule.
level: Severity level of the alert (1–15, where 15 is the highest).
decoded_as: Specifies the log source (e.g., syslog).
field: Matching condition on a specific log field.
description: What the rule monitors.
group: Logical group for rule classification (e.g., ssh, authentication_failed).
pci_dss: Compliance mapping (if needed).
3. Creating Custom Rules
<group name=”custom_rules”>
<rule id=”100002″ level=”10″>
<decoded_as>syslog</decoded_as>
<field name=”program”>sshd</field>
<match>Failed password</match>
<description>SSH failed login attempt</description>
<group>authentication_failed, ssh</group><pci_dss>10.2.4</pci_dss>
</rule>
</group>
4. Rule Matching Conditions
Argus rules can match on various fields or conditions:
match: Looks for a specific string or regular expression in the log message.
field: Matches specific fields in the log (like program name or user).
decoded_as: Specifies the decoder to use for log normalization (e.g., apache, ssh, etc.).
srcip and dstip: Can be used to match source and destination IPs in network logs.
5. Testing and Validating Your Rules
After creating or modifying a rule, it’s important to test it:
6. Adjusting Rule Levels
7. Mapping Rules to Compliance
<pci_dss>10.2.4</pci_dss>
8. Advanced Rule Configuration
You can configure more advanced rules that include
Still stuck? How can we help?
Logged in as admin. Edit your profile. Log out? Required fields are marked *
Fill out the form below!