-
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 redefine-install-discover
- Loading branch information
Showing
57 changed files
with
4,974 additions
and
2,249 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from checkov.common.models.consts import ANY_VALUE | ||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
|
||
|
||
class CosmosDBHaveCMK(BaseResourceValueCheck): | ||
def __init__(self): | ||
name = "Ensure that Cosmos DB accounts have customer-managed keys to encrypt data at rest" | ||
id = "CKV_AZURE_100" | ||
supported_resources = ['Microsoft.DocumentDb/databaseAccounts'] | ||
categories = [CheckCategories.NETWORKING] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self): | ||
return 'properties/keyVaultKeyUri' | ||
|
||
def get_expected_value(self): | ||
return ANY_VALUE | ||
|
||
|
||
check = CosmosDBHaveCMK() |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
|
||
|
||
class KeyBackedByHSM(BaseResourceValueCheck): | ||
def __init__(self): | ||
name = "Ensure that key vault key is backed by HSM" | ||
id = "CKV_AZURE_112" | ||
supported_resources = ['Microsoft.KeyVault/vaults/keys'] | ||
categories = [CheckCategories.BACKUP_AND_RECOVERY] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self): | ||
return 'properties/kty' | ||
|
||
def get_expected_value(self): | ||
return 'RSA-HSM' | ||
|
||
def get_expected_values(self): | ||
return [self.get_expected_value(), 'EC-HSM'] | ||
|
||
|
||
check = KeyBackedByHSM() |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
from checkov.common.models.consts import ANY_VALUE | ||
|
||
|
||
class KeyExpirationDate(BaseResourceValueCheck): | ||
def __init__(self) -> None: | ||
name = "Ensure that the expiration date is set on all keys" | ||
id = "CKV_AZURE_40" | ||
supported_resources = ['Microsoft.KeyVault/vaults/keys'] | ||
categories = [CheckCategories.GENERAL_SECURITY] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self) -> str: | ||
return 'properties/rotationPolicy/attributes/expiryTime' | ||
|
||
def get_expected_value(self) -> str: | ||
return ANY_VALUE | ||
|
||
|
||
check = KeyExpirationDate() |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
|
||
|
||
class MySQLGeoBackupEnabled(BaseResourceValueCheck): | ||
def __init__(self): | ||
name = "Ensure that My SQL server enables geo-redundant backups" | ||
id = "CKV_AZURE_94" | ||
supported_resources = ['Microsoft.DBforMySQL/flexibleServers'] | ||
categories = [CheckCategories.BACKUP_AND_RECOVERY] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self): | ||
return 'properties/Backup/geoRedundantBackup' | ||
|
||
|
||
check = MySQLGeoBackupEnabled() |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
from checkov.common.models.consts import ANY_VALUE | ||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_value_check import BaseResourceValueCheck | ||
|
||
|
||
class SecretContentType(BaseResourceValueCheck): | ||
def __init__(self): | ||
name = "Ensure that key vault secrets have \"content_type\" set" | ||
id = "CKV_AZURE_114" | ||
supported_resources = ['Microsoft.KeyVault/vaults/secrets'] | ||
categories = [CheckCategories.GENERAL_SECURITY] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self) -> str: | ||
return "properties/contentType" | ||
|
||
def get_expected_value(self) -> Any: | ||
return ANY_VALUE | ||
|
||
|
||
check = SecretContentType() |
23 changes: 23 additions & 0 deletions
23
checkov/arm/checks/resource/SynapseWorkspaceEnablesManagedVirtualNetworks.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from __future__ import annotations | ||
|
||
|
||
from checkov.common.models.enums import CheckCategories | ||
from checkov.arm.base_resource_negative_value_check import BaseResourceNegativeValueCheck | ||
|
||
|
||
class SynapseWorkspaceEnablesManagedVirtualNetworks(BaseResourceNegativeValueCheck): | ||
def __init__(self) -> None: | ||
name = "Ensure that Azure Synapse workspaces enables managed virtual networks" | ||
id = "CKV_AZURE_58" | ||
supported_resources = ['Microsoft.Synapse/workspaces'] | ||
categories = [CheckCategories.NETWORKING] | ||
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources) | ||
|
||
def get_inspected_key(self) -> str: | ||
return 'properties/managedVirtualNetwork' | ||
|
||
def get_forbidden_values(self) -> str: | ||
return "default" | ||
|
||
|
||
check = SynapseWorkspaceEnablesManagedVirtualNetworks() |
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
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
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 +1 @@ | ||
version = '2.4.15' | ||
version = '2.4.23' |
Oops, something went wrong.