Attack Surface

security

Attack Surface

Definition

An attack surface is the total set of points (attack vectors) where an unauthorized user can attempt to enter data into, extract data from, or otherwise interact with a system without authorization. It encompasses all externally reachable infrastructure: exposed network services and open ports, API endpoints, web applications, domain names and subdomains, SSL/TLS certificates, DNS records, cloud resources (storage buckets, serverless functions, container registries), email servers, VPN gateways, remote access interfaces, and any other component accessible from outside the organizational perimeter. The attack surface also includes the human dimension -- employees susceptible to phishing, social engineering, or credential theft.

Attack surface management (ASM) is the discipline of continuously discovering, inventorying, classifying, prioritizing, and monitoring these exposure points. Unlike vulnerability management (which focuses on known software flaws), ASM addresses the fundamental question: "What can an attacker see and reach?" A smaller, well-monitored attack surface reduces security risk not by eliminating vulnerabilities but by reducing the number of places where vulnerabilities can exist and be exploited. Conversely, an unknown or unmanaged attack surface -- shadow IT, forgotten subdomains, expired certificates, misconfigured cloud resources -- represents uncontrolled risk that no amount of vulnerability scanning can address.

The modern attack surface extends far beyond traditional network perimeters. Cloud adoption, SaaS integrations, third-party supply chains, remote work infrastructure, and the proliferation of APIs have expanded the typical organization's attack surface by orders of magnitude. External Attack Surface Management (EASM) specifically addresses the externally visible portion of this surface -- what an attacker can discover and target from the public internet, without any insider access or credentials.

Context in Prismatic

The Prismatic Platform's EASM module, part of Prismatic Perimeter, automates attack surface discovery and continuous monitoring for organizations. The scanner probes domains, IP ranges, certificates, DNS records, cloud resources, and third-party integrations to build a comprehensive inventory of an organization's external exposure. Each discovered asset is classified by type, assigned a risk score, monitored for changes, and mapped into the platform's knowledge graph for relationship analysis. The system competes with commercial tools like BitSight, Black Kite, and SecurityScorecard, providing security ratings (A-F grades with numeric scores 300-900) and compliance assessment against NIS2 and ZKB frameworks.

The platform's own attack surface is minimized through architectural decisions: only two Phoenix endpoints are exposed (port 4000 for the dashboard, port 4004 for the REST API), all traffic is TLS-encrypted, authentication uses JWT tokens with RBAC, and rate limiting prevents abuse. The Color Teams continuously assess the platform's own security posture through adversarial simulation.

Attack Surface Categories

The attack surface is typically categorized into three domains:

Network Attack Surface

All externally reachable network endpoints:

Asset TypeDiscovery MethodRisk FactorExample
Open PortsPort scanning (Shodan)Exposed servicesSSH on 22, HTTP on 80/443
DNS RecordsDNS enumerationSubdomain exposuredev.example.com, staging.example.com
IP RangesWHOIS, BGP analysisNetwork footprint203.0.113.0/24
TLS CertificatesCT log monitoring (Censys)Domain discovery*.internal.example.com
Email ServersMX record lookupPhishing entry pointmail.example.com
VPN EndpointsService scanningRemote access vectorvpn.example.com:443

Software Attack Surface

All software components exposed to external input:

ComponentExposureRisk FactorPrismatic Response
Web ApplicationsHTTP/HTTPS interfacesInjection, XSS, CSRFPhoenix CSRF protection, input validation
API EndpointsREST/GraphQL interfacesAuth bypass, data exposureOpenAPI validation, RBAC
DependenciesThird-party librariesSupply chain attacksHex audit, lockfile verification
ContainersDocker imagesBase image vulnerabilitiesMinimal images, regular updates
RuntimeBEAM VM, ERTSRuntime exploitsCurrent Erlang/Elixir versions

Human Attack Surface

The organizational dimension of security exposure:

VectorMethodMitigation
PhishingDeceptive emails/sitesEmployee training, email filtering
Credential TheftPassword reuse, breachesMFA, password managers, breach monitoring
Social EngineeringImpersonation, pretextingVerification procedures, security awareness
Insider ThreatMalicious or negligent insidersLeast privilege, audit logging, DLP
Supply ChainCompromised vendor accessVendor security assessment, access controls

EASM Discovery Pipeline

The Prismatic Perimeter scanner discovers attack surface assets through a multi-stage pipeline:

Target Domain (e.g., example.com)
      |
      v
  1. DNS Enumeration
      |  A/AAAA, MX, TXT, NS, CNAME records
      |  Subdomain brute-force and permutation
      v
  2. Certificate Transparency
      |  CT log monitoring for *.example.com certs
      |  Historical certificate analysis
      v
  3. Service Discovery
      |  Port scanning across discovered IPs
      |  Service fingerprinting and version detection
      v
  4. Cloud Resource Discovery
      |  S3 bucket enumeration, Azure blob, GCP storage
      |  Serverless function discovery
      v
  5. Web Application Analysis
      |  Technology fingerprinting, header analysis
      |  WAF detection, CDN identification
      v
  6. Third-Party Integration Discovery
      |  SaaS integrations, API dependencies
      |  Supply chain mapping
      v
  Asset Inventory --> Risk Scoring --> Security Rating --> Compliance Assessment

