More Info:

Instances should not be configured to allow project-wide SSH keys. To support the principle of least privilege and prevent potential privilege escalation, instances should not be given access to project-wide SSH keys.

Risk Level

Medium

Address

Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

To remediate the misconfiguration “SSH Keys Should Be Instance Specific” for GCP using GCP console, you can follow the below steps:

  1. Login to the GCP console and select the project where the instance is running.
  2. In the left navigation menu, select “Compute Engine” and then click on “VM instances”.
  3. Select the instance for which you want to remediate the misconfiguration.
  4. Click on “Edit” button at the top of the page.
  5. Scroll down to the “SSH Keys” section and click on “Show and edit”.
  6. Remove any public SSH keys that are not specific to the instance.
  7. Add new SSH keys that are specific to the instance by clicking on “Add item” and pasting the public key in the text box.
  8. Click on “Save” to save the changes.

By following these steps, you have successfully remediated the misconfiguration “SSH Keys Should Be Instance Specific” for GCP using GCP console.

Additional Reading: