Skip to content

Ensure SSH key set in authorized_keys

Description

This policy checks whether an SSH key is set in the authorized_keys for a Linode instance. Setting an SSH key in authorized_keys is crucial for secure access to the instance, as it allows only authorized users to connect via SSH. Without a set SSH key, the instance may be vulnerable to unauthorized access. It is essential to configure authorized_keys to ensure the security and integrity of the instance.

Code Example

terraform
resource "linode_instance" "example" {
  authorized_keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."]
}

Remediation

Set the authorized_keys attribute in the linode_instance resource to a valid SSH key.

Rule Details

FieldValue
IDIAC-1199
SeverityMEDIUM
IaC TypeTerraform
Frameworkslinode_instance
Checkov IDCKV_LIN_2

References