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

Metadata

Id: ansible-gcp-serial-ports-enabled-for-vm-instances

Provider: GCP

Platform: Ansible

Severity: Medium

Category: Networking and Firewall

Learn More

Description

Enabling the serial console on Google Compute Engine VMs grants low-level interactive access to the instance console. This can bypass network and SSH controls, allowing actors who know project or instance details to interact with or tamper with the VM.

In Ansible, check tasks using google.cloud.gcp_compute_instance or gcp_compute_instance and ensure the metadata.serial-port-enable property is either undefined or explicitly set to false. Tasks with metadata.serial-port-enable: true are flagged. Remediate by removing the metadata key or setting it to false.

Secure Ansible example:

- name: Create GCE instance with serial port disabled
  google.cloud.gcp_compute_instance:
    name: my-vm
    machine_type: e2-medium
    metadata:
      "serial-port-enable": false

Compliant Code Examples

- name: serial_disabled
  google.cloud.gcp_compute_instance:
    name: serial-disabled-instance
    metadata:
      serial-port-enabled: no
    zone: us-central1-a
    auth_kind: serviceaccount
- name: serial_undefined
  google.cloud.gcp_compute_instance:
    name: serial-undefined-instance
    metadata:
      startup-script-url: gs:://graphite-playground/bootstrap.sh
      cost-center: '12345'
    zone: us-central1-a
    auth_kind: serviceaccount

Non-Compliant Code Examples

- name: serial_enabled
  google.cloud.gcp_compute_instance:
    name: serial-enabled-instance
    metadata:
      serial-port-enable: yes
    zone: us-central1-a
    auth_kind: serviceaccount