Claude 24f816b6a3
Consolidate 22 sibling repos into layered organism structure
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):

- brain/        LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
                dispatch, A51 channels, and the OSINT cluster
- knowledge/    LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
                MITRE ATT&CK data
- reference/    defensive threat-reference (C3, shhbruh doc) + AdaYaml parser

License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.

Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.

https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
2026-06-10 06:53:01 +00:00

2.4 KiB

Email Account Compromise Detection API Reference

Microsoft Graph API Endpoints

List Inbox Rules

GET https://graph.microsoft.com/v1.0/users/{userId}/mailFolders/inbox/messageRules
Authorization: Bearer {token}

Get Sign-In Logs

GET https://graph.microsoft.com/v1.0/auditLogs/signIns
  ?$filter=createdDateTime ge {startDate}
  &$top=100
Authorization: Bearer {token}

Risk Detections (Azure AD P2)

GET https://graph.microsoft.com/v1.0/identityProtection/riskDetections
  ?$filter=riskLevel eq 'high'
Authorization: Bearer {token}

OAuth2 Permission Grants

GET https://graph.microsoft.com/v1.0/oauth2PermissionGrants
Authorization: Bearer {token}

Authentication with MSAL

from msal import ConfidentialClientApplication

app = ConfidentialClientApplication(
    client_id="<app-id>",
    client_credential="<secret>",
    authority="https://login.microsoftonline.com/<tenant-id>"
)
token = app.acquire_token_for_client(scopes=["https://graph.microsoft.com/.default"])
headers = {"Authorization": f"Bearer {token['access_token']}"}

Inbox Rule Compromise Indicators

Indicator Field Description
External forwarding actions.forwardTo Rule forwards to external domain
External redirect actions.redirectTo Rule redirects to external address
Auto-delete actions.delete Rule auto-deletes matching messages
Financial keywords conditions.subjectContains Targets "invoice", "payment", "wire"

Sign-In Risk Indicators

Signal Detection Method
Impossible travel Haversine distance / time > 900 km/h
Suspicious UA python-requests, curl, PowerShell in userAgent
Unfamiliar location New country/region for user
Token replay Same token from different IPs

CLI Usage

python agent.py --input audit_data.json --output report.json

Required API Permissions

  • Mail.Read - Read inbox rules
  • AuditLog.Read.All - Read sign-in and audit logs
  • IdentityRiskEvent.Read.All - Read risk detections
  • Directory.Read.All - Read OAuth permission grants

References