Audit logging for configuration changes
Skill HimanshuJ16/Algo-Trading-Skills/skills/audit-logging-for-configuration-changes
Immutable audit logging engine enforcing SEC Reg SCI and FINRA Rule 3110 compliance for algorithmic trading configuration changes.From its SKILL.md
npx -y skills add HimanshuJ16/Algo-Trading-Skills --skill audit-logging-for-configuration-changesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.1 KB, as published. Nobody here has run it
When to Use
Use this skill to track modifications to live trading algorithms, risk parameters, and system configurations. FINRA Rule 3110 (Supervision) and Regulatory Notice 15-09 require a documented change-management process for algorithmic trading code and risk-control parameter settings, including records of approvals and reasoning. SEC Rule 17a-4 imposes WORM-style retention for broker-dealer records. SEC Regulation SCI applies directly only to "SCI entities" (SROs, certain ATSs, plan processors, certain exempt clearing agencies); a 2023 SEC proposal would extend it to certain large broker-dealers. Firms not mandated by SCI nonetheless commonly adopt SCI-style controls voluntarily.
This engine intercepts configuration updates, validates that a justification and authenticated principal are present, and formats the change into a compliance-ready, tamper-evident JSON audit log. Use it for both approved changes and rejected attempts (a failed change attempt is itself a supervisory event).
When NOT to Use
- For routine application logs that are not configuration changes (use
structured-logging-for-post-incident-forensicsinstead). - For order/fill audit trails (use
data-lineage-tracking-for-audit-and-debuggingor venue CAT reporting tooling). - As a substitute for the downstream WORM/SIEM storage layer — this engine produces records; immutability is enforced by the sink.
Prerequisites
- Python 3.9+
- A centralized, append-only log storage system (e.g., Splunk, Datadog, or an AWS S3 Object Lock WORM bucket) to receive the generated log lines.
- An authenticated caller context so
user_idis always populated (e.g., SSO/JWT).
Workflow
- Intercept Update: A trader or automated system attempts to modify a configuration (e.g., increasing
max_order_sizefrom 100 to 500). Every UI, CLI, or API path that mutates a config parameter must route throughConfigurationAuditLogger.process_change_request. - Validation: The logger verifies that:
justificationis present and at leastMIN_JUSTIFICATION_LENGTHcharacters after stripping whitespace.user_idis a non-empty, authenticated principal.old_valueandnew_valueare actually different (no-op changes are recorded but not approved).
- Record Construction: The engine builds a
ConfigChangeRecordwith a high-precision UTC timestamp, the originatingenvironment, a monotonically increasingsequence_number, and a SHA-256record_hashchained to the previous record's hash viaprev_hash. - Log Emission: Approved records are emitted at INFO as
AUDIT_LOG_ENTRY; rejected attempts are emitted at WARNING asAUDIT_LOG_REJECTED. Both serialize to canonical (sorted-key) JSON for deterministic SIEM ingestion. - Integrity Verification: On examination, recompute each
record_hashfrom the serialized fields and walk theprev_hashchain; the first record whose recomputed hash differs, or whoseprev_hashdoes not match the priorrecord_hash, marks the boundary of tampering or a gap.
Common Pitfalls
- Silent Failures: Allowing configurations to be updated via a database or flat file directly without passing through an application-layer audit logger, leaving the firm blind during an examination.
- Missing Justifications: Logging that a risk limit was changed without recording why or who authorized it.
- Missing Principals: Accepting a change request without an authenticated
user_id, producing a record that cannot support supervisory attribution. - Dropping Rejected Attempts: Logging only approved changes; a rejected attempt (e.g., missing justification) is itself auditable evidence of attempted unauthorized change.
- Non-Serializable Values: Config values that are not JSON-serializable (sets, datetimes, custom objects) must not silently drop the audit record —
to_jsonusesdefault=strto guarantee emission. - Assuming JSON = Immutable: JSON is a format, not a tamper control. True immutability comes from the WORM/SIEM sink; the hash chain provides detection of tampering, not prevention.
Verification
Run python scripts/test_config_change_audit_logger.py (or python -m unittest discover -s skills/audit-logging-for-configuration-changes/scripts) to confirm that the engine: rejects un-justified / missing-principal / no-op changes; emits monotonic sequence numbers; chains prev_hash to the prior record_hash; produces deterministic sorted-key JSON; and survives non-serializable config values.
Related Skills
audit-logging-for-configuration-changesrisk-control-configuration-change-approval-workflowrisk-control-bypass-audit-loggingconfiguration-drift-detection-across-environmentsrecord-retention-periods-by-jurisdiction