PyQt6 desktop application for unified email security monitoring and diagnostics.
Combines multiple email security data sources with AI-powered analysis:
- Abnormal Security - Threat detection, cases, abuse mailbox campaigns
- Microsoft Graph - Mail flow, inbox rules, OAuth app monitoring
- Claude AI - Intelligent triage and pattern detection via Azure APIM
- Real-time dashboard with threat metrics
- Threat and case browsing with detail views
- Built-in diagnostic engine (15+ security checks)
- AI-powered threat analysis and batch pattern detection
- Executive summary report generation
- Edge Solutions branded interface
| Category | Rules |
|---|---|
| Authentication | SPF PermError, DKIM missing, DMARC failures |
| Mail Flow | Connector loops, queue delays, Enhanced Filtering |
| Threat Detection | HTML smuggling, QR phishing, OAuth consent, inbox rules |
| Integration | Token expiry, rate limiting, sync delays |
- Python 3.11+
- Azure AD App Registration with Graph permissions
- Abnormal Security API key
- Azure APIM subscription key (for Claude)
git clone https://github.com/glennbezanson/email-security-analyzer.git
cd email-security-analyzer
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtcp config.example.json config.json
# Edit config.json with your credentials| Permission | Type | Purpose |
|---|---|---|
| Mail.Read | Application | Read mail messages |
| MailboxSettings.Read | Application | Read inbox rules |
| AuditLog.Read.All | Application | Read audit logs |
| Directory.Read.All | Application | Read user/domain info |
python main.py- Tenant: edge-solutions.com (YOUR_TENANT_ID)
- APIM: YOUR_APIM_ENDPOINT.azure-api.net/foundry
- AI Services: edgesol-ai
email-security-analyzer/
βββ main.py # Application entry point
βββ config.json # User configuration (gitignored)
βββ config.example.json # Example configuration
βββ requirements.txt # Python dependencies
βββ core/ # Core modules
β βββ config.py # Configuration management
β βββ cache.py # SQLite cache
β βββ workers.py # QThread workers
βββ api/ # API clients
β βββ abnormal.py # Abnormal Security
β βββ graph.py # Microsoft Graph
β βββ claude.py # Claude AI via APIM
βββ diagnostics/ # Diagnostic engine
β βββ rules.py # Rule definitions
β βββ engine.py # Rule evaluation
βββ ui/ # PyQt6 interface
βββ styles.py # Edge Solutions branding
βββ main_window.py # Main window
βββ widgets/ # Reusable widgets
βββ views/ # Application views
βββ dialogs/ # Dialog windows
Generate API key:
- Go to Abnormal portal > Settings > Integrations
- Select REST API
- Generate new token
Required scopes for application permissions:
Mail.ReadMailboxSettings.ReadAuditLog.Read.AllDirectory.Read.All
Uses Azure APIM endpoint for Claude access:
- Endpoint:
https://YOUR_APIM_ENDPOINT.azure-api.net/foundry - Auth: APIM subscription key
Glenn Bezanson - Edge Solutions glenn.bezanson@edge-solutions.com
Edge Solutions LLC