Skip to content

fix(query): allow CloudFormation DB security group /24 CIDRs#8057

Open
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/cloudformation-db-sg-24
Open

fix(query): allow CloudFormation DB security group /24 CIDRs#8057
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/cloudformation-db-sg-24

Conversation

@omribz156
Copy link
Copy Markdown

Closes #7988

Reason for Proposed Changes

  • The CloudFormation DB Security Group query currently treats IPv4 /24 CIDRs as larger than 256 hosts.
  • A /24 has exactly 256 addresses, so it should not match the query description: "must not have more than 256 hosts."

Proposed Changes

  • Update the IPv4 threshold so only prefixes smaller than /24 are reported.
  • Add /24 negative fixtures for both inline and standalone CloudFormation ingress resources.
  • Keep the existing /23 positive fixtures as the more-than-256-hosts coverage.

Verification

  • go test ./test -run "TestQueries/cloudFormation/aws/db_security_group_open_to_large_scope" -count=1
  • git diff --check (passed with local CRLF warnings only)

This was implemented with Codex assistance, with the final patch kept focused and manually reviewed.

I submit this contribution under the Apache-2.0 license.

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.

bug(cloudformation): query "DB Security Group Open To Large Scope" triggers on /24 CIDR

1 participant