Skip to content

What are the reasonable numbers for new/custom rule ids? (FreeBSD port) #1366

@mobstef

Description

@mobstef

I am the current maintainer of OSSEC HIDS FreeBSD port.
I would like to distribute some custom rules with the port (v2.9.3) suitable for FreeBSD and based on Linux rule "533" from "ossec_rules.xml". Something like:

<group name="ossec,">

  ...

  <rule id="533" level="7">
    <if_sid>530</if_sid>
    <match>ossec: output: 'netstat -tan</match>
    <check_diff />
    <description>Listened ports status (netstat) changed (new port opened or closed).</description> 
  </rule>

  ...

  <rule id="536" level="7">
    <if_sid>530</if_sid>
    <match>ossec: output: 'netstat -4 -p tcp</match>
    <check_diff />
    <description>Listened IPv4 TCP ports status (netstat) changed (new port opened or closed).</description> 
  </rule>

  <rule id="537" level="7">
    <if_sid>530</if_sid>
    <match>ossec: output: 'netstat -6 -p tcp</match>
    <check_diff />
    <description>Listened IPv6 TCP ports status (netstat) changed (new port opened or closed).</description> 
  </rule>

  <rule id="538" level="7">
    <if_sid>530</if_sid>
    <match>ossec: output: 'netstat -4 -p udp</match>
    <check_diff />
    <description>IPv4 UDP ports status (netstat) changed (new port opened or closed).</description> 
  </rule>

  <rule id="539" level="7">
    <if_sid>530</if_sid>
    <match>ossec: output: 'netstat -6 -p udp</match>
    <check_diff />
    <description>IPv6 UDP ports status (netstat) changed (new port opened or closed).</description> 
  </rule>

  ...

</group>

The questions are:

  1. Should the mentioned rules be added to OSSEC or shipped with the port (they will not work in Linux, because the netstat command options differ)?
  2. If they should be added to OSSEC then where exactly and with which rule ids?
  3. If they should be added to the port then what rule id range is safe to use? Can it be somehow restricted to FreeBSD port?
  4. If an OSSEC HIDS user wants to add custom rule what is the safe rule id range that will guarantee no conflicts with future releases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions