A company deploys an AI model via a REST API that handles sensitive customer data. To secure the endpoint, the security team requires that only authenticated and authorized applications can invoke the API. Which mechanism should be implemented?
An API key or bearer token in the HTTP header authenticates each calling application and enforces authorisation before the endpoint processes sensitive customer data. It satisfies the requirement that only authenticated and authorised applications can invoke the API.
Why this answer
API keys or bearer tokens (e.g., OAuth 2.0 access tokens) are the standard mechanism for authenticating and authorizing client applications when invoking a REST API. These tokens are passed in the HTTP Authorization header, allowing the server to verify the client's identity and permissions before processing requests containing sensitive customer data.
Exam trap
CompTIA often tests the distinction between transport-layer security (TLS) and application-layer authentication, so candidates mistakenly choose TLS because it 'secures' the endpoint, but it does not verify who is calling the API.
How to eliminate wrong answers
Option B is wrong because TLS encryption secures data in transit but does not authenticate or authorize the calling application; it only prevents eavesdropping and tampering. Option C is wrong because input sanitization protects against injection attacks (e.g., SQL injection) but does not verify the identity or authorization of the API caller. Option D is wrong because IP whitelisting restricts access based on source IP addresses, which can be spoofed or shared, and does not provide per-application authentication or authorization; it is a network-layer control, not an application-layer identity mechanism.