LedgerCast is designed to be a template you can adapt for your own internal audit work. While the project models common SOX ITGC control categories (Access Management, Change Management, Backup & Recovery), the pattern easily generalizes to other control types (e.g., IT Operations, Job Scheduling, Password Configurations).
To add a new control test, follow this pattern:
- Create the Script: Copy the structure of an existing test (e.g.,
ledgercast/test_access_management.py). - Define Metadata: Set your
CONTROL_IDandCONTROL_OBJECTIVEconstants at the top of the file. - Write the Test Logic: In your
run_test(data_dir)function, read your custom CSV, implement the logic to identify exceptions, and return a tuple of(population_size, list_of_exceptions). - Wire it Up: Add your new script to the
testsarray insideledgercast/run_all_tests.pyso theledgercast testcommand automatically picks it up.
The ledgercast CLI is built to run against external datasets without editing the code. Simply point the CLI to a directory containing your CSVs using the --data-dir flag:
ledgercast test --data-dir /path/to/your/audit/dataMake sure your CSV files have the same required schemas (see data/README.md).
If you modify or add new controls, ensure you document them in the Risk & Control Matrix (docs/RCM.md). Maintain the existing markdown table structure:
| Control ID | Control Objective | Control Description | Test Procedure | Frequency | Risk Rating | Test Result |
LedgerCast maintains persistent state for all identified exceptions.
The authoritative store is data/findings_state.json. Any updates made via the ledgercast findings CLI commands are written directly to this file.
The dashboard copy is docs/sample-data/findings_state.json. Because the dashboard is hosted as a static site (e.g., GitHub Pages) from the docs/ directory, it cannot read files outside of its root. To solve this, ledgercast test automatically copies the latest authoritative store to the docs/sample-data/ folder at the end of every run.
Note: Treat docs/sample-data/findings_state.json purely as a read-only build artifact for the dashboard. Do not edit it directly.