Skip to content

DLP Reference

Detailed reference for SYNAPSEED's Data Loss Prevention (DLP) system.

Detection Patterns

AWS Access Keys

PatternMethod
AKIA prefix + 16 alphanumeric charsAho-Corasick prefix + length validation

Example: AKIAIOSFODNN7EXAMPLE

GitHub Tokens

PatternMethod
ghp_ prefixAho-Corasick
gho_ prefixAho-Corasick
ghs_ prefixAho-Corasick
ghr_ prefixAho-Corasick
github_pat_ prefixAho-Corasick

Generic Secrets

PatternMethod
password=<value>Regex
api_key=<value>Regex
secret=<value>Regex
token=<value>Regex
auth=<value>Regex

Private Keys

PatternMethod
-----BEGIN RSA PRIVATE KEY-----Aho-Corasick
-----BEGIN EC PRIVATE KEY-----Aho-Corasick
-----BEGIN OPENSSH PRIVATE KEY-----Aho-Corasick
-----BEGIN PRIVATE KEY-----Aho-Corasick

Whitelist (False-Positive Suppression)

Findings whose matched text matches a whitelist pattern are silently dropped. Built-in defaults suppress common Rust false positives:

PatternSuppresses
(?i)token\s*[:=]\s*[A-Z]\w+Type assignments like token: CancellationToken
(?i)shutdown_tokenAsync shutdown patterns

Add custom whitelist patterns in .synapseed/dna.yaml:

yaml
dlp_whitelist:
  - "(?i)token\\s*[:=]\\s*[A-Z]\\w+"
  - "(?i)shutdown_token"

Redaction

When sensitive content is found, SYNAPSEED replaces the sensitive portion with REDACTED:

Input:  aws_key=AKIAIOSFODNN7EXAMPLE
Output: aws_key=REDACTED

The original content is never included in tool responses.

API

SecurityGuard

rust
let guard = SecurityGuard::with_defaults();

// Check for secrets (returns Ok or Err with finding)
match guard.check(&content) {
    Ok(()) => println!("CLEAN"),
    Err(finding) => println!("ALERT: {finding}"),
}

// Redact secrets (returns sanitized content)
let safe = guard.redact(&content);

Performance

The Aho-Corasick engine scans content in O(n) time regardless of the number of patterns. A typical DLP scan takes less than 1ms for content up to 100KB.

Released under the Apache License 2.0.