Skip to content

Feature/cuasa audit system#1465

Merged
omroy07 merged 2 commits intoomroy07:mainfrom
SatyamPandey-07:feature/cuasa-audit-system
Feb 12, 2026
Merged

Feature/cuasa audit system#1465
omroy07 merged 2 commits intoomroy07:mainfrom
SatyamPandey-07:feature/cuasa-audit-system

Conversation

@SatyamPandey-07
Copy link
Contributor

@SatyamPandey-07 SatyamPandey-07 commented Feb 11, 2026

  1. Auditing Core & Intelligence
    backend/models/audit_log.py
    : A high-fidelity schema for recording security events, including differential value analysis (JSON diffs), gravity scores, and risk levels. It also includes
    UserSession
    tracking for session management.
    backend/services/audit_service.py
    : The "brain" of the audit system. Features include:
    Threat Detection: Heuristics for detecting brute-force attacks, SQL injection patterns, and automated sensitive operations.
    Forensic Analysis: Multi-vector search capabilities for security investigations.
    Behavioral Tracking: Anomaly detection by comparing current activity against historical user norms.
    Compliance Export: Generates encrypted audit trails in JSON/CSV formats.

  2. Middleware & Integration
    backend/middleware/audit.py
    : Global middleware that intercepting all state-changing requests (POST, PUT, DELETE) and sensitive paths. It also provides an @audit_request decorator for granular control over critical endpoints.
    app.py
    : Registered the audit middleware globally and initialized the system-wide tracking.
    Security Integration: Refactored
    security_utils.py
    and
    auth_utils.py
    to route all security events through the unified audit registry.

  3. Module-Specific Auditing
    Authentication (
    auth.py
    ): Audits registrations, password resets, and email verifications.
    Financial & Market (
    market.py
    ,
    loan.py
    ): Tracks market watchlist updates, manual price refreshes, and AI-driven loan eligibility checks.
    Community (
    forum.py
    ): Audits thread creation, moderation actions (flagging), and category management.
    Asset Management (
    assets.py
    ): Records high-value transactions like asset registration, failure predictions, and retirement.

  4. Administrative Interface & Automation
    audit_dashboard.html
    : A premium, real-time monitoring interface for admins featuring:
    Live interaction statistics (24h).
    Threat detection alerts with pulse animations.
    Dynamic risk distribution charts (Chart.js).
    Forensic log stream with risk-level badging.
    backend/tasks/audit_tasks.py
    : Celery tasks for automated session purging, daily forensic reporting, and audit log rotation (retention management).

closes #1460

@vercel
Copy link

vercel bot commented Feb 11, 2026

@SatyamPandey-07 is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@omroy07
Copy link
Owner

omroy07 commented Feb 12, 2026

Conflict

@SatyamPandey-07
Copy link
Contributor Author

No conflicts with base branch
Changes can be cleanly merged.

@omroy07

@omroy07 omroy07 merged commit 8156c1e into omroy07:main Feb 12, 2026
0 of 4 checks passed
@github-actions
Copy link

🎉 Congrats @SatyamPandey-07 on getting your PR merged! 🙌
Thanks for the contribution — looking forward to more from you 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralized User Activity & Session Auditing (CUASA)

2 participants