Skip to content

fix(azure): skip non-Windows VMs in vmWindowsAntiMalwareExtension - #2211

Open
Anmol7091 wants to merge 1 commit into
aquasecurity:masterfrom
Anmol7091:fix/azure-vm-antimalware-linux-skip
Open

Anmol7091 wants to merge 1 commit into
aquasecurity:masterfrom
Anmol7091:fix/azure-vm-antimalware-linux-skip

Conversation

@Anmol7091

Copy link
Copy Markdown

Fixes #2210

What

vmWindowsAntiMalwareExtension read the OS type from virtualMachine.osDisk.osType, which does not exist
in the virtualMachines:listAll response (the field is storageProfile.osDisk.osType). As a result,
Linux VMs were never skipped and always failed this Windows-only check.
The wrong path dates back to the original implementation in #1660.

Changes

  • plugins/azure/virtualmachines/vmWindowsAntiMalwareExtension.js: read storageProfile.osDisk.osType (lines 39–41)
  • plugins/azure/virtualmachines/vmWindowsAntiMalwareExtension.spec.js: add tests for a Linux VM (skipped)
    and a Windows VM with osType set (evaluated)

Testing

  • npx mocha plugins/azure/virtualmachines/vmWindowsAntiMalwareExtension.spec.js: 10 passing
    (the new Linux test fails on the current master, confirming the bug)
  • npx eslint plugins/azure/virtualmachines/vmWindowsAntiMalwareExtension.js: no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Azure] vmWindowsAntiMalwareExtension flags Linux VMs: reads osDisk.osType instead of storageProfile.osDisk.osType

1 participant