For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

GCP PostgreSQL instance database flag log_hostname is not set to off misconfiguration detected in co

Rule Details

Cortex AppSec Rule ID

APPSEC_GCP_108

Category - Subcategory

Logging - Disabled or missing

Provider

GCP

Severity

LOW

Framework

Terraform, Terraform Plan

Mapped CSPM/KSPM Rule

e4885f20-2e9d-4dab-aa72-61dff2ebda66

Impact

This rule is concerned with monitoring and logging activities within Google Cloud Platform's (GCP) PostgreSQL databases. It verifies that hostnames are being logged. The absence of this feature could hinder an organization's ability to track user activities, troubleshoot issues or conduct forensic investigations in the event of a data breach or an attack. Proper logging could help in detecting foul play quicker and in responding to regulatory compliance checks or audits. Thus, it's critical to ensure hostnames are logged for GCP PostgreSQL databases for robust security control.

How to Fix

Resource: google_sql_database_instance

To correct this issue, you should set the flag, log_hostname, to ON. This will ensure that all hostnames of clients attempting to connect to the database are logged.

In this code, setting the log_hostname flag to ON means that PostgreSQL will include the hostname of connecting clients in the logs. This is helpful for security purposes, because if there are unauthorized attempts to access the database, the log information can help identify where the attempts are coming from. [source,go]

resource "google_sql_database_instance" "database_instance" { database_version = "POSTGRES_13" settings { database_flags { name = "log_hostname" value = "on" } } }

Last updated

Was this helpful?