Attack Surface
Overview
Your attack surface is a living map of everything an attacker could reach in a workspace: the applications you run, the endpoints they expose, and the context that helps agents reason about each one. Pensar builds and maintains this map automatically, then uses it to scope and steer every pentest.
The attack surface is guidance, not findings. The business logic, threat models, and pentest objectives attached to each endpoint are AI-drafted context that steers how the pentest agent tests — they are not confirmed vulnerabilities. Confirmed, verified findings only appear as issues after a pentest runs.
How It Works
Pensar discovers and maps your attack surface through reconnaissance. The approach depends on whether you’ve provided source code access:
With Source Code
Without Source Code
When you provide source code (via VCS integration or zip upload), Pensar’s AI agents perform static analysis to identify:
- Web Routes & Endpoints: All HTTP endpoints, REST APIs, GraphQL schemas, and WebSocket connections
- Authentication Mechanisms: Login pages, OAuth flows, API key validation, and session management
- Input Vectors: Forms, query parameters, request bodies, headers, and file uploads
- External Dependencies: Third-party APIs, external services, and integrations
- Data Flows: How data moves through your application and where it’s processed or stored
Source code analysis provides the most comprehensive attack surface mapping with detailed understanding of application internals.
When source code is not provided, Pensar performs advanced reconnaissance on your provided domains:
- Subdomain Discovery: Identifies all subdomains associated with your domains
- Port Scanning: Discovers open ports and running services
- Web Crawling: Maps all accessible pages, forms, and functionality
- API Discovery: Identifies API endpoints through intelligent probing and pattern recognition
- Technology Detection: Fingerprints frameworks, libraries, and server technologies
The provided context about your domains helps guide the reconnaissance process for more accurate results.
System map
If your workspace has system recon enabled, open Attack surface and choose System map. Select Run recon to map the workspace’s connected domains and repositories together.
Blue lines group Internet entry points by boundary. An arrow from an edge network shows where it forwards traffic. Select the arrow to see the source component, destination component, and what passes between them. Select a component to inspect its controls and threats, including the steps a pentest can use to verify each threat.
Select Link domain in a component’s details to link, switch, or unlink an existing workspace domain. Recon only links domains supplied to the run that are already in your workspace; it does not create domains.
Select a component, review the highlighted scope, and choose Run pentest. The selected component and its highlighted dependents contribute their threat models, controls, relationships, and other recon context. Linked domains define the live targets; components without a linked domain remain investigation context.
You can also select individual components from Pentests → New pentest, or choose Custom Test to supply your own instructions. Components without endpoints are tested as whole components and require credit billing when payment is due.
Open the pentest to follow one agent coordinating all selected targets, with helper agents for focused investigations. The selected scope appears above the agent activity, with the live desktop alongside it and a recording after completion.
Scheduled pentests and CI-triggered tests use this same view. For CI runs, the agent receives the trigger’s repository and commit range alongside the attack surface, chooses which connected repositories to inspect, and coordinates testing based on the diff. Scheduled runs assess whole selected topology components. The orchestrator chooses which routes to investigate within those components.
In the topology view, re-select components for any saved endpoint-scoped schedule before running it. This makes the change to whole-component testing explicit.
Connect an AWS account
A workspace admin can add a read-only AWS inventory so recon can identify deployed services, network boundaries, and security groups.
- Under Settings → Integrations → Cloud providers, enter the AWS regions to include.
- If you use Google SSO or have multiple AWS sessions, open the intended account and role through your usual sign-in. In Pensar, expand Use Google SSO or an existing AWS session and paste the URL from that AWS Management Console tab.
- Select Connect AWS account. If AWS is open in a different browser profile, select Copy stack link and open it in that profile.
- Review and create the CloudFormation stack. Check that the account shows Connected in Pensar before running recon. Repeat for each account you want to include.
If setup fails, open the stack’s Events tab in CloudFormation and find the first failed resource. If the Pensar connection callback failed, include the support reference from that event and your workspace name when contacting support.
Google Cloud projects
Under Settings → Integrations → Cloud providers, enter the project ID and select Connect Google Cloud. Sign in as a Google administrator who can update that project’s IAM policy. Your browser uses the temporary Google authorization to update project IAM. Pensar adds Cloud Asset Viewer and Logs Viewer to a read-only identity dedicated to the connection. Your organization must permit the federated identity in the project’s IAM policy.
Once the project shows Connected, recon inventories its deployed assets and locations. Keep the settings page open while Pensar verifies the grants. If verification is still pending when you return, select Verify access. Remove from Pensar stops future reads. To revoke access in Google Cloud too, remove the connection’s principal from project IAM.
What Each Endpoint Holds
Open any endpoint in the Attack Surface view to see the context Pensar has assembled for it. Recon drafts each section; you can edit any of it inline to sharpen what agents reason about.
Everything below is soft guidance for the testing agent — a starting point recon inferred about the endpoint, not a statement that the endpoint is vulnerable. Treat it as the brief you’d hand a human pentester, and refine it to point testing where it matters most.
Overview
The endpoint’s metadata — its type, whether authentication is required, and where it lives in the source. All editable inline.
Business Logic
What the endpoint actually does — its purpose, the actors involved, the data that flows through it, and the invariants and trust boundaries it must uphold. This helps agents understand intended behavior so they can spot deviations from it.
Threat Model
The adversaries worth worrying about, the attack vectors they’d use, and the controls already in place. Refine it to focus testing on the threats that matter most for this endpoint.
Pentest Objectives
Concrete, falsifiable hypotheses an agent will try to prove during a pentest. Objectives are the single biggest lever you have over what gets tested — add, edit, or remove them to focus effort on high-value endpoints.
Pentest Objectives
For each identified endpoint, Pensar automatically generates pentest objectives — specific, falsifiable testing goals that guide how that endpoint should be tested. They describe what an agent will attempt to prove, not what it has already found.
OWASP Top 10 and OWASP API Top 10 coverage is applied by default. Every pentest automatically tests for the full set of OWASP Top 10 and OWASP API Top 10 security risks — no configuration required. Objectives let you extend and focus testing with additional, targeted goals specific to your application.
What Are Pentest Objectives?
Pentest objectives are AI-generated testing strategies tailored to each unique endpoint based on:
- The endpoint’s functionality and purpose
- Input parameters and their types
- Authentication and authorization requirements
- Potential security risks specific to that endpoint
Example Objectives
User Login Endpoint
For a /api/auth/login endpoint, objectives might include:
- Test for SQL injection in username/password fields
- Verify rate limiting on failed login attempts
- Check for username enumeration vulnerabilities
- Test session token generation for randomness
- Verify secure password storage mechanisms
- Test for authentication bypass vulnerabilities
File Upload Endpoint
For a /api/files/upload endpoint, objectives might include:
- Test file type validation and extension filtering
- Verify file size limits are enforced
- Check for path traversal vulnerabilities
- Test for malicious file content detection
- Verify uploaded files cannot be executed
- Test for unrestricted file upload vulnerabilities
User Profile API
For a /api/users/:id endpoint, objectives might include:
- Test for Insecure Direct Object Reference (IDOR)
- Verify authorization checks for other users’ data
- Test for SQL injection in ID parameter
- Check for sensitive data exposure in responses
- Test mass assignment vulnerabilities
- Verify input validation on profile updates
Workspace Objectives
While Pensar covers the OWASP Top 10 and OWASP API Top 10 by default, you can define workspace objectives to extend pentesting with additional, targeted testing goals. These are useful when your application has domain-specific security concerns that go beyond standard vulnerability categories — compliance requirements, business logic testing, known risk areas, or custom integrations.
Navigate to Settings > Agent Configuration > Context and open the Objectives tab to add custom objectives. They are automatically included when generating attack surfaces for all applications in the workspace, and can be propagated to existing endpoints.
See the Workspace Objectives page for detailed guidance on writing effective objectives, propagation, and example objective sets for common application types.
Reachability Checks
Pensar periodically requests each application’s linked domain from outside our network, so an IP allowlist on our scanner cannot make a public host look private. Any HTTP response — including 401, 403, or 500 — proves the host answers the public internet. A connection-level failure (DNS, refused, TLS, timeout) means it did not answer that caller.
The result appears as a badge on the application card:
An application with no linked domain has nothing to probe and shows no badge.
Per-application history
Open an application and select the Reachability tab to see the current state, the URL that is contacted, the last check with its exact time and timezone, when the next check is due, and the recorded history of every run — each with the URL probed at that time, the result, and the HTTP status or connection error. History is kept for 90 days.
Workspace controls
Whether Pensar contacts your applications at all, and how often, is one decision for the whole workspace. Workspace admins and owners set it under Settings › Recon › Reachability checks: an on/off switch, and an interval of every 6 hours (the default), every 12 hours, daily, every 3 days, or weekly.
The interval controls when an application becomes eligible for a check, not a wall-clock time. Checks are issued by a sweep that runs every 6 hours, so a check can land later than the due time shown. For the same reason, 6 hours is the shortest interval available.
Turning checks off stops future probes and keeps everything already recorded; turning them back on restores eligibility without losing history. These controls are separate from the per-application notification subscription under an application’s Access tab.
Continuous Mapping
Mapping your attack surface isn’t a one-time activity:
Pensar automatically updates your attack surface map when:
- New code is pushed to your repository
- New domains are added to your workspace
- Reconnaissance discovers new subdomains or endpoints
- Application routes or APIs are modified
This ensures your security testing always covers your current application state, not just a point-in-time snapshot.
Next Steps
With your attack surface mapped, Pensar moves on to penetration testing:
- Hybrid Testing: Learn about Pensar’s hybrid testing methodology combining source analysis with live exploitation
- Android apps: Upload an APK and run an Android application pentest
- View Results: Monitor testing progress and review confirmed findings in real-time through the Console dashboard
Topology API
In workspaces using the topology view, the map is readable and editable through the Console API, not only the web view. It holds boundaries, components, flows, controls and threats.
- Get the topology returns the whole map, filtered by record type, boundary or application and paged, or as a Mermaid flowchart with
format=mermaid. - Get an application topology returns one application’s component with what talks to it, what it talks to, the controls that protect it and the threats against it.
- Create and update add what recon missed or correct what it got wrong. Exclude takes a record out of the map and out of testing.
- List record versions shows who changed a record, and restore undoes any change.
Reading needs the inventory:read scope, creating inventory:add, and updating, excluding or restoring inventory:write. Every change is attributed to the user or API key that made it. To test chosen applications, launch with applicationIds (Launch a pentest). The endpoint routes (/apps/{appId}/endpoints, /endpoints/{endpointId}) and endpointIds are deprecated for these workspaces.