LANdash Web Dashboard#
SQLite data store and ETL pipeline backing the optional LANdash web dashboard.
- class lanspector.dashboard.data_prep.LanDashStore(db)[source]#
Bases:
objectSQLite-backed analytical store serving the LANdash web dashboard.
- Parameters:
- db
Path to a LANdash SQLite database or an existing SQLAlchemy
Engine.
- Parameters:
db (str | pathlib.Path | Engine)
Return all fileshares registered in
fileshares.
- get_acl_membership(crawl_date=None, acl_names=None)[source]#
Query ACL group membership records with resolved principal names.
- Parameters:
- crawl_date
Optional ISO crawl date filter.
- acl_names
Optional list of ACL group names to filter.
- Returns:
- pandas.DataFrame
DataFrame with
crawlDate,acl_domain,acl_name,member_domain,member_name, andnested_acl.
- Parameters:
- Return type:
- get_crawl_data(crawl_date=None, domains=None, hosts=None, acl_domains=None, acl_names=None, permissions=None)[source]#
Query joined parent-vs-child permission timeline rows with optional filters.
- Parameters:
- crawl_date
Optional exact ISO crawl date.
- domains
Optional list of fileshare domains.
- hosts
Optional list of fileshare hostnames.
- acl_domains
Optional list of ACL domains.
- acl_names
Optional list of ACL principal names.
- permissions
Optional list of permission codes (e.g.
["R", "M", "F"]).
- Returns:
- pandas.DataFrame
Filtered permission records.
- Parameters:
- Return type:
- load_sunburst_data(domains=None, hosts=None, folder_filter=None, limit=500)[source]#
Query directory storage sizes and access dates for the dashboard sunburst panel.
- Parameters:
- domains
Optional list of fileshare domains.
- hosts
Optional list of fileshare hosts.
- folder_filter
Optional case-insensitive substring filter applied to
subdir.- limit
Maximum rows ordered by
sizedescending.
- Returns:
- pandas.DataFrame
DataFrame with
path,domain,host,share,subdir,size, andmax_atime.
- Parameters:
- Return type:
- lanspector.dashboard.data_prep.generate_dashboard_data(databases, include_ntfs=True, include_acls=True, include_sunburst=True)[source]#
Extract normalized permission, membership, and sunburst tables from crawl databases.
- Parameters:
- databases
Sequence of LANspector SQLite crawl database paths.
- include_ntfs
Extract melted parent-vs-child permission snapshots.
- include_acls
Extract ACL group membership records when present.
- include_sunburst
Extract directory storage & access-time records for sunburst charts.
- Returns:
- tuple[pandas.DataFrame, pandas.DataFrame, pandas.DataFrame]
Three DataFrames:
(access_df, membership_df, sunburst_df).
- Parameters:
- Return type:
- lanspector.dashboard.data_prep.commit_data_to_database(store, access_df=None, membership_df=None, sunburst_df=None)[source]#
Persist extracted dashboard DataFrames into a
LanDashStoreSQLite database.- Parameters:
- store
Open
LanDashStoreor path to a LANdash SQLite database.- access_df
Parent-vs-child permission timeline DataFrame.
- membership_df
ACL membership DataFrame.
- sunburst_df
Directory size and last-access DataFrame.
- Parameters:
- Return type:
None
- lanspector.dashboard.data_prep.create_dashboard_tables(engine)[source]#
Create the normalized LANdash SQLite schema if tables do not already exist.
- Parameters:
- engine
SQLAlchemy 2.x engine pointing to the LANdash SQLite database.
- Parameters:
engine (Engine)
- Return type:
None
Neutral reusable Dash 3+ UI components and palette helpers for LANdash.
- lanspector.dashboard.components.autoscale_bytes(value)[source]#
Determine the binary power-of-2 exponent and unit label for value bytes.
- lanspector.dashboard.components.get_series_color(index)[source]#
Return a deterministic neutral hex color for series index.
- lanspector.dashboard.components.indicator_card(title, value, card_id=None)[source]#
Build a clean KPI card component for the LANdash executive summary row.
Build a neutral top navigation bar for LANdash.
- lanspector.dashboard.components.section_card(title, children, open_by_default=True)[source]#
Wrap children inside a native HTML
<details>collapsible panel.- Parameters:
- title
Section heading shown in the summary bar.
- children
Dash components rendered inside the section body.
- open_by_default
Whether the section starts expanded.
- Returns:
- dash.html.Details
Collapsible section container.
- Parameters:
- Return type:
Modern Dash 3+ / Plotly 6+ LANdash web application (offline/air-gapped ready).
Replaces legacy Dash 0.42 + vendored React components (dash_sunburst, dash_network)
with native Plotly plotly.graph_objects.Sunburst and plotly.graph_objects.Scatter
network visualizations served locally (serve_locally=True) for restricted corporate LANs.
- lanspector.dashboard.app.create_app(db_path)[source]#
Create and configure the LANdash
dash.Dashapplication.- Parameters:
- db_path
Path to a prepared LANdash SQLite database created via
commit_data_to_database().
- Returns:
- dash.Dash
Configured Dash 3+ application ready to serve locally or via WSGI.
- Parameters:
- Return type:
- lanspector.dashboard.app.run_dashboard(settings)[source]#
Launch the LANdash web server from settings.
- Parameters:
- settings
Parsed CLI / configuration settings for
lanspector dashboard.
- Returns:
- int
Exit status code (
0on clean shutdown,1if DB is missing).
- Parameters:
settings (DashboardServeSettings)
- Return type:
- lanspector.dashboard.app.build_acl_network_figure(members_df)[source]#
Render an interactive Plotly graph of ACL groups connected to their members.
- Parameters:
- members_df
DataFrame returned by
get_acl_membership().
- Returns:
- plotly.graph_objects.Figure
Plotly scatter/edge network figure.
- Parameters:
members_df (DataFrame)
- Return type:
Figure
- lanspector.dashboard.app.build_dashboard_sunburst_figure(burst_df)[source]#
Build a native Plotly
go.Sunburstfigure fromdashburstrows.- Parameters:
- burst_df
DataFrame returned by
load_sunburst_data().
- Returns:
- plotly.graph_objects.Figure
Interactive Plotly Sunburst figure.
- Parameters:
burst_df (DataFrame)
- Return type:
Figure
- lanspector.dashboard.app.build_permission_pie_figure(snap_df)[source]#
Build a pie chart showing the breakdown of permission levels in the snapshot.
- Parameters:
- snap_df
Filtered parent-vs-child snapshot DataFrame.
- Returns:
- plotly.graph_objects.Figure
Plotly pie figure.
- Parameters:
snap_df (DataFrame)
- Return type:
Figure
- lanspector.dashboard.app.build_timeline_figure(timeline_df)[source]#
Build a time-series line chart of permission diff counts by crawl date.
- Parameters:
- timeline_df
Parent-vs-child records across all available crawl dates.
- Returns:
- plotly.graph_objects.Figure
Plotly line chart grouped by permission code.
- Parameters:
timeline_df (DataFrame)
- Return type:
Figure