-
Notifications
You must be signed in to change notification settings - Fork 346
feat(query): new query for terraform/azure that ensures that critical data is encrypted with CMK for storage_account #7756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cx-ricardo-jesus
wants to merge
27
commits into
master
Choose a base branch
from
AST-106783-2_1_1_2_1_ensure_critical_data_is_encrypted_with_cmk
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+193
−0
Conversation
This file contains hidden or 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
… is encrypted with cmk" This reverts commit d41459d.
…ypted with CMK for storage_account
…is_encrypted_with_cmk
…with_cmk' of https://github.com/Checkmarx/kics into AST-106783-2_1_1_2_1_ensure_critical_data_is_encrypted_with_cmk
…is_encrypted_with_cmk
…with_cmk' of https://github.com/Checkmarx/kics into AST-106783-2_1_1_2_1_ensure_critical_data_is_encrypted_with_cmk
…is_encrypted_with_cmk
…is_encrypted_with_cmk
…with_cmk' of https://github.com/Checkmarx/kics into AST-106783-2_1_1_2_1_ensure_critical_data_is_encrypted_with_cmk
…is_encrypted_with_cmk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reason for Proposed Changes
azurerm_storage_account
for Terraform/Azure is being encrypted with Customer Managed Keys (CMK).Proposed Changes
azurerm_storage_account
is encrypted with Customer Managed Keys (CMK).customer_managed_key
using the resourceazurerm_storage_account
that are:azurerm_storage_account
with the fieldkey_vault_key_id
defined with the ID of the Key Vault Key inside thecustomer_managed_key
block.azurerm_storage_account_customer_managed_key
resource and reference anazurerm_storage_account
using thestorage_account_id
required field.get_res
takes all the resources as an argument, and handles the following four positive cases:azurerm_storage_account
with acustomer_managed_key
block defined, but with the field key_vault_key_id` defined within,azurerm_storage_account
with the blockcustomer_managed_block
not defined.azurerm_storage_account_customer_managed_block
referencing a resource of typeazurerm_storage_account
through the fieldstorage_account_id
incorrectly(with name that is different from the one on the resource of typeazurerm_storage_account
).azurerm_storage_account_customer_managed_block
referencing a resource of typeazurerm_storage_account
but there is not resource of typeazurerm_storage_account
defined on the template.azurerm_storage_account
with the fieldkey_vault_key_id
defined within thecustomer_managed_key
block or by being referenced by a resource of typeazurerm_storage_account_customer_managed_key
and, the only module that I found that is similar to the resources covered in this query, does not have any fieldkey_valt_key_id
on is documentation and, the fields that can be the reason that a vulnerability is present on the module(key_vault_resource_id
,key_name
, etc...) are all required field thus, it does not make sense to handle the module on the same way we handled the possible vulnerable configurations on the resources mentioned above.I submit this contribution under the Apache-2.0 license.