Package ai.nightfall.scan.model
Class ScanTextConfig
java.lang.Object
ai.nightfall.scan.model.ScanTextConfig
The configuration object to use when scanning inline plaintext with the Nightfall API.
-
Constructor Summary
ConstructorsConstructorDescriptionScanTextConfig(List<UUID> detectionRuleUUIDs, List<DetectionRule> detectionRules, int contextBytes) Create a scan configuration with the provided inline detection rules and detection rule UUIDs. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScanTextConfigfromDetectionRules(List<DetectionRule> detectionRules, int contextBytes) Create a scan configuration with the provided detection rules.static ScanTextConfigfromDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs, int contextBytes) Create a scan configuration with the provided detection rules.intGet the number of context bytes.Get the detection rule UUIDs.Get the detection rule UUIDs.voidsetContextBytes(int contextBytes) Set the number of context bytes.voidsetDetectionRules(List<DetectionRule> detectionRules) Set the detection rules.voidsetDetectionRuleUUIDs(List<UUID> detectionRuleUUIDs) Set the detection rule UUIDs.toString()
-
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
Get the detection rule UUIDs.- Returns:
- the detection rule UUIDs to use to scan the file
-
setDetectionRuleUUIDs
Set the detection rule UUIDs.- Parameters:
detectionRuleUUIDs- the detection rule UUIDs to use to scan the file
-
getDetectionRules
Get the detection rule UUIDs.- Returns:
- the detection rules to use to scan the file
-
setDetectionRules
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
-