Skip to content
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

fix(terraform): Fix CKV_AZURE_227 for Azure V4 #6906

Merged
merged 10 commits into from
Dec 16, 2024
Merged

Conversation

tsmithv11
Copy link
Collaborator

@tsmithv11 tsmithv11 commented Dec 14, 2024

User description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Fixes #6881
Fixes #6902

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes


Generated description

Below is a concise technical summary of the changes proposed in this PR:

This pull request includes updates to security checks, refactoring of existing checks, and additional test cases for Azure resources. The changes aim to enhance security measures, improve check accuracy, and ensure comprehensive test coverage.

TopicDetails
Check Refactoring Refactors and expands existing checks for better accuracy and coverage
Modified files (10)
  • tests/terraform/graph/checks/resources/VAisEnabledInStorageAccount/expected.yaml
  • tests/terraform/checks/resource/azure/test_SQLServerNoPublicAccess.py
  • tests/arm/checks/resource/test_MySQLPublicAccessDisabled.py
  • tests/terraform/graph/checks/resources/AzureSQLserverNotOverlyPermissive/expected.yaml
  • tests/terraform/graph/checks/resources/AzureSQLserverNotOverlyPermissive/main.tf
  • tests/terraform/checks/resource/azure/test_AKSNodePublicIpDisabled.py
  • tests/terraform/graph/checks/resources/VAisEnabledInStorageAccount/main.tf
  • checkov/terraform/checks/graph_checks/azure/AzureSQLserverNotOverlyPermissive.yaml
  • checkov/terraform/checks/graph_checks/azure/VAisEnabledInStorageAccount.yaml
  • tests/terraform/checks/resource/azure/test_AKSEncryptionAtHostEnabled.py
Latest Contributors(2)
UserCommitDate
channy-katzfeat-arm-MySQLPublicAc...May 22, 2024
tdefisefix-terraform-Fixing-i...October 16, 2023
Security Enhancements Improves security measures for Azure resources including TLS versions, public access controls, and encryption
Modified files (13)
  • checkov/terraform/checks/resource/azure/SQLServerNoPublicAccess.py
  • checkov/arm/checks/resource/MySQLPublicAccessDisabled.py
  • checkov/terraform/checks/resource/azure/AKSEncryptionAtHostEnabled.py
  • tests/arm/checks/resource/example_FunctionAppMinTLSVersion/pass4.json
  • checkov/arm/checks/resource/FunctionAppMinTLSVersion.py
  • checkov/terraform/checks/resource/azure/AKSNodePublicIpDisabled.py
  • tests/arm/checks/resource/example_TestMySQLPublicAccessDisabled/pass2.json
  • tests/terraform/checks/resource/azure/example_SQLServerNoPublicAccess/main.tf
  • checkov/terraform/checks/resource/azure/FunctionAppMinTLSVersion.py
  • tests/arm/checks/resource/example_TestMySQLPublicAccessDisabled/fail2.json
  • tests/terraform/checks/resource/azure/example_AKSNodePublicIpDisabled/main.tf
  • tests/terraform/checks/resource/azure/example_AKSEncryptionAtHostEnabled/main.tf
  • tests/terraform/checks/resource/azure/example_FunctionAppMinTLSVersion/main.tf
Latest Contributors(2)
UserCommitDate
channy-katzfeat-arm-MySQLPublicAc...May 22, 2024
rutiNalengerfeat-arm-add-CKV_AZURE...May 22, 2024
This pull request is reviewed by Baz. Join @tsmithv11 and the rest of your team on (Baz).

if (node_pool.get('enable_host_encryption') == [True] or
node_pool.get('host_encryption_enabled') == [True]):
return CheckResult.PASSED
self.evaluated_keys = ['default_node_pool/[0]/enable_host_encryption',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update the evaluated_keys here? What is the reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For highlighting in the platform (and fix suggestions, but not relevant for this check)

Copy link
Contributor

@talazuri talazuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor comments

@tsmithv11 tsmithv11 merged commit 7e0f74f into main Dec 16, 2024
34 of 35 checks passed
@tsmithv11 tsmithv11 deleted the fix-azurev4-dec24 branch December 16, 2024 11:05
Saarett pushed a commit that referenced this pull request Dec 16, 2024
* Fix CKV_AZURE_227

* Fix CKV_AZURE_145

* fix flake8

* add flexible servers

* fix flake8

* Fix CKV_AZURE_11

* Update checks

* Update check

* Update check

* Add types
Saarett pushed a commit that referenced this pull request Dec 16, 2024
* Fix CKV_AZURE_227

* Fix CKV_AZURE_145

* fix flake8

* add flexible servers

* fix flake8

* Fix CKV_AZURE_11

* Update checks

* Update check

* Update check

* Add types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants