Skip to main content

Tool for detecting sensitive data leaks in files and cloud storage

Project description

Data Leak Inspector

Tests PyPI Python License: MIT Ruff

Find sensitive data. Fix risky permissions.

Data Leak Inspector is a CLI tool that helps you identify potentially exposed files in your storage systems โ€” starting with Google Drive.

Instead of scanning file contents, DLI analyzes metadata and permissions to quickly highlight files that may be publicly accessible or shared.

๐Ÿš€ Features

  • ๐Ÿ” Metadata-based scanning (no file content access)
  • โ˜๏ธ Google Drive integration
  • ๐Ÿ“‚ Scans all files (including nested ones)
  • ๐Ÿ” Exposure detection based on permissions
    • Public (anyone with link)
    • Shared (users, groups, domain)
    • Private
  • ๐Ÿ’ฌ Human-readable explanations
  • ๐Ÿ“Š Clean CLI output with summaries
  • โšก Progress bar during scanning

๐Ÿง  How It Works

DLI does not read file contents.

Instead, it analyzes:

  • File permissions (Google Drive API)
  • Sharing settings
  • Basic metadata (name, type, timestamps)

This allows:

โœ” Faster scans
โœ” Lower permissions required
โœ” Easier approval for Google APIs
โœ” Better privacy guarantees

๐Ÿ“ธ Example Output

Scanning 12/120: payroll.xlsx โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 100%

SCAN RESULTS (BASIC)

[PUBLIC ] payroll_2024.xlsx
          โ†’ anyone with link (reader)

[SHARED ] team_notes.docx
          โ†’ shared with 3 user(s)

[PRIVATE] personal.txt
          โ†’ only accessible by owner

Summary:
  Total files: 120
  Public: 5
  Shared: 18
  Private: 97

โš™๏ธ Installation

pip install data-leak-inspector

๐Ÿงช Run with Demo Data

dli scan --demo

โ˜๏ธ Google Drive Setup

1. Create credentials

  • Go to Google Cloud Console
  • Enable Google Drive API
  • Create OAuth credentials (Desktop app)
  • Download credentials.json

2. Place credentials

Create the directory:

~/Documents/dli/

Add:

credentials.json

3. Run scan

dli scan --gdrive

On first run:

  • Browser will open for authentication
  • A token.json file will be created

๐Ÿงพ CLI Usage

dli scan [OPTIONS]

Options

Option Description
--demo Use built-in demo dataset
--gdrive Scan Google Drive
--verbose Show debug logs
--quiet Show only errors
--report Export results to JSON

๐Ÿ“ Project Structure

leak_inspector/
โ”œโ”€โ”€ application/
โ”‚   โ”œโ”€โ”€ scanner.py
โ”‚   โ”œโ”€โ”€ risk_evaluator.py
โ”‚   โ””โ”€โ”€ ports/
โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ models.py
โ”‚   โ”œโ”€โ”€ enums.py
โ”‚   โ””โ”€โ”€ reporting.py
โ”œโ”€โ”€ infrastructure/
โ”‚   โ”œโ”€โ”€ storage/
โ”‚   โ””โ”€โ”€ gdrive/
โ”œโ”€โ”€ interfaces/
โ”‚   โ””โ”€โ”€ cli/

๐Ÿ” Exposure Levels

Level Description
PUBLIC Accessible by anyone with link
SHARED Shared with specific users/groups
PRIVATE Only accessible by owner

๐Ÿ“œ Changelog

All notable changes to this project are documented in the CHANGELOG.md file.

We follow the conventions defined by Keep a Changelog and adhere to Semantic Versioning. Each release includes categorized changes such as:

  • Added for new features
  • Changed for updates to existing behavior
  • Fixed for bug fixes
  • Security for vulnerability patches

An Unreleased section is also maintained to track upcoming changes before they are officially released.

When upgrading, we recommend reviewing the changelog to understand new features, bug fixes, and any potential breaking changes.

๐Ÿง  Philosophy

DLI is designed to:

  • โœ” Minimize permissions
  • โœ” Respect user privacy
  • โœ” Deliver fast insights
  • โœ” Be transparent in analysis

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data_leak_inspector-0.2.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_leak_inspector-0.2.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file data_leak_inspector-0.2.0.tar.gz.

File metadata

  • Download URL: data_leak_inspector-0.2.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for data_leak_inspector-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8eec72dc84dbf531a3613c90ce5980b3d8577e7403d791f1fb526976e975b5c
MD5 b31e5cdf96a439a220bf4456a51f7f7e
BLAKE2b-256 41769d47262c3e6347ed73cfe97106442c8be790956906c3eba2453d78731841

See more details on using hashes here.

File details

Details for the file data_leak_inspector-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for data_leak_inspector-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 239ef09f5add09c82e923deab0be2176b93599d78f7a8b778f68f5f382107507
MD5 6b703a9d4883f4d3321a5e7011dbe03c
BLAKE2b-256 638a0c332e5d270b19f200da6072c6cc7999bfbed50cbbf5be4ac65da45990c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page