LANspector Documentation#

LANspector is an open-source Python library, CLI, and optional web dashboard for auditing unstructured network fileshares and local filesystems:

  1. Harvest complete filesystem metadata & ACLs into SQLite: Capture atime, ctime, mtime, sizes, owners, MD5 digests, PII indicators, NTFS/SMB share DACLs (Windows), Active Directory group memberships (Windows), and POSIX permissions (Linux/macOS) into timestamped SQLite tables for longitudinal drift analysis.

  2. Generate losslessly compressed SOX permission-diff Excel workbooks: The parent_vs_child_report() algorithm compresses hundreds of thousands of folders down to only permission boundaries, while the file_vs_folderACL sheet catches individual files with broader access than their containing folder.

  3. Accelerate storage cleanup with interactive Plotly sunbursts & LANdash: Export offline-ready interactive Plotly sunburst HTML charts colored by last-access staleness, or serve the optional lanspector[dashboard] multi-share web app.

Windows SMB shares, Active Directory groups, POSIX filesystems, and SQLite crawl snapshots flow through LANspector into SOX permission-diff Excel reports, interactive Plotly storage sunbursts, and LANdash

Quick Start#

# Crawl a folder or Windows UNC share and generate an Excel audit workbook + sunburst chart
lanspector crawl --path /srv/shares/finance --fout finance.db --summarize true --sunburst_html sunburst.html

# Generate a full multi-sheet Excel audit workbook from one or more crawl databases
lanspector report --databases '[finance.db]' --output finance_audit.xlsx

# Export an interactive Plotly storage sunburst chart colored by staleness
lanspector sunburst --database finance.db --output finance_sunburst.html --color_by age

Or from Python:

from lanspector import CrawlReader, crawl, export_sunburst_html, generate_fileshare_report

crawl("/srv/shares/finance", fout="finance.db", scantype="fd", permissions=True)
with CrawlReader("finance.db") as db:
    pvc = db.parent_vs_child_report(use_permission_hierarchy=True)
    generate_fileshare_report(db, "finance_audit.xlsx")
    export_sunburst_html(db, "finance_sunburst.html", color_by="age")

Contents#

Indices and tables#