Back to the blogCybersecurity

API Security: A Practical Guide to Authorization and Data Access

A valid session does not grant access to every record. A secure API needs to consider the caller, the action, the resource and the business context together.

A successful login is only the starting point

Authentication establishes identity; authorization determines what that identity may do. A signed-in user is not automatically entitled to read or change every record behind an endpoint. OWASP recommends validating permissions on every request.

In a purchasing application, an employee might be allowed to create a request without being allowed to approve it. Hiding an approval button is not enough: the API must enforce the same business boundary. During discovery, list actual actions rather than stopping at broad labels such as administrator and user. That makes the intended behaviour much easier to discuss and test.

References

Make permission decisions about the specific record

Access to an endpoint does not imply access to the object identified in its request. Object-level authorization checks whether the caller may perform the requested action on that particular record. An unpredictable identifier is not a substitute for that check.

For a multi-branch product, draft a concrete decision matrix: a branch employee can inspect local requests, a regional manager can review assigned branches, and an integration account can use only its defined operations. This is an example for discussing scope and ownership, not a policy that every business should adopt unchanged.

References

Define boundaries for fields and workflow transitions

Permission to view a record does not necessarily include permission to change every field. In a request form, an employee might edit the description while the server controls the approver, branch and workflow state. Define which fields each operation accepts instead of treating the submitted object as a replacement for the stored record.

Workflow order also needs server-side validation. A draft should not become completed without its required approvals. Mapping the permitted transitions with the product team makes it easier to keep the interface, administrative tools and external integrations consistent.

References

Give integrations a purpose and a bounded permission set

A connection between two systems needs an owner, a purpose and defined access. A service that reports order status may have no reason to export the customer directory. Record the data it uses, the operations it may perform and how the connection will be retired.

HTTPS, credential management and an appropriate authentication mechanism belong in the design. An API key alone does not satisfy every access requirement for sensitive resources. Include the revocation of superseded credentials in the handover plan so that replacing an integration does not leave its predecessor with unnecessary access.

Match resource controls to the cost of the operation

A small lookup and a large report may have very different resource costs. Plan list sizes, upload limits, timeouts and request-frequency controls around the work each endpoint performs. Give clients a consistent, understandable response when a limit is reached.

A reporting workflow, for example, might combine a permission check, a bounded reporting period and a separate job for long-running work. The design question is not only how many requests to accept. Consider how much work one request can create and how the resulting limits affect ordinary users.

References

Make events useful without copying sensitive data into logs

Event records should help teams understand access decisions and failures. They should not become another store of passwords, access tokens or unnecessary personal data. Decide what each event contains and who can inspect it.

A request identifier, operation, result and appropriate context can help trace a problem. Walk through a rejected request with the team and ask whether the recorded information would be enough to diagnose it. Aim for the right signals, rather than treating a larger volume of logs as evidence of better security.

References

Test the paths that should be denied

In a controlled test environment, exercise the same function with different roles, branches and record owners. A successful authorized action is one acceptance criterion; inability to access an out-of-scope record is another. Add changes to restricted fields, invalid workflow transitions and accounts whose access has been removed.

For ongoing maintenance, keep an inventory of API owners, versions, consumers and data scopes. Revisit the permission model when introducing a new field or integration. Connecting security checks to the way software changes is more useful than treating them as a single event immediately before release.

FROM READING TO PRACTICE

Consider this approach in your own system.

Let’s explore your needs, existing systems and the next step together.

CybersecurityOur cybersecurity approach