Risk Scoring and Security Ratings

Each discovered asset contributes to the organization's overall security rating:

FactorWeightScoring CriteriaImpact
Vulnerability Exposure30%Known CVEs in exposed servicesHigher CVE severity = lower score
TLS Configuration20%Protocol version, cipher strength, cert validityWeak TLS = significant penalty
DNS Security15%DNSSEC, SPF, DKIM, DMARC configurationMissing records = moderate penalty
Exposed Services15%Unnecessary open ports, admin interfacesEach unnecessary service = penalty
Patch Cadence10%Time to patch known vulnerabilitiesSlow patching = score decay
Cloud Configuration10%Public buckets, misconfigured resourcesEach misconfiguration = penalty
defmodule PrismaticPerimeter.SecurityRating do
  @moduledoc "Calculate A-F security ratings from attack surface analysis."

  @type grade :: :A | :B | :C | :D | :F
  @type rating :: %{grade: grade(), score: 300..900, confidence: float()}

  @spec calculate(map()) :: {:ok, rating()} | {:error, atom()}
  def calculate(%{assets: assets, vulnerabilities: vulns, tls: tls_config}) do
    score =
      base_score()
      |> apply_vulnerability_penalty(vulns)
      |> apply_tls_assessment(tls_config)
      |> apply_exposure_assessment(assets)
      |> clamp(300, 900)

    {:ok, %{grade: score_to_grade(score), score: score, confidence: 0.92}}
  end

  defp score_to_grade(score) when score >= 850, do: :A
  defp score_to_grade(score) when score >= 700, do: :B
  defp score_to_grade(score) when score >= 550, do: :C
  defp score_to_grade(score) when score >= 400, do: :D
  defp score_to_grade(_score), do: :F
end
GradeScore RangeInterpretationIndustry Percentile
A850-900Excellent security postureTop 10%
B700-849Good with minor gapsTop 30%
C550-699Average, improvement neededMiddle 40%
D400-549Below average, significant gapsBottom 30%
F300-399Critical security issuesBottom 10%

Compliance Mapping

Attack surface findings map directly to regulatory compliance requirements:

RegulationRelevant RequirementsAttack Surface Coverage
NIS2 (EU 2022/2555)Risk management, incident reporting, supply chain securityFull: asset inventory, vulnerability tracking, third-party assessment
ZKB 264/2025 Sb.Critical infrastructure protection, cyber hygieneFull: Czech-specific compliance mapping
GDPRData protection, breach notificationPartial: data exposure detection, certificate monitoring
ISO 27001ISMS, risk assessment, asset managementFull: continuous asset inventory and risk assessment

Attack Surface Reduction Strategies

StrategyImplementationImpact
Minimize Exposed ServicesClose unnecessary ports, disable unused APIsFewer entry points
Network SegmentationIsolate internal services from public accessReduced blast radius
Default DenyWhitelist-only firewall rulesOnly explicitly allowed traffic
Certificate ManagementAutomated renewal, CT monitoringNo expired/mismatched certs
DNS HygieneRemove stale records, enable DNSSECReduced subdomain takeover risk
Dependency AuditingRegular mix hex.audit, lockfile reviewReduced supply chain risk
Encryption at RestEncrypt all stored dataData protection if storage breached
API HardeningSchema validation, rate limiting, authReduced API abuse surface

OSINT Sources for Attack Surface Discovery

The platform integrates multiple OSINT sources for comprehensive discovery:

SourceData ProvidedUpdate FrequencyCoverage
ShodanOpen ports, service banners, vulnerabilitiesContinuous scanningGlobal IPv4
CensysCertificates, hosts, protocolsWeekly full scanGlobal internet
GreyNoiseInternet noise classificationReal-timeIP intelligence
Certificate TransparencyAll publicly issued TLS certificatesReal-timeAll public CAs
DNS DatasetsZone files, passive DNSDaily to weeklyMajor TLDs
BGP RoutingIP prefix announcementsReal-timeGlobal routing
WHOISDomain registration detailsOn-demandAll registrars

Continuous Monitoring

Attack surfaces change constantly. Continuous monitoring detects changes in real-time:

Change TypeDetection MethodAlert Priority
New subdomainDNS monitoring, CT logsMedium
New open portPeriodic port scanningHigh
Certificate expiryCertificate monitoringCritical (< 30 days)
New vulnerabilityCVE database correlationSeverity-dependent
Configuration changeHeader/response monitoringMedium
New cloud resourceCloud API monitoringHigh
Domain expiryWHOIS monitoringCritical (< 30 days)
  • EASM - External Attack Surface Management system
  • Shodan - Internet-wide port and service scanner
  • Censys - Certificate and host discovery platform
  • GreyNoise - Internet noise and scanner classification
  • Risk Score - Quantified risk assessment per asset
  • Color Teams - Security teams analyzing attack surfaces
  • TLS - Transport encryption assessed in attack surface analysis
  • REST API - API endpoints constituting software attack surface
  • Rate Limiting - Protection reducing API attack surface exposure
  • Encryption at Rest - Data protection for stored assets

See Also


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL