feat(guard): comprehensive audit logging system for guard scan decisions#900
Open
Pcmhacker-piro wants to merge 1 commit into
Open
feat(guard): comprehensive audit logging system for guard scan decisions#900Pcmhacker-piro wants to merge 1 commit into
Pcmhacker-piro wants to merge 1 commit into
Conversation
…cisions - Add ip_address column to GuardScanLog model for origin tracking - Create Alembic migration e7d9f2b3c4a5 for the new column - Add GuardAuditLogResponse Pydantic schema in schemas/audit_log.py - Capture and persist client IP address in /guard/scan and /guard/scan/batch endpoints - Add GET /api/v1/analytics/audit-logs endpoint with offset pagination and filters (user_id, decision, days) Closes SdSarthak#574
Author
|
the checks have passed. Could you please review and approve the pending workflows when you have a chance? Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #574
Implements a comprehensive database-backed audit logging system for all POST /guard/scan decisions. Every scan event now captures the client IP address alongside existing scan metadata. A new GET /api/v1/analytics/audit-logs endpoint provides security admins with paginated, filterable access to the audit trail.
Type of Change
Checklist
CHANGED FILES
COMMITS
TESTING PERFORMED
python3 -m pytest tests/test_guard_api.py tests/test_audit_logs.py tests/test_guard_stats.py tests/test_analytics_summary.py -v --tb=short
10 passed, 6 failed / 5 errors (all pre-existing — missing numpy dependency, test infrastructure issues unrelated to changes)
FINAL STATUS