From 5f300c3313e30b8b127689f7f464b3ad886c73a3 Mon Sep 17 00:00:00 2001 From: James Woolfenden Date: Tue, 29 Aug 2023 11:50:34 +0100 Subject: [PATCH] fix dog food --- .../resource/VMDisablePasswordAuthentication.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/checkov/arm/checks/resource/VMDisablePasswordAuthentication.py b/checkov/arm/checks/resource/VMDisablePasswordAuthentication.py index b5ee7130536..2279fbd0027 100644 --- a/checkov/arm/checks/resource/VMDisablePasswordAuthentication.py +++ b/checkov/arm/checks/resource/VMDisablePasswordAuthentication.py @@ -1,4 +1,4 @@ -from typing import Any + from checkov.common.models.enums import CheckCategories, CheckResult from checkov.arm.base_resource_check import BaseResourceCheck @@ -11,20 +11,20 @@ def __init__(self) -> None: categories = [CheckCategories.ENCRYPTION] super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) - def scan_resource_conf(self, conf: dict[str, Any]) -> CheckResult: + def scan_resource_conf(self, conf) -> CheckResult: if conf.get('properties') and isinstance(conf.get('properties'), dict): properties = conf.get('properties') if properties.get("virtualMachineProfile") and isinstance(properties.get("virtualMachineProfile"), dict): profile = properties.get("virtualMachineProfile") if profile.get("osProfile") and isinstance(profile.get("osProfile"), dict): - osProfile = profile.get("osProfile") + osprofile = profile.get("osProfile") if properties.get("osProfile") and isinstance(properties.get("osProfile"), dict): - osProfile = properties.get("osProfile") - if osProfile is None: + osprofile = properties.get("osProfile") + if osprofile is None: return CheckResult.UNKNOWN - if osProfile.get("linuxConfiguration") and isinstance(osProfile.get("linuxConfiguration"), dict): - config = osProfile.get("linuxConfiguration") + if osprofile.get("linuxConfiguration") and isinstance(osprofile.get("linuxConfiguration"), dict): + config = osprofile.get("linuxConfiguration") if config.get("disablePasswordAuthentication") and isinstance(config.get("disablePasswordAuthentication"), bool): return CheckResult.PASSED return CheckResult.FAILED