A developer is deploying an AI service API. To protect against data leakage through API responses, which access control principle should be applied to API keys?
Least privilege limits data exposure by restricting each key to necessary actions and data.
Why this answer
Option D is correct because the least-privilege principle ensures that each API key is scoped to only the specific permissions required for its intended function, such as read-only access to a single endpoint. This minimizes the blast radius in case the key is compromised, preventing unauthorized access to other services or data. In AI service deployments, scoped permissions are often enforced via OAuth 2.0 scopes or IAM roles tied to the API key.
Exam trap
CompTIA often tests the misconception that simplifying management (Option C) or using IP whitelisting (Option A) is sufficient for security, but the trap is that these approaches ignore the fundamental need for granular access control to prevent data leakage in multi-tenant AI API environments.
How to eliminate wrong answers
Option A is wrong because disabling API keys and relying solely on IP whitelisting removes authentication granularity and fails to protect against data leakage from within the whitelisted network or from IP spoofing attacks. Option B is wrong because using a single shared API key for all services violates the principle of least privilege, as a compromised key would expose all services and data, and it also prevents audit trails for individual users or applications. Option C is wrong because granting all API keys full access simplifies management at the cost of security, allowing any compromised key to access all endpoints and data, directly enabling data leakage.