APIs carry most of the traffic in modern software. They connect your mobile app to your backend, your product to your customers' systems and your platform to every vendor you rely on. They also tend to be the least documented and least tested part of the stack.
That gap matters twice. Attackers go after APIs because they expose data and business logic directly. And auditors increasingly ask how you know which APIs exist, who can call them and what they return. This post covers the weak points and how to build evidence that stands up in an assessment.
Most compliance frameworks do not mention APIs by name. SOC 2, ISO/IEC 27001, HIPAA and PCI DSS talk about access control, change management, logging, encryption and secure development. APIs are where all of those controls meet, but they rarely appear as their own line item in a control matrix.
The result is a blind spot. Network diagrams show servers and databases. Asset inventories list applications. Few of them list the individual endpoints, versions and integrations that actually move regulated data. If an endpoint is not on a list, nobody reviews it, tests it or retires it.
The OWASP API Security Top 10 is a good public reference for the problems that matter. The themes are consistent:
Note how many of these are governance failures as much as coding failures. Nobody knew the endpoint existed, nobody owned the authorization rule, nobody set the limit.
You cannot secure or document what you cannot list. Build an API inventory that records, for each API:
Generate it from sources of truth where you can: API gateway configuration, API specifications and code repositories. Then compare against what traffic logs show is actually being called. The differences are your shadow APIs.
Fixing API flaws in production is slow and expensive. Move the checks earlier.
Write an API specification before you write code, and use it to define authentication, authorization rules, input schemas and response fields. Threat-model any endpoint that touches sensitive data. Treat authorization as a central service or shared library, not something each developer re-implements.
Validate input against the schema and reject anything that does not match. Return only the fields a caller needs. Add automated tests for authorization, including cases where one user tries to reach another user's data. Include API checks in your pipeline alongside static analysis and dependency scanning. Most teams can add these checks to an existing delivery process without slowing releases.
Automated scanners miss business-logic flaws, especially authorization problems. A penetration test that includes authenticated testing across different user roles is the best way to find them. Retest after fixes, and keep the report and the retest results.
Every old version is attack surface. Publish a deprecation policy, tell consumers when versions will end and then actually shut them off. Keep a record of each retirement, because it shows an auditor that your inventory is managed rather than just collected.
Log every API call with enough context to investigate: caller identity, endpoint, time, response status and source. Do not log secrets or full sensitive payloads. Send logs to a central system and alert on patterns such as spikes in errors, unusual volume from one client, sequential ID enumeration and access from unexpected locations.
Have a runbook for API incidents: how to revoke keys and tokens, block a client, disable an endpoint and notify affected parties. If you handle regulated data, tie this to your breach response process so notification deadlines under laws such as HIPAA are met.
Keys issued to customers and partners need the same lifecycle controls as employee credentials: issue them with least privilege, expire or rotate them, revoke them when a relationship ends and review them on a schedule. Store only hashed secrets where possible and give every key an owner so that someone answers when it misbehaves.
Auditors do not need a separate API program, and your compliance advisory scope can absorb this work. They need to see that the controls you already claim apply to APIs. Map your API work to the controls you are assessed against:
Keep evidence dated and retrievable. A screenshot of an inventory from last week and a ticket showing a retired endpoint are worth more in a SOC 2 examination or a PCI DSS assessment than a policy that says you do these things.
If you want help scoping API testing and audit evidence, our secure software team can help, or get in touch.