Check: SRG-APP-000095-API-001775
Application Programming Interface (API) SRG:
SRG-APP-000095-API-001775
(in version v1 r1)
Title
The API must audit exceptions and errors that occur during the processing. (Cat II impact)
Discussion
Without establishing what type of event occurred, it would be difficult to establish, correlate, and investigate the events relating to an incident, or identify those responsible for one. Audit record content that may be necessary to satisfy the requirement of this policy includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. Associating event types with detected events in the application and audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured application. Monitor the usage of API keys to detect any anomalies.
Check Content
Verify the API audits exceptions and errors that occur during the processing. 1. Inspect the API's logs to ensure they capture exception and error events, including error codes, messages, and stack traces. 2. Simulate errors (e.g., invalid requests or server failures) and verify these are logged with relevant details like timestamps and error types. 3. Ensure the API is configured to log exceptions and errors with sufficient detail for troubleshooting and analysis. 4. Review the API's documentation support to ensure proper auditing of exceptions and errors is enabled. If the API does not audit exceptions and errors, this is a finding.
Fix Text
Build or configure the API to log exceptions and errors with sufficient detail for troubleshooting and analysis.
Additional Identifiers
Rule ID: SV-274530r1143557_rule
Vulnerability ID: V-274530
Group Title: SRG-APP-000095
Expert Comments
CCIs
| Number | Definition |
|---|---|
| CCI-000130 |
Ensure that audit records contain information that establishes what type of event occurred. |
Controls
| Number | Title |
|---|---|
| AU-3 |
Content of Audit Records |