이 제품은 선택한 Datadog 사이트에서 지원되지 않습니다. ().
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Metadata

Id: ansible-gcp-postgresql-log-checkpoints-flag-not-set-to-on

Provider: GCP

Platform: Ansible

Severity: Medium

Category: Observability

Learn More

Description

PostgreSQL Cloud SQL instances must have the log_checkpoints flag enabled so checkpoint events are recorded. Without these logs, crash recovery and forensic analysis are hindered, making it harder to detect or investigate anomalous or destructive activity.

For Ansible tasks using google.cloud.gcp_sql_instance or gcp_sql_instance, the settings.databaseFlags list must include an entry with name: log_checkpoints and value: on. Tasks that omit the settings block, omit databaseFlags, or have log_checkpoints set to any value other than on are flagged.

Secure example configuration in an Ansible task:

- name: Create Cloud SQL PostgreSQL instance with checkpoint logging
  google.cloud.gcp_sql_instance:
    name: my-postgres-instance
    database_version: POSTGRES_13
    settings:
      databaseFlags:
        - name: log_checkpoints
          value: on

Compliant Code Examples

- name: create a instance
  google.cloud.gcp_sql_instance:
    name: my-postgres-instance
    settings:
      databaseFlags:
      - name: log_checkpoints
        value: on
      tier: db-n1-standard-1
    region: us-central1
    project: test_project
    database_version: POSTGRES_9_6
    auth_kind: serviceaccount
    service_account_file: /tmp/auth.pem
    state: present

Non-Compliant Code Examples

- name: create instance
  google.cloud.gcp_sql_instance:
    name: my-postgres-instance
    settings:
      databaseFlags:
      - name: log_checkpoints
        value: off
      tier: db-n1-standard-1
    region: us-central1
    project: test_project
    database_version: POSTGRES_9_6
    auth_kind: serviceaccount
    service_account_file: "/tmp/auth.pem"
    state: present
- name: create another instance
  google.cloud.gcp_sql_instance:
    name: my-postgres-instance-2
    settings:
      tier: db-n1-standard-1
    region: us-central1
    project: test_project
    database_version: POSTGRES_9_6
    auth_kind: serviceaccount
    service_account_file: "/tmp/auth.pem"
    state: present