Library / Security & Compliance
Security & Compliance
Monitor external attack surface changes with OpenAI, Postgres and Slack
Runs on a schedule, scans external discovery sources, stores raw observations in Postgres and alerts on Slack and email when exposed assets change.
What it does
## Attack Surface Change Monitor (Event-Sourced) ### How it works This workflow periodically scans configured external discovery sources and treats every scan as a stream of observations, not a snapshot. Raw observations are stored as-is (append-only), then resolved against a persistent asset identity table — multiple sources (subdomain enum, exposure scan, cloud inventory) can point at the same real-world asset, and resolution merges them onto one asset_id using deterministic identity rules (IP+port, hostname, cloud ARN, etc). From resolved observations we build the current state of each asset (latest known attributes) and diff it against the asset's previous state to generate discrete change events (asset.new, service.added, service.removed, cloud_resource.added, risk.increased via isRiskIncrease, attribute.changed, asset.decommissioned) rather than one generic diff. Every event is persisted to an append-only attack_surface_events table (full history preserved). Each event is risk-scored deterministically, then an AI agent is used purely to explain/triage — it narrates why the event matters, it does not decide what changed or how severe it is. A separate policy engine node then decides routing (Slack / email / log / compliance) based on severity, event type, and org policy — decoupled from both the risk scoring and the AI narrative. ### Setup steps - Configure the schedule trigger for desired scan frequency. - Update the configuration node with root domains and discovery API URLs. - Create Postgres tables: attack_surface_observations (raw, append-only), attack_surface_assets (resolved identity + current state), attack_surface_events (append-only change history). - Configure OpenAI credentials for the AI triage agent. - Configure Slack/email credentials and the policy engine's routing rules. ### Customization Adjust identity-resolution rules, event-type detection logic, severity scoring, and the policy engine's routing table independently — each is now its own node/stage.
The steps
- When Attack Surface Scan Scheduled
- Set Configuration Parameters
- Fetch Subdomain Data
- Fetch Exposed Services Data
- Fetch Cloud Asset Inventory
- Merge Discovery Sources
- Build Raw Observations
- Persist Raw Observations
- Load Known Asset Identities
- Merge Observations With Identities
- Resolve Assets Across Sources
- Build Current State Per Asset
- Load Previous Asset State
- Pair Current With Previous State
28 steps in total.
Similar automations
Security & ComplianceAnonymize PII in incoming webhook payloads via external detection API12 stepsMonitoring, Ops & IncidentsFind broken external links in WordPress posts and email report via Gmail11 stepsEmail AutomationGate personal data before external sends with Jev, Google Sheets, Gmail, Telegram and28 stepsAlerts & NotificationsSend client matter status updates from Clio by webhook and SMTP email26 steps