Resolving On-Premise Malware Analysis PostgreSQL Storage Usage Alarms - Submissions Paused
search cancel

Resolving On-Premise Malware Analysis PostgreSQL Storage Usage Alarms - Submissions Paused

book

Article ID: 434348

calendar_today

Updated On:

Products

VMware vDefend Firewall VMware vDefend Firewall with Advanced Threat Prevention

Issue/Introduction

The On-Premise Malware Analysis may trigger the following alarms regarding PostgreSQL storage usage:
- HIGH Alarm: "On-Premises Sandbox PostgreSQL storage usage is high." (Usage has reached >= 80% of the quota).
- VERY HIGH Alarm: "On-Premises Sandbox PostgreSQL storage usage is critically high." (Usage has reached >= 90% of the quota).

Service Impact: when the VERY HIGH alarm is active, new malware analysis submissions are automatically rejected to prevent the database from running out of storage space.

Environment

Security Services Platform (SSP) 5.2.0 and later and MPS activated with On-Premise Malware Analysis

Cause

The On-Premise Malware Analysis monitors the storage usage of specific PostgreSQL schemas (`analysis`, `analysisshard`, and `analyst`) in the `pace` database. By default, the logical quota for these schemas is set to 50GB (53,687,091,200 bytes). When the combined size of these schemas exceeds the 80% or 90% thresholds, the respective alarms are triggered.

To verify the exact usage, you can check the `sa-scheduler-services` pod logs for a detailed per-schema usage breakdown.

Resolution

To resolve these alarms and restore service, you can either decrease the amount of file analysis occurring in your environment, or increase the available PostgreSQL storage space. Additionally, note that a daily data retention job automatically runs to delete older analysis data, which may help free up space over time without manual intervention.

Option 1: Decrease the amount of file analysis

To reduce the volume of new analysis data being stored, refer to the Malware Prevention Services (MPS) documentation for instructions on configuring which files to capture:


* Use the File Exclusion Filter: You can define specific directory paths (e.g., `C:\Windows\Temp\`) or file extensions (e.g., `.log`, `.vmdk`) to be explicitly excluded from analysis (see documentation at Filter Malware Exclusions). This minimizes unnecessary scanning of trusted or noisy applications.* Refine Policy Configuration: Reduce the capture of files by narrowing the environments/VMs from which files are collected  (see documentation Add Rules for Distributed Malware Prevention), or by reducing the specific file types that are configured for capture in your MPS profiles (see documentation Add a Malware Prevention Profile).
* Reduce Submission Rate Limits: Malware analysis can be configured to accept fewer submissions at a more granular level by tweaking the rate-limiting parameters in the `malware-analysis-api` deployment.

For convenience, you can create a small bash script on the SSPI appliance to safely read and update these limits.

1. Download the script `update_mps_submission_rate_limits.sh` onto SSPI:

2. Make the script executable:

chmod +x update_mps_submission_rate_limits.sh


3. Run the script without arguments to view the current configuration (append `--ssp <instance_name>` if needed):

./update_mps_submission_rate_limits.sh

Output example:

$ ./update_mps_submission_rate_limits.sh
=== Current Submission Rate Limits ===
    submission_rate_limiting:
      enabled: true
      rate: "42r/m"
      burst: 1260
      zone_size: "64k"

=== Usage ===

To apply new limits, run the script with <NEW_RATE> and <NEW_BURST>:
  ./update_mps_submission_rate_limits.sh <NEW_RATE> <NEW_BURST> [--ssp <instance_name>]
  Example (Rate: 20r/m, Burst: 600): ./update_mps_submission_rate_limits.sh 20r/m 600

Malware analysis submissions go through NGINX, which enforces the constant `rate` of submission strictly, but uses the `burst` queue to absorb instantaneous spikes.

4. Run the script with your desired limits to update them (append `--ssp <instance_name>` if needed, for example, set <NEW_RATE> to `20r/m` and <NEW_BURST> to `600`):

./update_mps_submission_rate_limits.sh <NEW_RATE> <NEW_BURST>

Option 2: Increase the PostgreSQL Storage Quota

If decreasing analysis volume is not feasible, you must increase the logical storage quota allocated to the database schemas. Ensure your underlying Kubernetes Persistent Volume / disk has sufficient actual free space before increasing this logical quota. 

   

   Step 1: Increase the Physical PostgreSQL Disk Size (PVC)


Note: If you already have enough free disk space, you can skip to Step 2

Note: The following commands must be run from the Security Services Platform Installer (SSPI) CLI. SSH into the SSPI appliance and use the built-in `k` alias to interact with Kubernetes

1. Check the current size of your PostgreSQL PVC(s):

k get pvc data-postgresql-ha-pg-0

2. Edit the PVC for the PostgreSQL pod (`data-postgresql-ha-pg-0`) to increase the storage size. Replace <NEW_STORAGE_SIZE> with your desired capacity (e.g., `150Gi`) :

k patch pvc data-postgresql-ha-pg-0 -p '{"spec":{"resources":{"requests":{"storage":"<NEW_STORAGE_SIZE>"}}}}'
Note: Your StorageClass must support `allowVolumeExpansion` for this to take effect automatically

3. Verify the PVC has resized (this may take a few minutes):

k get pvc data-postgresql-ha-postgresql-0

  Step 2: Increase the Logical Storage Quota (Alarm Threshold)
 

Once the physical disk has enough space, you must increase the logical quota in the scheduler so the application allows the schemas to grow and resolves the alarm.

For convenience, you can run a bash script on the SSPI appliance to safely read and update the logical quota.

1. Download `update_postgres_quota.sh` onto SSPI:

2. Make the script executable:

chmod +x update_postgres_quota.sh

3. Run the script without arguments to view the current configuration (append `--ssp <instance_name>` if needed):

./update_postgres_quota.sh

Output example:

$ ./update_postgres_quota.sh
=== Current PostgreSQL Logical Quota ===
schemas: analysis,analysisshard,analyst
quota: "5368709120"

=== Usage ===
To apply a new quota, run the script with <NEW_QUOTA_IN_BYTES>:
./update_postgres_quota.sh <NEW_QUOTA_IN_BYTES> [--ssp <instance_name>]
Example (Set to 100GB): ./update_postgres_quota.sh 107374182400


4.  Run the script with your desired quota to update it (append `--ssp <instance_name>` if needed). For example, to set the quota to 100GB, you would use `107374182400`:

./update_postgres_quota.sh <NEW_QUOTA_IN_BYTES>

5.Restart the scheduler service to apply the new quota and reset the alarm states:

k rollout restart deployment sa-scheduler-services

6. Verify the pod comes back up successfully:

k rollout status deployment sa-scheduler-services

Once the pod restarts, it will recalculate the usage against the new quota. If the usage is now below 80%, both alarms will automatically resolve, and malware analysis submissions will be re-enabled and resume normally.

You can verify this by checking the `sa-scheduler-services` logs:

k logs deployment/sa-scheduler-services --tail=500 | grep "PostgreSQL storage usage level changed"


You should see entries similar to the following, indicating the alarms have resolved:

INFO  [scheduling-1] c.v.n.s.a.MalwareAnalysisPostgresStorageUsageAlarm: SECURITY [nsx@4413 comp="nsx-manager" level="INFO" subcomp="manager"] PostgreSQL storage usage level changed to: NORMAL

 

Attachments

update_postgres_quota.sh get_app
update_mps_submission_rate_limits.sh get_app