Skip to content

Bearer - Sensitive Data Flow & SAST Cheatsheet

Bearer - Sensitive Data Flow & SAST Cheatsheet

Bearer is an open-source static application security testing tool with a distinctive angle: it is built around sensitive data flow. Rather than only matching vulnerable code patterns, Bearer discovers where PII, PHI, and other sensitive data live in your codebase, maps how that data moves, and flags when it leaks into logs, third-party services, or insecure communication. That makes it unusually well suited to privacy and compliance work (GDPR, HIPAA, PCI) alongside conventional security scanning.

Installation

MethodCommand
Install script`curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh
macOS (Homebrew)brew install bearer/tap/bearer
Dockerdocker run --rm -v "$PWD:/tmp/scan" bearer/bearer:latest scan /tmp/scan
Debian/Ubuntu.deb from GitHub Releases
Verifybearer version

Scanning

CommandDescription
bearer scan .Full security + privacy scan
bearer scan . --scanner secretsSecret detection only
bearer scan . --scanner sastSAST rules only
bearer scan . --report dataflowShow sensitive data flows
bearer scan . --report privacyPrivacy/compliance report
bearer scan . --format json -o out.jsonJSON output

Report Types

ReportShows
security (default)Rule violations by severity
dataflowWhere sensitive data is detected and where it goes
privacyData subjects/types per third-party component
statsCodebase composition summary
# Which third parties receive personal data?
bearer scan . --report privacy --format json

Sensitive Data Detection

CategoryExamples
PersonalName, email, phone, address
FinancialCard numbers, bank accounts
Health (PHI)Diagnoses, medical identifiers
CredentialsPasswords, tokens, keys
Device/trackingIPs, device IDs

Bearer classifies data by type and subject (customer, employee, user), which is what makes the privacy report meaningful.

Common Findings

FindingRisk
PII written to logsData leakage into log aggregation
Sensitive data to third partyUnvetted processor / GDPR issue
Unencrypted transmissionData over HTTP
Weak cryptoInsecure algorithms on sensitive fields
Secrets in sourceHardcoded credentials

Severity & Filtering

FlagEffect
--severity critical,highOnly report these levels
--skip-path "tests/**,vendor/**"Exclude paths
--only-rule RULE_IDRun a single rule
--skip-rule RULE_IDSuppress a rule
--exit-code 1Fail CI on findings

Configuration

# bearer.yml
scan:
  skip-path:
    - "**/tests/**"
    - "**/node_modules/**"
  severity:
    - critical
    - high
report:
  format: json

CI Integration

# Gate a PR on high-severity data-flow issues
bearer scan . --severity critical,high --exit-code 1

# Produce SARIF for GitHub code scanning
bearer scan . --format sarif -o bearer.sarif

Custom Rules

Bearer rules are YAML and can define new sensitive patterns or detections:

FieldPurpose
patternsCode shapes to match
languagesApplicable languages
severityFinding severity
metadata.cwe_idMap to CWE

Bearer vs Other SAST

AspectBearerSemgrep/OpengrepTruffleHog
Core ideaSensitive data flowPattern/taint rulesSecret scanning
Privacy reportingFirst-classNoNo
Compliance mappingGDPR/HIPAA/PCIManualNo
Best forData-risk + privacy reviewGeneral SAST breadthLeaked credentials

Complements Semgrep/Opengrep for general SAST and TruffleHog for secrets — Bearer’s edge is knowing what data is at risk.

Resources