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(azurerm_redis_cache): Update policy to detect non_ssl_port_enabled #7028

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rannaladasu
Copy link

@rannaladasu rannaladasu commented Feb 27, 2025

User description

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

Description

The current Checkov policy is looking for enable_non_ssl_port, which is no longer valid after the change in version 4.0.0. The correct attribute is now non_ssl_port_enabled. This update modifies RedisCacheEnableNonSSLPort.py to align with the latest attribute name, ensuring proper detection of misconfigurations.

Fixes # (issue)

New/Edited policies (Delete if not relevant)

https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-networking-policies/ensure-that-only-ssl-are-enabled-for-cache-for-redis

Description

https://registry.terraform.io/providers/hashicorp/azurerm/4.0.0/docs/resources/redis_cache#non_ssl_port_enabled-7

Fix

How does someone fix the issue in code and/or in runtime?

Checklist:

  • [x ] I have performed a self-review of my own code
  • [ x] 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
  • [ x] New and existing tests pass locally with my changes

Generated description

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

Updates the RedisCacheEnableNonSSLPort check to use the new non_ssl_port_enabled attribute for Azure Redis Cache resources in Terraform configurations.

Latest Contributors(1)
UserCommitDate
[email protected]RedisCacheEnableNonSSL...March 17, 2021
This pull request is reviewed by Baz. Join @rannaladasu and the rest of your team on (Baz).

…nabled

The current Checkov policy is looking for enable_non_ssl_port, which is no longer valid after the change in version 4.0.0. The correct attribute is now non_ssl_port_enabled. This update modifies RedisCacheEnableNonSSLPort.py to align with the latest attribute name, ensuring proper detection of misconfigurations.
@tsmithv11
Copy link
Collaborator

@rannaladasu thanks for the contribution! Version 3 is still actively maintained and used, so it would be better if the check supported both the old and new field. Can you make those changes and add tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants