跳到正文
DEV Community· wonderpick·· 12 小時前AI 評分61

如何不用無頭瀏覽器監控 Vanta、Drata 和 SafeBase Trust Centers 的 SOC 2 認證及 AI 子處理商

Monitoring Vanta, Drata & SafeBase Trust Centers for SOC 2 and AI Subprocessors Without a Headless Browser (Solving Cloudflare 403)

AI 導讀

wonderpick 分享一套以純 HTTP 和 DNS 建立供應商 Trust Center 及 AI 子處理商監控器的做法,並稱其使用 128 MB RAM。

正文

Third-Party Risk Management (TPRM) teams spend hours manually checking vendor Trust Centers across Vanta, Drata, SafeBase, Conveyor, Whistic, Secureframe, and OneTrust just to answer three questions:

  1. Does this vendor actually hold SOC 2 Type II or ISO 27001 right now?
  2. Which SSO / IAM providers do they support (Okta, Microsoft Entra, Google Workspace)?
  3. Did they quietly add an AI subprocessor (OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, Cohere) last week?

Most automation engineers immediately reach for Puppeteer or Playwright. That costs ~500 MB–1 GB RAM per worker, triggers bot-detection gates, and slows down bulk TPRM audits to a crawl.

Here is how we built a 128 MB RAM, pure-HTTP + DNS vendor Trust Center & AI subprocessor monitor, along with a counter-intuitive fix for Cloudflare 403 blocks and strict SSRF defenses.


1. The Counter-Intuitive Fix for Cloudflare 403s: Stop Spoofing Chrome UA

When testing non-browser HTTP scrapers against modern SaaS domains, spoofing a full desktop Chrome string (Mozilla/5.0 ... Chrome/131.0.0.0 Safari/537.36) often triggers immediate HTTP 403 challenges.

Why? Modern WAFs compare your HTTP User-Agent against your TLS JA3/JA4 fingerprint and HTTP header order. When Node.js fetch claims to be Chrome 131 on Windows without Chrome's TLS cipher suites and sec-ch-ua headers, WAFs classify it as an impersonating bot.

Switching to an honest, transparent bot identifier (DEFAULT_USER_AGENT) alongside polite timeouts resolved false 403s across Trust Centers and corporate /subprocessors pages:

export const DEFAULT_USER_AGENT = 'Mozilla/5.0 (compatible; SaaSTrustMonitor/1.0)';
export const DEFAULT_DNS_TIMEOUT_MS = 4_000;
export const DEFAULT_HTTP_TIMEOUT_MS = 15_000;
export const DEFAULT_MAX_BODY_BYTES = 2 * 1024 * 1024; // 2 MB strict cap

(Whenever a JS-walled SPA or Cloudflare Turnstile genuinely blocks HTTP access, we treat it cleanly as an explicit status without hallucinating compliance certifications.)


2. Discovering Trust Centers & IAM Signals via DNS Before Touching HTML

Before fetching heavy marketing pages, node:dns/promises reveals a goldmine of infrastructure truth in ~30 ms:

  • Trust Center platform detection via CNAME: trust.<domain>, security.<domain>, and compliance.<domain> frequently CNAME directly to Vanta, Drata, SafeBase, Conveyor, or Secureframe infrastructure.
  • Zero-touch IAM / SSO verification via DNS TXT/MX: Domain verification TXT records (okta-verification=, MS=, google-site-verification=, JumpCloud, OneLogin) reveal enterprise identity posture even if the vendor hasn't published it on a pricing page.
  • 4-second DNS race timeout: Wrapping DNS queries in Promise.race with strict clearTimeout prevents hung UDP lookups from freezing an entire concurrency batch.

3. Defense-in-Depth SSRF Protection Across Every Redirect Hop

If an automated security scanner accepts arbitrary domains from a user spreadsheet or webhook, http://127.0.0.1, http://169.254.169.254/latest/meta-data/, or DNS-rebinding 302 redirects pose an immediate SSRF vulnerability.

Instead of letting fetch follow redirects blindly (redirect: 'follow'), we force redirect: 'manual' (max 5 hops) and validate both hostname syntax and resolved DNS IPs at every single hop — including IPv4-mapped IPv6 addresses (::ffff:127.0.0.1):

export function isPrivateOrReservedIp(ip) {
    if (!ip || typeof ip !== 'string') return true;
    const trimmed = ip.trim().toLowerCase().replace(/^\[|\]$/g, '');

    // Handle IPv4-mapped IPv6 (e.g. ::ffff:127.0.0.1)
    const v4Mapped = trimmed.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/);
    const checkIp = v4Mapped ? v4Mapped[1] : trimmed;

    const ipVersion = net.isIP(checkIp);
    if (ipVersion === 4) {
        const [a, b, c] = checkIp.split('.').map(Number);
        if (a === 0 || a === 10 || a === 127) return true; // 0/8, 10/8, loopback
        if (a === 169 && b === 254) return true; // link-local & cloud metadata
        if (a === 172 && b >= 16 && b <= 31) return true;
        if (a === 192 && b === 168) return true;
        if (a === 100 && b >= 64 && b <= 127) return true; // CGNAT
        if (a === 192 && b === 0 && c === 0) return true;
        if (a >= 224) return true;
        return false;
    }
    if (ipVersion === 6) {
        return (
            checkIp === '::' ||
            checkIp === '::1' ||
            checkIp.startsWith('fc') ||
            checkIp.startsWith('fd') || // fc00::/7
            /^fe[89ab]/.test(checkIp) || // fe80::/10
            checkIp.startsWith('ff')
        );
    }
    return true;
}

4. Audit Mode vs. Continuous AI Subprocessor Delta Monitoring

Because security teams have two distinct workflows, the engine runs in two modes:

  • audit mode: Returns full vendor posture — trustCenterPlatform, trustCenterUrl, certifications, subprocessors, aiSubprocessors, hasAiSubprocessor, iamProviders, and confidence.
  • monitor mode: Persists snapshots in an Apify Key-Value Store (saas-trust-monitor-state) and emits only real deltas (e.g., new AI vendor added, certification removed, Trust Center migrated) to Slack/Discord/n8n webhooks — charging $0 when vendors remain unchanged.

Ready-to-Use Actor & n8n TPRM Template

Grab the direct workflow JSON 02-saas-soc2-ai-subprocessor-alert-slack.json to schedule daily 9 AM vendor checks right into your #security-alerts channel.

來源:DEV Community · dev.to