Skip to main content

Insecure authentication method - Basic

Description

The server uses Basic authentication over an insecure channel.

Impact

Gather base 64 coded credentials.

Recommendation

Use stronger authentication mechanisms like Bearer and OAuth.

Threat

Unauthorized attacker from adjacent network performing a Sniffing attack.

Expected Remediation Time

⌚ 120 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: A
  • Attack complexity: L
  • Privileges required: N
  • User interaction: N
  • Scope: U
  • Confidentiality: L
  • Integrity: N
  • Availability: N

Temporal

  • Exploit code madurity: P
  • Remediation level: O
  • Report confidence: C

Result

  • Vector string: CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:P/RL:O/RC:C
  • Score:
    • Base: 4.3
    • Temporal: 3.9
  • Severity:
    • Base: Medium
    • Temporal: Low

Code Examples

Compliant code

Implement a SSH key authentication for the sensitive resource

resource "azurerm_linux_virtual_machine" "not_vulnerable" {
name = "example-machine"
size = "Standard_F2"
admin_username = "adminuser"

admin_ssh_key {
username = "adminuser"
public_key = file("~/.ssh/id_rsa.pub")
}
}
resource "azurerm_virtual_machine" "not_vulnerable" {
name = "${var.prefix}-vm"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
network_interface_ids = [azurerm_network_interface.main.id]
vm_size = "Standard_DS1_v2"

os_profile_linux_config {
disable_password_authentication = false
ssh_keys = ["${var.ssh_keys}"]
}
}

Non compliant code

Examples with virtual machines without strong auth mechanism defined

resource "azurerm_linux_virtual_machine" "vulnerable" {
name = "example-machine"
size = "Standard_F2"
admin_username = "adminuser"
}
resource "azurerm_virtual_machine" "vulnerable" {
name = "${var.prefix}-vm"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
network_interface_ids = [azurerm_network_interface.main.id]
vm_size = "Standard_DS1_v2"

os_profile_linux_config {
disable_password_authentication = false
}
}

Requirements