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

Deletion protection for Spanner Database is disabled misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_GCP_119

Category - Subcategory

Public Exposure - Database Endpoints

Provider

GCP

Severity

MEDIUM

Framework

Terraform, Terraform Plan

Impact

This rule is examining Google Cloud Platform's Spanner Databases to ensure that deletion protection is enabled. Deletion protection is a safeguard that prevents accidental deletion of the database, which could lead to data loss or disruption of services. Without this protective measure, valuable or sensitive information could be accidentally destroyed, significantly impacting a business or operation. Therefore, activating deletion protection is considered a best practice in terms of security and data management.

How to Fix

Resource: google_spanner_database

  • Arguments: deletion_protection

To fix this issue, you should enable the deletion protection in your Spanner Database configuration.

The above code is secure because it enables the 'deletion_protection' property of the Spanner Database. This setting avoids accidental deletion of databases, providing an extra layer of security for your data. [source,go]

resource "google_spanner_database" "database" { instance = "your-spanner-instance" name = "your-database-name"

ddl = [ "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)", ]

deletion_protection = true }

Last updated

Was this helpful?