Skip to content

Not getting all issues with a file #1958

@danielwatrous-zendesk

Description

@danielwatrous-zendesk

Description & Reproduction

I generated the following file to test bearer

import os

# --- HARDCODED SECRETS (Do not use in production) ---

# Database Credentials
DB_CONNECTION = {
    "db_user": "admin_service",
    "db_pass": "P@ssw0rd2026!_SecureAccess",
    "host": "db.internal.company.com",
    "port": 5432
}

# Simulated Cloud Provider API Key (High Entropy)
AWS_CONFIG = {
    "api_key": "AKIAJ2L3EXAMPLE456789XYZ",
    "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    "region": "us-east-1"
}

# --- PERSONALLY IDENTIFIABLE INFORMATION (PII) ---

# Dictionary containing sensitive user data for testing PII scanners
USER_RECORD = {
    "user_id": 10293,
    "full_name": "Jane Alice Smith",
    "email": "jane.smith@example.org",
    "phone_number": "+1-555-010-9988",
    "social_security_number": "999-00-1234",
    "date_of_birth": "1992-05-14",
    "home_address": "1234 Maple Avenue, Springfield, IL, 62704"
}

def connect_to_service():
    print(f"Connecting to database at {DB_CONNECTION['host']}...")
    # Logic to use the credentials would go here
    pass

if __name__ == "__main__":
    connect_to_service()
    print("Application started successfully.")

I expected to get a lot of issues with this file, but I don't

Expected Behavior

I was expecting it to call out that there are other passwords, PII and so on.

Actual Behavior

Analyzing codebase
⠋  (27/-) [0s] 
Loading rules
Scanning target bad.py
 └ 100% [===============] (1/1) [0s]
Running Detectors
Generating dataflow
Evaluating rules
 └ 100% [===============] (234/234) [0s]   


Security Report

=====================================

Rules: 
https://docs.bearer.com/reference/rules [v0.48.4]

Language  Default Rules  Custom Rules  Files  
Python    88             0             1      


HIGH: Hard-coded secret detected. [CWE-798]
https://docs.bearer.com/reference/rules/gitleaks
To ignore this finding, run: bearer ignore add 449faec69801973b3d7630479cfd4169_0

Detected: AWS Access Token

File: bad.py:15

 15     "api_key": "AKIAJ2L3EXAMPLE456789XYZ",
=====================================

89 checks, 1 findings

CRITICAL: 0
HIGH: 1 (CWE-798)
MEDIUM: 0
LOW: 0
WARNING: 0

Possible Fix

Your Environment

  • Operating System and version: MacOS
  • Output of 'bearer version':
bearer version 2.0.1, build db06eee42c91ec397b4866b2446f30917093c412

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions