Feat/siam audit events#969
Conversation
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a privacy-preserving SIAM (Security Information and Analytics Management) audit logging system for the VC-AuthN OIDC controller. The implementation adds structured event logging at key points in the authentication and verification flow while maintaining strict privacy guarantees—no PII, credential values, or subject identifiers are ever logged. The feature is enabled by default but can be disabled via environment variable or log level configuration.
Changes:
- Added new audit logging module (
api/core/siam_audit.py) with privacy-preserving event tracking for session lifecycle, proof verification, token issuance, and security events - Integrated audit calls across routers (oidc.py, presentation_request.py, acapy_handler.py) to capture key workflow events with metadata-only logging
- Updated configuration and documentation to explain audit events, feature flags, and privacy guarantees
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
oidc-controller/api/core/siam_audit.py |
New audit logging module with privacy-safe helper functions and event emitters for 10 different audit event types |
oidc-controller/api/routers/oidc.py |
Added audit calls for auth session initiation, proof request creation, and token issuance; improved import ordering |
oidc-controller/api/routers/presentation_request.py |
Added audit calls for QR code and deep link scanning events; reorganized imports |
oidc-controller/api/routers/acapy_handler.py |
Added audit calls for webhook receipt, proof verification (success/failure), and session termination; added schema/issuer extraction functions; improved privacy by moving full webhook body logging to debug level |
oidc-controller/api/logconf.json |
Configured siam.audit logger with INFO level and separate handler |
docs/ConfigurationGuide.md |
Comprehensive documentation of SIAM audit events, configuration options, privacy guarantees, and control mechanisms |
oidc-controller/api/routers/tests/test_acapy_handler.py |
Updated test fixture to include ver_config_id field; reorganized imports alphabetically |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Pull Request Test Coverage Report for Build 22197536649Details
💛 - Coveralls |
Gavinok
left a comment
There was a problem hiding this comment.
Just a few clarifications and nits.
|
@esune is there a spec for what data/fields/events/etc any auditors or security is wanting from this? Or is what is being extracted our choice? |
No spec, as far as I understand data related to IP addressed (even hashed as we do here) and events (type/start/end) is the bare minimum. We're really just looking to surface things for now and possibly gather more feedback and input once it is being used (that's my take at least). |
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
First attempt at logging information usable by SIAM platforms, when needed.
Logger is on by default, can be turned of using an environment variable or by updating the log level configuration.
Currently these events are being logged:
auth_session_initiatedsession_id,client_id,ver_config_id,client_ip_hash,user_agent_family,requested_schemas,requested_attributes_count,requested_predicates_countproof_request_createdsession_id,ver_config_id,proof_name,requested_schemas,expected_issuersqr_scannedsession_id,scan_method(qr_code/deep_link),client_ip_hash,user_agent_familyproof_verifiedsession_id,ver_config_id,outcome=verified,credential_schemas,issuer_dids,credential_count,revocation_checked,duration_msproof_verification_failedsession_id,ver_config_id,outcome=failed,failure_category,duration_mssession_abandonedsession_id,ver_config_id,outcome=abandoned,phase,duration_mssession_expiredsession_id,ver_config_id,outcome=expired,phase,timeout_secondstoken_issuedsession_id,client_id,ver_config_id,claims_count,duration_mswebhook_receivedwebhook_topic,webhook_state,webhook_roleinvalid_client_requestclient_id,error_type,client_ip_hash