Skip to content

rule evaluation and alert clearing in Robinhood v3 #152

Description

@garadar

Hello,

I am trying to better understand how rule evaluation works in Robinhood v3 alert policies.

Context

My goal is simple:

  • Raise an alert when a file matches a condition (e.g. last_access > X)
  • Clear the alert when the file no longer matches this condition

All files belong to the same fileclass (e.g. user_file).


Observed behavior

From my understanding and testing:

  • Rules are evaluated in order
  • A rule is selected based on target_fileclass
  • When a file matches a rule’s target_fileclass, evaluation stops, even if the condition is false
  • The default rule is not applied if the file already matches a previous rule’s fileclass ( cf. Policy rule default)

This makes it difficult to express a simple transition such as:

IF condition → alert
ELSE → clear

within a single policy and fileclass.


Questions

  • Is this behavior expected, or am I misunderstanding how rules are intended to be used?
  • What is the recommended best practice to implement clearing of alerts when a file no longer matches a condition?
  • Is it acceptable to define fileclasses based on attributes like last_access, or is this discouraged?

As WorkArround, I tried the third question and defined a class based on last_access and apply a rule on it:

### Alers rules
alert_rules {

    rule Old_Files {
        target_fileclass = old_file;
        action = cmd("/etc/robinhood.d/scripts/unige_alert.sh -d /srv/beegfs/scratch/log/robinhood/report/ -f {fullpath} -r OldFiles ");
        condition = true;
    }


  # clear alert status
rule default {
    action = none;
    action_params { alert = clear; }
    # apply to all entries that don't match 'raise_alert'
    condition { alert.status == alert }
    }

}

But i get this expected warning message:

2026/05/25 17:16:03 [2698682/1] PolicyCheck | WARNING: in FileClass 'old_file', line 180: time-based conditions should be specified in policy condition instead of file class definition

So what the best practice here ?

Thank you for your clarification.

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