name: logs-audit description: Generate a targeted SimpleMDM device-activity log export (legal/forensic) for selected devices — logs CSV (typed/ISO/sorted), status-snapshot CSV with externalized JSON sidecars, per-device summary/coverage, raw JSON, SHA-256 manifest, and a detailed combined dossier report in md/html/docx/pdf. Use when asked to export device logs, build a device activity/forensic/legal log report, or audit a device's /logs.
SimpleMDM Logs Audit
Targeted sibling to the SOFA /audit. Runs the engine and reports where files landed. Do NOT commit the output.
Steps
- Determine the selector from the request and map to exactly one flag:
- a serial (or several) →
--serial A,B - "last N seen" / "most recently seen" →
--last-seen N - a group name →
--group "Name" - "whole fleet" / "all devices" →
--all --confirm-all
- a serial (or several) →
- Map optional combines:
--with-securityadds SOFA-based security posture (security-posture.csv,device-cves.csv) for selected devices.--with-inventoryadds per-device app and profile snapshots (inventory.csv,apps.csv,profiles.csv). Both flags are supported on the unified CLI:node dist/reports/cli.js logs <selector> [--with-security] [--with-inventory]. - Map format words: "csv" →
--format csv, "word"/"docx" →--format docx, "markdown"/"md" →--format md, else--format all. "just the report"/"no data exports" → add--report-only(report + manifest + summary only; not valid with--format csv).- Detail level: "full logs"/"every log"/"full event table" →
--report-detail full(ortable); default issummary.
- Detail level: "full logs"/"every log"/"full event table" →
- Run:
node dist/reports/cli.js logs <flags> - Read
<outDir>/summary.txtand relay the headline (devices, total events, failed devices). - List the generated files. Remind the user the output is local-only (gitignored) and not committed.
Report (--format all)
Produces a detailed combined dossier in four formats — report.md, report.html, report.docx (pandoc), report.pdf. The PDF is a US-Letter portrait document (styled by the unified engine theme, src/reports/engine/theme.ts); it prefers WeasyPrint (real footer page numbers, "Page X of Y") and falls back to headless Chrome if WeasyPrint isn't installed (brew install weasyprint). Each device gets identity, security posture (with --with-security), activity breakdown + coverage window, a top-installed-apps table, notable software-update events, software inventory (with --with-inventory), and an auto-detected ⚠ Findings block (app-reinstall loops, software-update-failure loops, profile churn — also in findings.csv), plus a fleet roll-up. --report-detail controls how much raw per-device log detail is printed (summary/table/full). report.docx/.html/.pdf are best-effort: missing tooling logs a warning and skips (md still written). --format md writes md only; --format docx writes md + docx.
Notes
- Read-only: a read-only
SIMPLEMDM_API_KEYin.envis sufficient. - Timestamps are in the account display timezone (America/New_York), reproduced verbatim plus an ISO
at_isocolumn — NOT UTC. The/logsfeed is retention-bounded; the per-device window is inlogs-summary.csv. - Full
status.changedsnapshots are externalized tostatus-snapshots/<serial>__<logid>.json(thelogs-status-snapshots.csvstatus_json_filecolumn points to each) so no spreadsheet cell is truncated; each sidecar is SHA-256-hashed in the manifest. --allis heavy (one log fetch per device) and requires--confirm-all.