APIs are now fundamental components of modern software architecture, facilitating communication between different software applications. As such, understanding their security implications is key.

API discovery and risk assessment are foundational steps in safeguarding these assets. Traditional web exploration tools are inadequate for APIs due to their inherent design and operation, making specialized discovery tools a necessity for identifying potential vulnerabilities and unauthorized access points.

Overcoming the invisible obstacles in API discovery

APIs, by their nature, are often not visible or comprehensible to those outside of technical roles, resulting in significant visibility challenges. As organizations move from traditional web-based systems to API-centric frameworks, they often lose operational visibility.

A lack of transparency can hinder effective monitoring and management, making it difficult to maintain a comprehensive security posture.

APIs are subject to frequent and unpredictable changes, more so than traditional software applications. Rapid modifications can be driven by evolving business needs, technological advancements, or user demands.

Such volatility necessitates continuous discovery and risk assessment to keep security measures up to date. Without a dynamic approach, security gaps can quickly emerge, exposing the organization to potential breaches.

The complexity of composable APIs

APIs are designed to be flexible and composable, letting different API components be mixed and matched by consumers to create new functionalities. While flexibility is beneficial, it introduces unpredictability, complicating the task of assessing the API attack surface.

Diversity in the way APIs can be used makes it challenging to predict potential security risks, requiring more comprehensive discovery and monitoring strategies.

Creating a strong API inventory involves strategic decisions about what to include and how to classify APIs. Several methods can be employed:

  • Counting top-level domains: Suitable for tracking broad API changes but may miss more frequent updates.
  • Counting domain, method, and path combinations: Captures detailed changes but can be overly complex due to high variability.
  • Counting subdomains: A balanced approach that is effective across organizations of varying sizes.
  • Counting OpenAPI and GraphQL specifications: Useful when detailed specifications are available or can be generated through monitoring.
  • Counting API service VMs or containers: Provides a high-level view of the runtime environment but lacks detail at the API layer.
  • Counting integration contracts or SLAs: Important for understanding formal service agreements and obligations.
  • Logging specific user activities: Involves tracking legitimate user interactions and potential malicious activities, providing insights into usage patterns and security concerns.

Making smart choices with API inventory strategies

Selecting the right method for building an API inventory depends on balancing the frequency and granularity of changes. While top-level domains offer stability, method/path combinations provide detailed insights but can lead to inefficiency if overused.

Subdomain counting strikes a middle ground, offering scalability across different organizational sizes. Aligning inventory methods with OpenAPI or GraphQL specifications, when available, can improve monitoring effectiveness.

Infrastructure-based discovery offers a snapshot of the runtime environment but may not accurately reflect API activities due to multi-homed services.

Set your KPIs to track your API inventory

Establishing Key Performance Indicators (KPIs) is important for managing API inventories. Organizations should track the total number of APIs (X) and identify those that require immediate attention (Y).

KPIs support continuous monitoring and adjustment of security measures, helping organizations maintain a proactive security stance and mitigate potential risks.

Why your API inventory needs constant attention

Given the rapid changes in APIs, maintaining an up-to-date inventory is critical. Manual update processes are often unreliable and can result in oversight. Continuous monitoring, either through runtime systems that capture real user traffic or through enforced API gateways, provides better control and visibility over the API landscape.

Categorizing APIs based on their lifecycle and support level is a practical approach to managing API security:

  • “Rogue” or “Unmanaged” APIs: These are in use but have not been reviewed or approved by security teams, posing potential risks.
  • “Prohibited” or “Banned” APIs: APIs that have been reviewed and explicitly disallowed due to security concerns.
  • “Monitored” or “Supported” APIs: Actively maintained and supervised, ensuring they comply with security policies.
  • “Deprecated” or “Zombie” APIs: Older APIs that are no longer supported but may still be accessible, potentially exposing the organization to outdated vulnerabilities.

How to measure and prioritize API risks effectively

Effective API risk management requires prioritizing risks based on their potential impact. Given the limited resources of security teams, risk scoring becomes essential for identifying where to allocate efforts.

A comprehensive approach should consider threats from both external and internal sources, including vulnerabilities within the supply chain.

Implementing effective metrics for risk scoring helps organizations maintain a clear overview of their API security status:

  • Aggregating risk scores: Calculating the percentage of total risk for each API helps prioritize those needing immediate attention. The average risk score serves as a valuable KPI for tracking security improvements over time.
  • Summary by API grouping: Breaking down risk scores by different API groupings, such as monitored or rogue APIs, provides insights into policy adherence and potential security gaps, guiding remediation efforts more effectively.

Using advanced tools to boost your API security

With the availability of advanced, purpose-built tools, organizations can now efficiently manage API discovery and risk. Newer tools support quick API inventory creation, help with the continuous tracking of changes, and provide metrics that are understandable across the organization.

Adopting such tools makes sure that security measures evolve in step with API developments, safeguarding the organization against emerging threats.

Alexander Procter

September 3, 2024

4 Min