Class ScanPolicy

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

public class ScanPolicy extends Object
An object containing configuration that describes how to scan a file. Since the file is scanned asynchronously, the results from the scan are delivered to the provided webhook URL. The scan configuration may contain both inline detection rule definitions and UUID's referring to existing detection rules (up to 10 of each).
  • Constructor Details

    • ScanPolicy

      public ScanPolicy(String webhookURL, List<DetectionRule> detectionRules, List<UUID> detectionRuleUUIDs)
      Create a scan policy with the provided detection rules and detection rule UUIDs.
      Parameters:
      webhookURL - the URL that Nightfall will use to deliver a webhook containing scan results
      detectionRules - a list of detection rules to use to scan content. maximum length 10.
      detectionRuleUUIDs - a list of detection rule UUIDs to use to scan content. maximum length 10.
  • Method Details

    • fromDetectionRules

      public static ScanPolicy fromDetectionRules(List<DetectionRule> detectionRules, String webhookURL)
      Create a scan policy with the provided detection rules.
      Parameters:
      detectionRules - a list of detection rules to use to scan content. maximum length 10.
      webhookURL - the URL that Nightfall will use to deliver a webhook containing scan results
      Returns:
      the scan policy
    • fromDetectionRuleUUIDs

      public static ScanPolicy fromDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs, String webhookURL)
      Create a scan policy with the provided detection rules.
      Parameters:
      detectionRuleUUIDs - a list of detection rule UUIDs to use to scan content. maximum length 10.
      webhookURL - the URL that Nightfall will use to deliver a webhook containing scan results
      Returns:
      the scan policy
    • getWebhookURL

      public String getWebhookURL()
      Get the webhook URL.
      Returns:
      the webhook URL that Nightfall should deliver results to
    • setWebhookURL

      public void setWebhookURL(String webhookURL)
      Set the webhook URL.
      Parameters:
      webhookURL - the webhook URL that Nightfall should deliver results to
    • getDetectionRules

      public List<DetectionRule> getDetectionRules()
      Get the list of detection rules.
      Returns:
      the list of detection rules to use to scan the files
    • setDetectionRules

      public void setDetectionRules(List<DetectionRule> detectionRules)
      Set the detection rules.
      Parameters:
      detectionRules - a list of detection rules to scan against
    • getDetectionRuleUUIDs

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

      public void setDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs)
      Set the detection rule UUIDs.
      Parameters:
      detectionRuleUUIDs - the list of detection rule UUIDs to scan against