
How CTOs Can Strengthen API Security Across the Enterprise
Majority of API security failures don’t start with an obvious breach. They start with a request that appears legitimate. A customer goes and looks at a record that belongs to someone else. An internal service has permissions that it no longer requires. A partner integration is still using a credential even though the original business case for that integration has now changed. The unpleasant thing is that all the normal security controls might well be working. The gateway will have accepted the request, the token will be valid, and the connection will be encrypted. The problem is what happens after that.
As you add more apps, more partners, more microservices, and more AI workloads, the number of identities and the number of access relationships explodes. The challenge of managing that complexity is now greater than the challenge of simply deploying another security product. The real test is whether you know what each identity can access, why it needs that access and how quickly you can react when something changes.
That’s where API security best practice needs to go beyond gateway config. Auth, authorization, rate limiting, credential management, and monitoring all have to work in concert. If they don’t, then a perfectly legitimate request can still be a security incident.
Key takeaways
- A valid access token doesn’t mean the user has permission to access every resource that the API exposes.
- API gateways can enforce all sorts of policies but the application services themselves are still going to need to check resource ownership and business permissions.
- OAuth 2.0, API keys, and mutual TLS serve different purposes. Choosing between them depends on who or what is making the request.
- API rate limiting needs to account for the cost of an operation, not just the number of requests.
- Credential rotation and service-to-service authentication need clear ownership and operational processes.
- Monitoring should help teams trace what happened, which identity made the request, and whether the action was authorized.
Why API security best practices go beyond the API gateway?
There is a common assumption that once an API gateway is in place, most of the security problems have been addressed. It has not. A gateway is good at the job of controlling the boundary. It can validate tokens, apply access policies, inspect traffic patterns and reject requests that don’t conform to the rules. It doesn’t necessarily know whether a customer is entitled to access a particular account or whether an employee is entitled to approve a particular transaction.
Consider a customer who signs into a banking application and requests an account record. The gateway validates the access token and forwards the request. Everything looks normal. Now imagine that the customer changes the account identifier in the request and tries to retrieve someone else’s information.
The token is still valid. The request is still hitting the approved endpoint. The issue is that the app hasn’t checked that the account in question actually belongs to the logged in customer.
This is broken object-level authorization, or BOLA, and it is a familiar problem in API security reviews. The issue is not that authentication failed. The service failed to link the authenticated identity to the requested resource.
The issue appears with function-level authorization
A user may be allowed to view an account but not close to it, change its ownership, or initiate a transfer. And field-level authorization matters when a support employee needs access to contact details but should not see sensitive payment information.
A gateway cannot make all these decisions on behalf of the application. The service handling the request usually has the business context needed to determine whether the action is legitimate.
For CTOs, this changes the architectural question. It is not enough to ask whether every API sits behind a gateway. You also need to know where resource-level and business-level permissions are enforced.
How do you secure an API?
Start with the simple distinction that authentication answers the question ‘who is making the request?’ and authorization answers the question ‘what is that identity allowed to do?’. The distinction sounds obvious, but it gets blurred in systems where several applications and services share credentials or inherit permissions from a common identity provider.
A mobile application, for example, may authenticate a user through an identity provider. A business partner may connect through OAuth 2.0. An internal workload may use a service identity and mutual TLS. A legacy integration may still rely on an API key.These are different relationships. Treating them as one generic category of trusted traffic creates gaps.
Once the caller’s identity is established the API has to assess what the requested action is. Is this user permitted to read that record? Can this service update that field? Does that partner have permission to access that endpoint? Is the action in question within the scope of the application?
This is where API access control needs to be explicit. A token should not become a universal pass simply because it was issued by a trusted identity provider.There is another point worth considering: authorization should not depend entirely on where a request originates. An internal service is not automatically trustworthy, just as an external request is not automatically malicious. The system needs to verify identity and permissions in either case.
A consistent API security architecture provides the team with a common way to establish identity and enforce policy, whilst allowing individual services to make their own decisions based on their business rules.
What is the best way to secure REST APIs?
REST API security tends to be pretty simple to look at as the endpoints are so easy to spot. You’ve got your resources, your HTTP methods and fairly predictable request patterns.
The fact that it’s all structured in that way doesn’t in any way mean that it’s secure.Take a customer profile endpoint. A user may be allowed to update their phone number or their mailing address. That doesn’t mean the same user should be able to change their customer ID, their verification status or their account permissions.
If the API accepts every field the client sends without validating what the user is actually allowed to change, then an authenticated request could still modify data the user shouldn’t be able to change. The same is true of GETs. People often focus on the operations that modify data, but a GET can just as easily expose personal, financial, or commercially sensitive information.
You need to check access to a resource irrespective of the HTTP method.
For REST APIs, look closely at a few things:
- Does every endpoint enforce auth where it’s required?
- Does the service confirm resource ownership rather than just taking the client supplied identifier?
- Are permissions checked on an individual operation basis rather than just based on the user’s role?
- Can the API return sensitive fields that the caller doesn’t actually need?
- Are pagination, filtering and sorting parameters restricted?
- Would error responses expose any internal detail that could be exploited to probe the system?
Input validation absolutely needs to be looked at in the same way. An application that has been approved can still be used to send malformed, unexpected or manipulated data. You must have server-side validation, which will check the structure, type, length, and allowed values of the data that is coming in. Client-side validation is useful for the user experience, but it’s not a security boundary.
For teams using GraphQL the questions are slightly different. A single query can pull back a massive amount of connected data so you’ve got to think about query depth, query complexity, batching and resolver level authorisation. With gRPC the thinking should be at the service and method level rather than just assuming that if you have access to a service you have access to all of the methods on that service.
The protocol changes. The fundamental requirement remains the same: the API must determine whether the caller is entitled to the data or operation that they’re requesting.

