Terraform

Terraform

Made by DeepSource

Azure instance is using basic authentication TF-S1001

Security
Critical

Ensure Azure instance does not use basic authentication but should prefer SSH-based authentication instead.

SSH is an encrypted connection protocol that allows secure sign-ins over unsecured connections, and it is also the default connection protocol for Linux VMs hosted on Azure. Using a SSH key pair, it is possible to spin up a Linux virtual machine on Azure that defaults to using SSH keys for authentication, eliminating the need for passwords (basic authentication) to sign in.

We recommend connecting to a VM using SSH keys. Using basic authentication leaves VMs vulnerable to brute-force attacks or methods of extracting passwords.

Examples

Recommended

resource "azure_vm_linux" "example" {
  ...

admin_ssh_key {
    username   = "admin"
    public_key = file("~/.ssh/id_rsa.pub")
}