Class Detector

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

public class Detector extends Object
An object that represents a data type or category of information. Detectors are used to scan content for findings.
  • Constructor Details

    • Detector

      public Detector(String nightfallDetector)
      Create an instance of a detector based on a pre-built Nightfall detector.
      Parameters:
      nightfallDetector - the name of a pre-built Nightfall detector
    • Detector

      public Detector(Regex regex)
      Create an instance of a detector based on a regular expression.
      Parameters:
      regex - the regular expression configuration
    • Detector

      public Detector(WordList wordList)
      Create an instance of a detector based on a word list.
      Parameters:
      wordList - the word list configuration
    • Detector

      public Detector(UUID detectorUUID)
      Create an instance of a detector by using an existing detector's UUID.
      Parameters:
      detectorUUID - an existing detector's UUID
  • Method Details

    • getMinConfidence

      public Confidence getMinConfidence()
      Return the minimum confidence.
      Returns:
      the minimum confidence threshold required in order for a finding to be triggered
    • setMinConfidence

      public void setMinConfidence(Confidence minConfidence)
      Set the minimum confidence.
      Parameters:
      minConfidence - the minimum confidence threshold.
    • getMinNumFindings

      public int getMinNumFindings()
      Get the minimum number of findings.
      Returns:
      the minimum number of occurrences of the detector required to trigger a finding match
    • setMinNumFindings

      public void setMinNumFindings(int minNumFindings)
      Set the minimum number of findings.
      Parameters:
      minNumFindings - the minimum number of occurrences of the detector required to trigger a finding match
    • getDetectorUUID

      public UUID getDetectorUUID()
      Get the detector UUID.
      Returns:
      a UUID that represents a pre-built detector
    • getDisplayName

      public String getDisplayName()
      Get the display name.
      Returns:
      a display name for this detector
    • setDisplayName

      public void setDisplayName(String displayName)
      Set the display name.
      Parameters:
      displayName - a display name for this detector
    • getDetectorType

      public String getDetectorType()
      Get the detector type.
      Returns:
      the type of this detector. Valid values are NIGHTFALL_DETECTOR, REGEX, and WORD_LIST.
    • getNightfallDetector

      public String getNightfallDetector()
      Get the nightfall detector.
      Returns:
      the pre-built Nightfall Detector to use. This field is only used if the Detector was constructed with a Nightfall Detector argument.
    • getRegex

      public Regex getRegex()
      Get the regex.
      Returns:
      the regular expression representing this detector. This field is only used if the Detector was constructed with a regex argument.
    • getWordList

      public WordList getWordList()
      Get the word list.
      Returns:
      the word list representing this detector. This field is only used if the Detector was constructed with a word list argument.
    • getContextRules

      public List<ContextRule> getContextRules()
      Get the context rules.
      Returns:
      the context rules that will be used to customize the behavior of this detector
    • setContextRules

      public void setContextRules(List<ContextRule> contextRules)
      Set the context rules.
      Parameters:
      contextRules - the context rules to use to customize the behavior of this detector
    • getExclusionRules

      public List<ExclusionRule> getExclusionRules()
      Get the exclusion rules.
      Returns:
      the exclusion rules that will be used to customize the behavior of this detector
    • setExclusionRules

      public void setExclusionRules(List<ExclusionRule> exclusionRules)
      Set the exclusion rules.
      Parameters:
      exclusionRules - the exclusion rules to use to customize the behavior of this detector
    • getRedactionConfig

      public RedactionConfig getRedactionConfig()
      Returns the redaction configuration to-be-applied to this detector. This configuration is currently only supported for scanning plaintext, not for file scanning.
      Returns:
      the redaction configuration
    • setRedactionConfig

      public void setRedactionConfig(RedactionConfig redactionConfig)
      Sets the redaction configuration to-be-applied to this detector. This configuration is currently only supported for scanning plaintext, not for file scanning.
      Parameters:
      redactionConfig - the redaction configuration
    • toString

      public String toString()
      Overrides:
      toString in class Object