AuditSphere (Web App)
Architecture Overview

AuditSphere - Architecture Overview

Executive Summary

AuditSphere is a cloud-native security and compliance monitoring platform designed for Microsoft 365 SharePoint and OneDrive environments. The application provides real-time audit monitoring, machine learning-powered anomaly detection, compliance assessments, and access review workflows.


System Architecture

High-Level Architecture Diagram


Component Overview

1. Frontend Layer

Technology Stack:

  • Modern React-based web framework with server-side rendering
  • Component-based UI architecture with reusable design system
  • Utility-first CSS framework for responsive styling
  • Client-side state management with data fetching optimization
  • Chart visualization library for metrics and dashboards

Key Characteristics:

  • Single Page Application (SPA) with server-side rendering for SEO and performance
  • Responsive design supporting desktop and tablet viewports
  • Real-time data updates with optimistic UI patterns
  • Accessible UI components following WCAG guidelines

2. Backend Layer

Technology Stack:

  • Full-stack web framework with API routes and server-side rendering
  • Type-safe API layer with automatic client/server type synchronization
  • Database ORM with type-safe query building
  • Data validation library for request/response validation
  • Structured logging framework for observability

Key Characteristics:

  • Serverless-compatible architecture for cloud deployment
  • Type-safe end-to-end development from database to UI
  • Middleware-based request processing pipeline
  • Background job processing for scheduled tasks

3. Data Layer

Primary Database:

  • PostgreSQL relational database (cloud-hosted)
  • Schema migrations with version control
  • Encrypted storage for sensitive credentials

Caching Layer:

  • In-memory or distributed cache for rate limiting
  • Session storage for authentication tokens

4. Machine Learning Service

Technology Stack:

  • Python-based ML service with REST API
  • Isolation Forest algorithm for anomaly detection
  • Automatic model retraining from operational data

Key Characteristics:

  • Separate microservice for ML workloads
  • Feature engineering from audit event data
  • Configurable detection thresholds and sensitivity

5. External Integrations

Microsoft 365 Integration:

  • Microsoft Graph API for SharePoint/OneDrive access
  • Office 365 Management API for audit log collection
  • Webhook subscriptions for real-time event notifications

Authentication:

  • OAuth 2.0 / OpenID Connect identity provider
  • JWT-based session management
  • Multi-tenant support

Data Flow Architecture

Audit Event Collection Flow

Access Review Workflow


Security Architecture

Authentication Flow

Security Controls

LayerControlDescription
AuthenticationOAuth 2.0 + PKCESecure user authentication via identity provider
SessionJWT TokensStateless session management with secure cookies
APIProtected ProceduresMiddleware-enforced authentication checks
DataEncryption at RestMicrosoft tokens encrypted in database
TransportTLS 1.3All communications encrypted in transit
Rate LimitingToken BucketProtection against abuse and DoS

Database Schema Overview

Entity Relationship Diagram

Core Entity Groups

User Management:

  • Users with role-based access (Admin, Analyst, Viewer)
  • Microsoft 365 connection credentials (encrypted)
  • User preferences and notification settings

Audit & Monitoring:

  • Audit events from Microsoft 365
  • Anomaly detection results
  • Security alerts and notifications

Compliance:

  • Compliance check definitions and results
  • Compliance run history with aggregated scores

Access Review:

  • Review campaigns with configurable scope
  • Permission items with review decisions
  • Scheduled recurring reviews
  • Designated resource owners

Reporting:

  • Generated reports with file storage
  • Scheduled report configurations

Deployment Architecture

Cloud Infrastructure

Scalability Considerations

  • Horizontal Scaling: Serverless architecture auto-scales with demand
  • Database Scaling: Connection pooling and read replicas supported
  • Caching: Distributed cache reduces database load
  • Background Processing: Scheduled jobs run independently of user requests

Integration Points

Microsoft 365 APIs

APIPurposeData Retrieved
Microsoft GraphSharePoint/OneDrive accessSites, Files, Permissions, Users
Office 365 ManagementAudit log collectionSecurity events, User activities

Integration Architecture

Required Microsoft 365 Permissions

  • AuditLog.Read.All - Read audit logs
  • Directory.Read.All - Read directory data
  • Sites.Read.All - Read SharePoint sites
  • User.Read.All - Read user profiles
  • SecurityEvents.Read.All - Read security events

Monitoring & Observability

Application Monitoring

  • Error tracking and alerting via monitoring service
  • Structured logging with correlation IDs
  • Performance metrics and tracing

Health Checks

  • Database connectivity verification
  • External API connectivity status
  • ML service availability

Compliance & Standards

Supported Compliance Frameworks

  • CIS Microsoft 365 Foundations Benchmark
  • Custom compliance standards (configurable)

Audit Capabilities

  • Complete audit trail of user actions
  • Immutable event logging
  • Report generation for compliance evidence

Technology Summary

ComponentCategoryPurpose
Web FrameworkFull-stack JavaScriptServer-side rendering, API routes, deployment
UI LibraryComponent FrameworkReusable, accessible UI components
StylingUtility CSSResponsive, maintainable styling
API LayerType-safe RPCEnd-to-end type safety between client and server
Database ORMQuery BuilderType-safe database access with migrations
ValidationSchema LibraryRequest/response validation with type inference
AuthenticationOAuth ProviderSecure user authentication
ML FrameworkPython MLAnomaly detection and model training
MonitoringError TrackingApplication health and error monitoring

Document Information

PropertyValue
Version1.0
Last UpdatedDecember 2025
ClassificationClient Documentation