Class DetectionRule

java.lang.Object
ai.nightfall.scan.model.DetectionRule

public class DetectionRule extends Object
An object that contains a set of detectors to be used when scanning content. Findings matches are triggered according to the provided logicalOplogicalOp; valid values are ANY (logical OR, i.e. a finding is emitted only if any of the provided detectors match), or ALL (logical AND, i.e. a finding is emitted only if all provided detectors match).
  • Constructor Details

    • DetectionRule

      public DetectionRule(List<Detector> detectors, LogicalOp logicalOp)
      Create a detection rule with the provided detectors and logicalOp.
      Parameters:
      detectors - a list of detectors
      logicalOp - a logical op: ANY or ALL
    • DetectionRule

      public DetectionRule(List<Detector> detectors, LogicalOp logicalOp, String name)
      Create a detection rule with the provided detectors and logicalOp.
      Parameters:
      detectors - a list of detectors
      logicalOp - a logical op: ANY or ALL
      name - a name for the detection rule
  • Method Details

    • getDetectors

      public List<Detector> getDetectors()
      Get the list of detectors.
      Returns:
      the set of detectors
    • setDetectors

      public void setDetectors(List<Detector> detectors)
      Set the detectors.
      Parameters:
      detectors - a set of detectors
    • getLogicalOp

      public LogicalOp getLogicalOp()
      Get the logical op.
      Returns:
      the logical op
    • setLogicalOp

      public void setLogicalOp(LogicalOp logicalOp)
      Set the logical op.
      Parameters:
      logicalOp - a logical op; valid values ANY or ALL
    • getName

      public String getName()
      Get the name of the detection rule.
      Returns:
      the name of the detection rule
    • setName

      public void setName(String name)
      Set the detection rule name.
      Parameters:
      name - a name for the detection rule
    • toString

      public String toString()
      Overrides:
      toString in class Object