Class ScanTextConfig

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

public class ScanTextConfig extends Object
The configuration object to use when scanning inline plaintext with the Nightfall API.
  • Constructor Details

    • ScanTextConfig

      public ScanTextConfig(List<UUID> detectionRuleUUIDs, List<DetectionRule> detectionRules, int contextBytes)
      Create a scan configuration with the provided inline detection rules and detection rule UUIDs.
      Parameters:
      detectionRuleUUIDs - a list of detection rules to use to scan content (maximum length 10)
      detectionRules - a list of detection rules to use to scan content (maximum length 10)
      contextBytes - the number of bytes of context (leading and trailing) to return with any matched findings
  • Method Details

    • fromDetectionRuleUUIDs

      public static ScanTextConfig fromDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs, int contextBytes)
      Create a scan configuration with the provided detection rules.
      Parameters:
      detectionRuleUUIDs - a list of detection rules to use to scan content (maximum length 10)
      contextBytes - the number of bytes of context (leading and trailing) to return with any matched findings
      Returns:
      the scan configuration
    • fromDetectionRules

      public static ScanTextConfig fromDetectionRules(List<DetectionRule> detectionRules, int contextBytes)
      Create a scan configuration with the provided detection rules.
      Parameters:
      detectionRules - a list of detection rules to use to scan content (maximum length 10)
      contextBytes - the number of bytes of context (leading and trailing) to return with any matched findings
      Returns:
      the scan configuration
    • getDetectionRuleUUIDs

      public List<UUID> getDetectionRuleUUIDs()
      Get the detection rule UUIDs.
      Returns:
      the detection rule UUIDs to use to scan the file
    • setDetectionRuleUUIDs

      public void setDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs)
      Set the detection rule UUIDs.
      Parameters:
      detectionRuleUUIDs - the detection rule UUIDs to use to scan the file
    • getDetectionRules

      public List<DetectionRule> getDetectionRules()
      Get the detection rule UUIDs.
      Returns:
      the detection rules to use to scan the file
    • setDetectionRules

      public void setDetectionRules(List<DetectionRule> detectionRules)
      Set the detection rules.
      Parameters:
      detectionRules - the detection rules to use to scan the file
    • getContextBytes

      public int getContextBytes()
      Get the number of context bytes.
      Returns:
      the number of bytes of context (leading and trailing) to return with any matched findings
    • setContextBytes

      public void setContextBytes(int contextBytes)
      Set the number of context bytes.
      Parameters:
      contextBytes - the number of bytes of context (leading and trailing) to return with any matched findings
    • toString

      public String toString()
      Overrides:
      toString in class Object