Overview
SecurAtlas uses Supabase Edge Functions (Deno runtime) for operations that require external API calls, long-running processing, or elevated permissions. All functions live insupabase/functions/.
Function Catalog
sync-azure-ad
Syncs users, groups, MFA status, and conditional access policies from Microsoft Entra ID.
sync-google-workspace
Syncs users, 2SV status, admin roles, and device policies from Google Workspace.
sync-aws
Syncs IAM users, roles, MFA devices, and security configurations from AWS.
trigger-sync
Dispatcher that routes sync requests to the appropriate provider function.
process-integration-jobs
Processes queued integration sync jobs from
integration_sync_jobs.evidence_classify
Uses Anthropic Claude to classify uploaded evidence and suggest control mappings.
evidence_signed_upload
Generates presigned URLs for direct-to-storage evidence uploads.
evidence_finalize_upload
Finalizes an evidence upload: updates metadata, triggers classification.
send-invite
Sends invitation emails for tenant and partner membership invites.
Deployment
Deploy all functions:Configuration
verify_jwt Settings
JWT verification is configured per function insupabase/config.toml:
Functions called by
pg_cron via pg_net or by webhook handlers typically set verify_jwt = false because there is no user session. These functions must validate requests through other means (e.g., checking a shared secret header).Environment Secrets
Edge Functions access secrets viaDeno.env.get():
Function Details
trigger-sync
The central dispatcher for all integration syncs:evidence_classify
Sends evidence content to Anthropic Claude for classification:- Reads the evidence file from Supabase Storage
- Sends content to Claude with a system prompt describing available controls
- Parses the response for control mappings and tags
- Updates
tenant_evidence_itemswith classification results - Creates suggested
control_evidence_links
Sync Functions (azure-ad, google-workspace, aws)
All sync functions follow a common pattern:Shared Modules
Common utilities are shared across functions via thesupabase/functions/_shared/ directory: