HunterX v7 Cloud & SaaS Attack-Surface Intelligence — Architecture & Reference

Status: Ratified (Sprint 017) Version: 1.0.0 Capability: Cloud & SaaS Attack-Surface Intelligence · Wave 11 Owner: HunterX Architecture Council


1. Purpose / Scope

The Cloud & SaaS Attack-Surface Intelligence capability discovers, classifies, correlates, normalizes, persists, graphs, diffs, historizes and reports the cloud and SaaS infrastructure associated with an authorized target. It transforms fragmented observations (DNS records, TLS metadata, HTTP headers, technology observations, JavaScript SDK references, documentation text and previously persisted TIDB intelligence) into a unified, evidence-backed infrastructure graph that answers:

Security boundary — this is intelligence and discovery, not exploitation. The capability never authenticates to cloud accounts, never accesses cloud resources, never touches metadata services, never retrieves secrets, never enumerates private objects, never connects to databases, never interacts with Kubernetes control planes, never tests IAM permissions and never exploits anything. Cloud exposure indicators are persisted as intelligence, never as validated vulnerabilities.

Hard constraints:

Scope: src/hunterx/domain/cloud/, src/hunterx/tools/cloud/, src/hunterx/application/cloud.py, src/hunterx/domain/entities/tidb/cloud_intelligence.py, src/hunterx/infrastructure/db/sql/tidb_models/cloud_intelligence_models.py, the cloud.* event family, topology kind/relationship additions, the Alembic migration 7ea0dbfc111d, config/capabilities/cloud-saas-intelligence.json, tests/golden/cloud/ and the acceptance/security/performance suites.


2. Design Goals

  1. Evidence-based detection. A provider is never inferred from branding alone; every detection carries a deterministic signature, a strength and an evidence fragment.
  2. Unified cloud model. Every cloud subject (provider → account → region → resource → service → endpoint) is normalized to a canonical, persisted form.
  3. Intelligence-only. Exposure indicators are metadata; the capability never verifies, exploits or validates them.
  4. Deterministic confidence. Identical evidence always yields identical scores; no randomness anywhere.
  5. Secret-safe. Sensitive values are redacted, masked or fingerprinted before they reach any observation or record.

3. Cloud Model

The capability models the canonical cloud attack-surface hierarchy:

DOMAIN
  → HOST
    → SERVICE
      → CLOUD PROVIDER
        → ACCOUNT / SUBSCRIPTION / PROJECT / ORGANIZATION / TENANT
          → REGION
            → RESOURCE
              → SERVICE
                → ENDPOINT (control / data / identity / management / developer plane)
                  → EXPOSURE (public / private / internal)

And the SaaS dependency model:

APPLICATION
  → SAAS PROVIDER
    → SAAS INTEGRATION (oauth / api / webhook / analytics / payment / ...)
      → OAUTH CLIENT / API / WEBHOOK
        → EXTERNAL SERVICE

Every record carries: provider, service, resource, region, environment, plane, exposure, evidence, source, tool, mission, execution, first/last seen and deterministic confidence.


4. Providers

The provider catalog (src/hunterx/domain/cloud/providers.py) detects, with evidence, the following cloud / platform providers:

Provider Examples detected via
AWS .amazonaws.com, .cloudfront.net, execute-api., Server: AmazonS3, x-amz-*, TLS org Amazon, tech AWS, JS @aws-sdk
Azure .azurewebsites.net, .blob.core.windows.net, .azure-api.net, x-ms-*, TLS org Microsoft, JS @azure/
Google Cloud .appspot.com, .cloudfunctions.net, .run.app, .storage.googleapis.com, x-goog-*, TLS org Google
Oracle Cloud .oraclecloud.com, .objectstorage., .oci.customer-oci.com
Cloudflare .cloudflare.net, .workers.dev, cf-ray, TLS org Cloudflare
DigitalOcean .digitaloceanspaces.com, .ondigitalocean.app
Akamai .akamaiedge.net, X-Akamai-*
Fastly .fastly.net, X-Served-By
Vercel .vercel.app, x-vercel-*
Netlify .netlify.app, x-nf-request-id
Heroku .herokuapp.com
Render .onrender.com
Fly.io .fly.dev
Supabase .supabase.co
Firebase .firebaseapp.com, .web.app, JS firebase
Kubernetes kube-apiserver, ingress-nginx, X-Kubernetes-Pod-Name, tech Kubernetes
Docker hub.docker.com, .docker.io, tech Docker

Provider detection is evidence-based: each signature carries a strength (strong/moderate/weak) and the analyzer records the matching evidence fragment. Provider is never inferred from branding alone (a page merely mentioning “AWS” is not treated as AWS hosting).


5. Accounts, Subscriptions & Projects

The analyzer extracts non-secret identifiers that map to cloud scoping units:

These are recorded as CloudAccountObservation (kind account / subscription / project / organization / tenant) and are never validated against the provider. The capability never enumerates unrelated accounts.


6. Regions & Environments


7. Resources, Services & Planes

Resource-family specific observations are emitted for storage, compute, serverless, container, Kubernetes, database, message infrastructure, API gateway, CDN, load balancer and CI/CD.


8. Storage, Compute, Container & Kubernetes


9. Serverless, Databases & Messaging


10. API Gateways, CDNs & Load Balancers

Each is correlated with the domain, the API, the backend and the provider and persisted in the graph.


11. IAM & Identity

Correlated with Sprints 015–016, the capability records non-secret identity and IAM indicators: service accounts, managed identities, users, roles (including assume-role indicators), OAuth clients, workload identity, federated identity and documented permission indicators (e.g. s3:GetObject from infrastructure documentation). Identities are metadata only and are never used, impersonated or tested.


12. CI/CD

The capability identifies GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure DevOps, AWS CodeBuild/Pipeline, Google Cloud Build, Vercel/Netlify deployments and container registries as CiCdResourceObservation records. It never retrieves build credentials or secrets.


13. Secret Management

The capability detects secret-management indicators only — AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, Vault, Doppler, 1Password references, secret references and environment-variable references (e.g. AWS_SECRET_ACCESS_KEY, DATABASE_URL, WEBHOOK_SECRET). References are stored as names and SHA-256 fingerprints; values are never persisted, retrieved or validated.


14. SaaS

The capability detects SaaS platforms (GitHub, GitLab, Slack, Microsoft 365, Google Workspace, Atlassian, Notion, Salesforce, HubSpot, Zendesk, Datadog, Sentry, PagerDuty, Twilio, SendGrid, Mailgun, Stripe, Shopify, Auth0, Okta, analytics and more) from hostnames, SDK references, technology observations and documentation — always evidence-based.

SaaS integrations are modeled with an integration type (oauth / api / webhook / analytics / payment / email / monitoring / error-tracking / crm / support / identity / ci-cd / cloud-storage / communication), an endpoint, an authentication-mechanism indicator and a scope (metadata only).


15. Webhooks

Inbound/outbound webhook endpoints (Slack, Teams, Zapier, Telegram, Discord, custom /webhooks/ routes) are modeled with a direction, provider, event-type indicators and a signing-mechanism indicator. Signatures are never forged and no arbitrary webhook requests are sent.


16. Third-Party Dependencies

Third-party dependencies are correlated (application → third party → provider → API) from technology observations and script asset hosts, persisted as CloudDependencyObservation.


17. Cloud Exposure Indicators

Exposure indicators are persisted as intelligence, never vulnerabilities:

Dangling indicators are classified as Potential and never reported as a “takeover vulnerability”. The capability never performs takeover.


18. Historical Intelligence & Differential Analysis

CloudHistory.compare(historical, current) produces deterministic added/removed/changed records keyed by each subject’s canonical deduplication key. The application service persists changes and publishes cloud.change.detected events. Re-running the same snapshot produces zero changes; comparing different missions detects asset, provider, resource, exposure, SaaS, identity, integration, region, environment and architecture changes.


19. Evidence

Every cloud record includes provenance: source, tool, mission, execution, timestamp, asset, provider, service, resource, detection method, raw evidence reference (masked), normalized value and deterministic confidence. Evidence fragments are persisted as CloudEvidence records linked to their subject.


20. Confidence

Confidence is deterministic and explainable:

Scoring combines a per-source reliability base, the strongest evidence strength, corroboration boosts, conflict discounts and historical stability — all pure functions (src/hunterx/domain/cloud/confidence.py).


21. Sensitive Data Protection

The capability never persists cloud credentials, access keys, secret keys, session tokens, OAuth secrets, private keys, API secrets, webhook secrets, database credentials or secret values. Protection mechanisms (src/hunterx/domain/cloud/redaction.py):


22. TIDB Mapping

The capability persists 32 canonical entities (src/hunterx/domain/entities/tidb/cloud_intelligence.py) into 32 TIDB tables (migration 7ea0dbfc111d):

CloudRun, CloudProvider, CloudAccount, CloudRegion, CloudResource, CloudService, CloudEndpoint, CloudEnvironment, CloudIdentity, CloudRole, CloudPermission, CloudIntegration, SaaSProvider, SaaSApplication, SaaSIntegration, Webhook, CloudDependency, StorageResource, ComputeResource, ContainerResource, KubernetesResource, DatabaseResource, MessageInfrastructure, ApiGatewayResource, CdnResource, LoadBalancerResource, CiCdResource, SecretManagementIndicator, CloudExposureIndicator, CloudObservation, CloudEvidence, CloudChange.

Persistence goes through the generic TidbRepositoryFactory (SQL or in-memory); no separate cloud database exists. Entities are pure dataclasses extending TidbEntity; the registry auto-pairs XxxModel ↔ Xxx by name.


23. Knowledge Graph (Topology)

The capability projects cloud edges into the existing TIDB topology:

New topology kinds (cloud_provider, cloud_account, cloud_region, cloud_resource, cloud_service, cloud_endpoint, cloud_environment, cloud_identity, saas_provider, saas_integration, webhook, storage_resource, compute_resource, container_resource, kubernetes_resource, database_resource, api_gateway, ci_cd_resource) and relationship types (contains, hosts) were added to src/hunterx/domain/topology/enums.py.


24. Events

The capability publishes the cloud.* event family (category CLOUD, EventSeverity.INFO):


25. Reporting

CloudQueryService answers the full inventory query surface: providers, accounts, regions, resources, services, endpoints, environments, identities, roles, permissions, integrations, SaaS providers, SaaS applications, SaaS integrations, webhooks, dependencies, storage, compute, containers, Kubernetes, databases, message infrastructure, API gateways, CDNs, load balancers, CI/CD, secret-management indicators, exposure indicators, observations, changes, runs and a compact summary.


26. Module Reference

Module Contents
src/hunterx/domain/cloud/models.py canonical observation dataclasses, CloudTarget, CloudEvidence, CloudInput, CloudAnalysis, CloudBatch, serialization bridge
src/hunterx/domain/cloud/providers.py ProviderCatalog, ProviderMatch, ProviderSignature, region/account extraction
src/hunterx/domain/cloud/analyzer.py CloudAnalyzer — evidence-based detector set
src/hunterx/domain/cloud/classification.py CloudClassifier — service category, plane, exposure, environment
src/hunterx/domain/cloud/confidence.py CloudConfidenceEngine, CloudConfidencePolicy
src/hunterx/domain/cloud/scope.py CloudScopePolicy, CloudScopeEnforcer
src/hunterx/domain/cloud/strategy.py CloudStrategy, CloudStrategyBuilder
src/hunterx/domain/cloud/correlator.py CloudCorrelator, CloudCorrelationResult
src/hunterx/domain/cloud/conflicts.py CloudConflictResolver
src/hunterx/domain/cloud/history.py CloudHistory, CloudHistoryComparison
src/hunterx/domain/cloud/validator.py CloudValidator
src/hunterx/domain/cloud/redaction.py secret redaction, fingerprinting
src/hunterx/tools/cloud/ cloud-analysis adapter, registry, TIP registration
src/hunterx/application/cloud.py CloudService, CloudQueryService
src/hunterx/domain/entities/tidb/cloud_intelligence.py 32 TIDB entities
src/hunterx/infrastructure/db/sql/tidb_models/cloud_intelligence_models.py 32 ORM models
alembic/versions/7ea0dbfc111d_cloud_saas_intelligence_tables.py schema migration
config/capabilities/cloud-saas-intelligence.json machine-readable capability contract

27. Security & Scope Behavior


28. Testing


29. Verification

Gates at sprint close:


30. References