-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42e2bd8
commit ac64208
Showing
12 changed files
with
133 additions
and
221 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
policy/checkov/ACRPublicNetworkAccessDisabled.azapi.mock.json
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,63 @@ | ||
{ | ||
"mock": { | ||
"default": { | ||
"resource_changes": [{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azapi_resource", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
"type": "Microsoft.ContainerRegistry/registries@2023-11-01-preview", | ||
"body": { | ||
"properties": { | ||
"publicNetworkAccess": "Disabled" | ||
} | ||
} | ||
} | ||
} | ||
}] | ||
}, | ||
"invalid_true": { | ||
"resource_changes": [{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azapi_resource", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
"type": "Microsoft.ContainerRegistry/registries@2023-11-01-preview", | ||
"body": { | ||
"properties": { | ||
"publicNetworkAccess": "Enabled" | ||
} | ||
} | ||
} | ||
} | ||
}] | ||
}, | ||
"invalid_omitted": { | ||
"resource_changes": [{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azapi_resource", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
"type": "Microsoft.ContainerRegistry/registries@2023-11-01-preview", | ||
"body": { | ||
"properties": { | ||
} | ||
} | ||
} | ||
} | ||
}] | ||
} | ||
} | ||
} |
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,15 @@ | ||
package checkov | ||
|
||
import rego.v1 | ||
|
||
valid_azapi_container_registry_public_network_access_disabled(resource) if { | ||
resource.values.body.properties.publicNetworkAccess == "Disabled" | ||
} | ||
|
||
deny_CKV_AZURE_139 contains reason if { | ||
resource := data.utils.resource(input, "azapi_resource")[_] | ||
data.utils.is_azure_type(resource.values, "Microsoft.ContainerRegistry/registries") | ||
not valid_azapi_container_registry_public_network_access_disabled(resource) | ||
|
||
reason := sprintf("checkov/CKV_AZURE_139: Ensure ACR set to disable public networking: %s, https://github.com/bridgecrewio/checkov/blob/main/checkov/terraform/checks/resource/azure/ACRPublicNetworkAccessDisabled.py", [resource.address]) | ||
} |
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,54 @@ | ||
{ | ||
"mock": { | ||
"default": { | ||
"resource_changes": [ | ||
{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azurerm_container_registry", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
"public_network_access_enabled": false | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"invalid_true": { | ||
"resource_changes": [ | ||
{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azurerm_container_registry", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
"public_network_access_enabled": true | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"invalid_omitted": { | ||
"resource_changes": [ | ||
{ | ||
"address": "azurerm_container_registry.acr", | ||
"mode": "managed", | ||
"type": "azurerm_container_registry", | ||
"change": { | ||
"actions": [ | ||
"create" | ||
], | ||
"after": { | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
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
28 changes: 0 additions & 28 deletions
28
policy/checkov/azurerm/ACRPublicNetworkAccessDisabled.azapi.rego.bak
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
policy/checkov/azurerm/ACRPublicNetworkAccessDisabled.mock.json.bak
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
policy/checkov/azurerm/ACRPublicNetworkAccessDisabled.py.bak
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
policy/checkov/azurerm/ACRPublicNetworkAccessDisabled.tf.bak
This file was deleted.
Oops, something went wrong.