API authentication: Choosing the right identity model
The auth mechanism should reflect the relationship between the caller and the service. That’s a better starting point than picking a technology that’s already in the stack.OAuth 2.0 is useful when an application needs delegated access. It allows a client to obtain an access token with defined scopes rather than sharing a user’s password with every service. OpenID Connect adds an identity layer that helps applications authenticate users.
One distinction is important here. OAuth 2.0 is an authorization framework; OpenID Connect provides authentication information. Treating every access token as proof of user identity, without checking its intended purpose, can lead to mistakes.
When an API receives a token, it should validate the signature, issuer, audience, expiration, and relevant scopes or claims. A token issued for one service should not automatically work with another. If the token has expired or does not carry the required permission, the API should reject the request.
API keys have a different role. They can identify an application or integration, particularly in simpler partner or developer access arrangements. But they should not be treated as a replacement for user authentication or as automatic permission to perform sensitive operations.
Mutual TLS provides another option, particularly for machine-to-machine communication
It allows both sides of a connection to authenticate using certificates, which can help establish trust between services.
| Mechanism | Where it fits | What to watch |
|---|---|---|
| OAuth 2.0 | Delegated access and application integrations | Token scopes, audience validation, expiration, and secure handling |
| OpenID Connect | User authentication and identity information | Issuer, signature, identity claims, and session handling |
| API keys | Application identification and simpler integrations | Restricted permissions, secure storage, monitoring, and rotation |
| Mutual TLS | Machine-to-machine communication | Certificate issuance, renewal, validation, and revocation |
The choice depends on the sensitivity of the data, the capabilities exposed, and how much control the organization needs over each integration.
OAuth vs API keys: Where does each fit?
This is not really a question of which technology is more secure in every situation. It is a question of what the integration needs to do.An API key may be sufficient when a partner needs access to a narrowly defined service. The organization can restrict the key to specific endpoints, environments, and usage limits. The risk increases when one key grants broad access, is shared across applications, or remains active long after the integration has changed.
OAuth 2.0 is generally a better fit when access needs to be delegated, scoped, and time-limited. An application can obtain a token for a specific purpose rather than relying on a permanent credential.
But OAuth does not solve authorization by itself. A token with overly broad scopes can still give an application more access than it needs. Equally, a restricted API key can be appropriate for a limited integration if the service enforces the right permissions.
The practical decision should follow the relationship between the consumer and the API. Is the caller a user, a partner application, or an internal workload? What data does it need? Which operations can it perform? How quickly can the organization revoke its access if something goes wrong?
Those questions matter more than simply standardizing on one authentication method.
API authorization is where identity meets business logic
Authentication can tell you that a request came from a particular user or service. It cannot tell you whether that request makes sense in the business context.A finance employee may have access to payment records but not permission to approve every transaction. A support representative may need to view customer information without being able to export it. A service account may need to read transaction status but have no reason to initiate a payment.
Role-based access control, or RBAC, can handle many of these requirements. But when access depends on additional context, roles alone may become restrictive or too broad.Attribute-based access control, or ABAC, allows policies to consider attributes such as department, resource ownership, transaction value, location, or workflow state.
For example, an employee might be allowed to approve a transaction only when it falls below a defined value and belongs to the business unit they support. The decision depends on more than the employee’s job title.
Field-level authorization is just as important. Returning an entire database object and relying on the frontend to hide restricted fields is not access control. The API should determine which fields the caller is entitled to receive.
This becomes harder in microservices environments. A request may pass through several services, each with its own data and business rules. If identity and authorization context are not carried consistently through the request path, one service may enforce permissions while another assumes they have already been checked.
The answer is not to centralize every business decision in the gateway. It is to make authorization an explicit responsibility of each service, supported by consistent identity and policy standards.
API rate limiting needs to account for the cost of a request
Even when authentication and authorization work as intended, an API can still become unavailable because one consumer sends too much traffic.Rate limiting is usually introduced to control request volume, but a simple requests-per-minute threshold does not tell the whole story.
Consider two operations on the same platform. One returns a small account status response. The other generates a detailed financial report by querying several databases and running multiple calculations. Counting both as one request ignores the difference in the resources they consume. A better API rate limiting policy considers the caller, tenant, endpoint, and cost of the operation.
IP-based limits can help identify broad traffic patterns, but they are not enough on their own. Several legitimate users may share an IP address through a corporate network or mobile carrier. A malicious actor may also distribute requests across multiple addresses.
The problem is particularly relevant to GraphQL. One query can request a large amount of connected data or trigger extensive resolver activity. Teams need to account for query depth, complexity, batching, and downstream execution cost.
The same thinking applies to APIs that trigger background jobs, generate exports, or perform resource-intensive calculations. The service should limit the work being requested, not just count how often the endpoint is called.
How do you implement API rate limiting without disrupting services?
Setting a threshold is the easy part. Setting one that protects the service without blocking legitimate customers takes more thought.Start with actual traffic patterns. A payment API may experience predictable peaks around settlement periods. A reporting service may see heavier demand at month-end. An external partner may send requests in batches, while a mobile application generates smaller requests throughout the day.
A single global limit can treat all these consumers unfairly.Limits should reflect the service and the consumer. A high-volume enterprise tenant may need a different allocation from a small developer integration. An expensive operation may need a stricter limit than a lightweight lookup.
The enforcement mechanism also matters. In a distributed environment, individual API instances may not have a complete view of request volume. If traffic is spread across several instances, each one may allow requests that collectively exceed the intended threshold. Shared state or distributed rate-limiting mechanisms help keep enforcement consistent.
When a client exceeds its limit, the API can return HTTP 429, Too Many Requests. A Retry-After header tells the client when it can try again. Clients should use exponential backoff with jitter rather than retrying immediately. Otherwise, a temporary capacity problem can turn into a larger traffic spike.
There is also a business decision here. Should every excess request be rejected? Can some operations be queued? Should critical transactions have a separate policy? The answer depends on what happens when the service delays or rejects that operation. Rate limiting needs to be tested under realistic traffic conditions.
Teams should know how it behaves during demand spikes, partial outages, and failover events, not just whether it blocks a request that crosses a configured threshold.
API key management and credential rotation
API keys have a habit of sticking around. An integration is built for a pilot, the project moves into production, the original developer changes teams, and the key remains active. A partner migrates to a new application but continues to use the old credential. A key is removed from source code, yet remains visible in repository history.
These are not unusual edge cases. They are the consequences of treating credentials as setup details rather than assets that need ongoing ownership.API key management should start with a few very basic questions. What application is the key for? Who owns the integration? What access does the key provide? Is it still required?
Keys should be restricted to the minimum level of permissions required by the integration and stored in a secrets manager or some other approved secure store. They should not be in the application code or in any configuration files that are accessible to a wide range of people.
Teams also need visibility into key usage. Without it, revoking an old credential becomes a guessing exercise. A service owner should be able to identify which applications are using a key before disabling it, unless an emergency requires immediate revocation.
For partner integrations, you’ll need to coordinate a rotation. A fairly straightforward approach would be to issue a replacement key, allow a short overlap, confirm the partner has switched and then revoke the old credential. Emergency revocation is a separate requirement.
If a key is compromised, then the organization should be able to revoke it quickly, identify where it was used, and go on to investigate the activity that was associated with it.
How frequently should API keys be rotated?
There’s no one rotation interval that works for every API key. A credential with broad production access will need far tighter controls than a development key that only has access to a subset of the API.
An external partner integration may well have a planned migration window, whereas an internal workload may be perfectly happy to have its credentials auto-renewed. More frequent rotation is not automatically safer if the process is unreliable. A poorly coordinated change can break integrations or encourage teams to reuse credentials. The important thing is to make rotation predictable and revocation reliable.
A documented schedule should be combined with event-driven replacement. Credentials should be rotated where there is evidence of exposure, evidence of unauthorized use, a change of ownership, or a material change to the integration.
The real test is operational: can the organization identify, replace, and revoke a credential without losing track of the systems that it’s reliant on?
Service-to-service authentication should not rely on internal trust
Internal traffic is often dealt with differently to external traffic. That makes sense from a network design point of view, but it’s a risky assumption to make in an environment that’s built around microservices, containers and cloud workloads.If one service is compromised, what can it reach? Can it call all the internal APIs? Or can it pull customer data and trigger some operation outside of its normal function?
Service to service authentication should establish the identity of each workload and confirm that the receiving service is authorised to accept that request. Mutual TLS can authenticate both ends of the connection via certificates. Workload identity systems can provide service identities without requiring static credentials in deployment files. Short-lived credentials reduce the window in which an exposed secret can be misused.
But authentication is only the first check. A service that is authorized to retrieve customer records shouldn’t automatically be allowed to update payment instructions. Each workload needs the permissions appropriate to its role and nothing more.
This is where zero trust becomes practical. Internal network location is not in itself a guarantee of trust. Services will still need to validate identity and permissions at the point of access. For CTOs, a good way to evaluate the design is to imagine one of the internal services has been compromised.
How far could the attacker go before another service just refuses the request? If you’re not clear on that, you probably need much stronger workload, identity, and access boundaries.
How do you monitor and audit API access?
Security controls are only of any use if the teams can see what’s going on when the requests get to production.
Monitoring should give the team enough context to know who made the request, which endpoint they accessed, what action they were attempting, and whether or not the request was allowed. In different environments, that might include the user/service identity, tenant, application, response status, and request correlation ID.
But gathering more data isn’t necessarily the answer. Logs shouldn’t be exposing passwords, access tokens, API keys, payment details and so on. Redaction and access controls need to be part of the logging design.
The signals worth watching include repeated authorization failures, unusual access to customer records, sudden increases in request volume, unexpected changes in service behavior, and attempts to access resources outside an identity’s normal scope.
Context makes those signals far more useful. A spike in failed requests could be a sign of an attack, or the result of a deployment that broke a client integration. You need application and infrastructure telemetry alongside the security events to be able to work out which it is.
Audit trails are absolutely critical for sensitive operations. If a customer record is accessed or a transaction is initiated, then you need to be able to establish who made the request, what they were trying to do, whether it was an authorized action, and what actually happened.
Connecting API logs to a SIEM platform can help correlate events across services. However, that only works well when teams use consistent event formats, reliable timestamps, and traceability across the request path.
The point of monitoring is not to produce more dashboards. It is to provide engineering and security teams with sufficient evidence to investigate an incident and identify where the control failed.
API security checklist for enterprise teams
Before you go on and onboard another API consumer or expand an existing integration, it’s worth asking whether the following controls are actually working in production.
- Identity: Does each user, application and workload have a unique identity?
- Authentication: Are tokens, API keys, and certs being validated correctly?
- Authorization: Does each service check resource ownership, operation permissions, and sensitive fields?
- Credential management: Are the secrets securely stored, do they have an owner, are they monitored, can they be rotated, and are they revocable?
- Service to service authentication: do the internal workloads authenticate each other rather than just relying on network location?
- Rate limiting: do the limits take into account identity, tenant, endpoint and operation cost?
- Input validation: are request parameters, payloads, and query complexity all constrained?
- Monitoring: Can the teams detect unusual access, authorization failures, and anomalous resource consumption?
- Auditability: Can investigators trace the sensitive requests across the services involved?
- Governance: Is there someone accountable for the security of each API across its lifecycle?
The checklist is a starting point, not in any way proof that the API is secure. You need to test those controls against real request patterns, changing integrations, and the way users actually use the service.
In brief
The number of APIs that an organization has is not the best indicator of its security exposure. What actually matters is how consistently the organization manages identity, permissions, and resource consumption as the number of APIs grows and connects more applications, partners, and internal services.
A gateway can reject an invalid token. A rate limiter can protect a service against excessive traffic. A security manager can assist with credential control. None of those, however, can in any way independently determine what every action a user or workload is permitted to perform. That responsibility is distributed across identity systems, application logic, service boundaries, deployment practices, and operational monitoring.
For a CTO, the question worth asking is not simply whether the organization has an API gateway or a security platform. It is whether a request with valid credentials can still reach data or trigger an operation that its caller should never have been allowed to access. If the answer is yes, the problem is architectural. And adding another security tool at the edge will not fix it.