The API must monitor the usage of API keys to detect any anomalies.

STIG ID: SRG-APP-000095-API-001740  |  SRG: SRG-APP-000095 |  Severity: medium |  CCI: CCI-000130 |  Vulnerability Id: V-274523

Vulnerability Discussion

Monitoring the usage of API keys to detect anomalies is crucial for maintaining security, preventing abuse, and ensuring only authorized users or applications are accessing the system.

API keys are used to authenticate and authorize requests to APIs, and if misused, can become a significant security vulnerability. By monitoring API key usage, unusual patterns can be detected quickly.

Anomalies could indicate potential issues like compromised API keys, unauthorized third-party access, or bot activity. Early detection of such anomalies allows for timely action preventing further exploitation.

Monitoring also helps enforce usage limits and detect overuse or abuse of API resources, which could impact system performance.

Check

Verify the platform provides features to monitor API key usage, including tracking requests made with each key and flagging anomalies such as unexpected request patterns, usage from unusual geographic locations, abnormal request rates, or access to unauthorized endpoints.

If API key usage is not being monitored for anomalies, this is a finding.

Fix

Build or configure the API to monitor API key usage and flag anomalies:

Enable Logging: Log all API key usage, including timestamps, IP addresses, endpoints accessed, and request rates.

Define Normal Behavior: Establish a baseline for expected usage patterns (e.g., typical request rate, endpoints used, geographic regions).

Set Thresholds: Configure thresholds for detecting anomalies such as excessive requests, access to unusual resources, or use from unexpected locations.

Integrate Monitoring Tools: Use API management or SIEM tools to analyze logs and trigger alerts on anomalous activity.

Automate Alerts: Set up real-time notifications or automated actions (e.g., temporary blocking) when anomalies are detected.