-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into BCE-24535-python-CDK-policies
- Loading branch information
Showing
89 changed files
with
3,681 additions
and
2,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
checkov/arm/checks/parameter/SecureStringParameterNoHardcodedValue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 14 additions & 7 deletions
21
checkov/arm/checks/resource/APIServicesUseVirtualNetwork.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
from checkov.common.models.enums import CheckResult, CheckCategories | ||
from checkov.arm.base_resource_check import BaseResourceCheck | ||
from typing import Any | ||
|
||
# https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2019-08-01/sites | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
from checkov.common.models.enums import CheckCategories | ||
|
||
|
||
class AppServiceHttps20Enabled(BaseResourceCheck): | ||
def __init__(self): | ||
class AppServiceHttps20Enabled(BaseResourceValueCheck): | ||
def __init__(self) -> None: | ||
name = "Ensure that 'HTTP Version' is the latest if used to run the web app" | ||
id = "CKV_AZURE_18" | ||
supported_resources = ["Microsoft.Web/sites"] | ||
categories = [CheckCategories.NETWORKING] | ||
supported_resources = ("Microsoft.Web/sites",) | ||
categories = (CheckCategories.NETWORKING,) | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def scan_resource_conf(self, conf): | ||
properties = conf.get("properties") | ||
if isinstance(properties, dict): | ||
site_config = properties.get("siteConfig") | ||
if isinstance(site_config, dict) and site_config.get("http20Enabled"): | ||
return CheckResult.PASSED | ||
return CheckResult.FAILED | ||
def get_inspected_key(self) -> str: | ||
# https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2019-08-01/sites | ||
return "properties/siteConfig/http20Enabled" | ||
|
||
def get_expected_value(self) -> Any: | ||
return "true" | ||
|
||
|
||
check = AppServiceHttps20Enabled() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
from checkov.common.models.enums import CheckResult, CheckCategories | ||
from checkov.arm.base_resource_check import BaseResourceCheck | ||
from typing import Any | ||
|
||
# https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2019-08-01/sites | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
from checkov.common.models.enums import CheckCategories | ||
|
||
|
||
class AppServiceMinTLSVersion(BaseResourceCheck): | ||
def __init__(self): | ||
class AppServiceMinTLSVersion(BaseResourceValueCheck): | ||
def __init__(self) -> None: | ||
name = "Ensure web app is using the latest version of TLS encryption" | ||
id = "CKV_AZURE_15" | ||
supported_resources = ["Microsoft.Web/sites"] | ||
categories = [CheckCategories.NETWORKING] | ||
supported_resources = ("Microsoft.Web/sites",) | ||
categories = (CheckCategories.NETWORKING,) | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def scan_resource_conf(self, conf): | ||
properties = conf.get("properties") | ||
if isinstance(properties, dict): | ||
site_config = properties.get("siteConfig") | ||
if isinstance(site_config, dict) and site_config.get("minTlsVersion") == "1.2": | ||
return CheckResult.PASSED | ||
return CheckResult.FAILED | ||
def get_inspected_key(self) -> str: | ||
# https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2019-08-01/sites | ||
return "properties/siteConfig/minTlsVersion" | ||
|
||
def get_expected_value(self) -> Any: | ||
return "1.2" | ||
|
||
|
||
check = AppServiceMinTLSVersion() |
20 changes: 12 additions & 8 deletions
20
checkov/arm/checks/resource/AzureManagedDiskEncryptionSet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
checkov/arm/checks/resource/CognitiveServicesDisablesPublicNetwork.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.