Check: EPAS-00-002400
EnterpriseDB Postgres Advanced Server (EPAS) STIG:
EPAS-00-002400
(in version v1 r1)
Title
The EDB Postgres Advanced Server must be configurable to overwrite audit log records, oldest first (First-In-First-Out [FIFO]), in the event of unavailability of space for more audit log records. (Cat II impact)
Discussion
It is critical that when the DBMS is at risk of failing to process audit logs as required, it take action to mitigate the failure. Audit processing failures include: software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. When availability is an overriding concern, approved actions in response to an audit failure are as follows: (i) If the failure was caused by the lack of audit record storage capacity, the DBMS must continue generating audit records, if possible (automatically restarting the audit service if necessary), overwriting the oldest audit records in a first-in-first-out manner. (ii) If audit records are sent to a centralized collection server and communication with this server is lost or the server fails, the DBMS must queue audit records locally until communication is restored or until the audit records are retrieved manually. Upon restoration of the connection to the centralized collection server, action should be taken to synchronize the local audit data with the collection server. Systems where availability is paramount will most likely be MAC I; the final determination is the prerogative of the application owner, subject to Authorizing Official concurrence. In any case, sufficient auditing resources must be allocated to avoid audit data loss in all but the most extreme situations.
Check Content
If an externally managed and monitored partition or logical volume that can be grown dynamically is being used for logging, this is not a finding. If EDB Postgres Advanced Server is auditing to a directory that is not being actively checked for availability of disk space, and if logrotate is not configured to rotate logs based on the size of the audit log directory with oldest logs being replaced by newest logs, this is a finding.
Fix Text
Determine the max size of the audit log directory. This fix assumes that the audit log directory has a max size of 100MB. Divide the max size of the directory by 10 to determine the size of the log files for rotation. Perform the following steps to ensure that the audit log directory is never more than 90 percent full and new logs always replace the oldest logs: 1. Add the following to the bottom of the /etc/logrotate.conf file: <path-to-PGDATA-directory>/edb_audit/audit.csv { size 10M dateext dateformat .%Y-%m-%d.%s copytruncate rotate 8 } The default path for the EDB Postgres Advanced Server data directory [PGDATA] is /var/lib/edb/as<version>/data, but this will vary according to local circumstances. 2. Create the file /etc/cron.hourly/logrotate with these contents: #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit 0 3. Issue these SQL statements: ALTER SYSTEM SET edb_audit_filename = 'audit'; SELECT pg_reload_conf();
Additional Identifiers
Rule ID: SV-259227r938734_rule
Vulnerability ID: V-259227
Group Title: SRG-APP-000109-DB-000321
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-000140 |
The information system takes organization-defined actions upon audit failure (e.g., shut down information system, overwrite oldest audit records, stop generating audit records). |
Controls
Number | Title |
---|---|
AU-5 |
Response To Audit Processing Failures |