Skip to content

fix(query): added one extra verification on the ECS Cluster Not Encrypted At Rest query#7563

Merged
cx-ricardo-jesus merged 5 commits into
Checkmarx:masterfrom
cx-ricardo-jesus:AST-40770
Jul 30, 2025
Merged

fix(query): added one extra verification on the ECS Cluster Not Encrypted At Rest query#7563
cx-ricardo-jesus merged 5 commits into
Checkmarx:masterfrom
cx-ricardo-jesus:AST-40770

Conversation

@cx-ricardo-jesus

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • The query correctly detected when the TransitEncryption field in the EFSVolumeConfiguration block was explicitly set to "DISABLED".
  • However, it did not handle the case where the TransitEncryption field is missing.
  • According to the AWS documentation, when TransitEncryption is not defined, the default behavior is to treat it as "DISABLED", which poses a security risk.
  • Therefore, the query need to be extended in order to also report a vulnerability when TransitEncryption is not defined.

Proposed Changes

  • Created the is_transit_encryption_disabled helper function to check if the TransitEncryption field is set to "DISABLED" (explicitly written or by default).
  • Updated the first policy, adding a verification that uses the helper function created with the purpose of handling the case described above.
  • I also ensured that the expected issue messages clearly refer to the default behavior when the field is not set.
  • Added one extra positive test in json format, with the field TransitEncryption not set, which should return a positive result and warning that when this field is not set, the default value is set to DISABLED.

I submit this contribution under the Apache-2.0 license.

@cx-ricardo-jesus cx-ricardo-jesus requested a review from a team as a code owner July 16, 2025 11:15
@github-actions github-actions Bot added community Community contribution query New query feature aws PR related with AWS Cloud labels Jul 16, 2025

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, good work

@cx-eduardo-semanas cx-eduardo-semanas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@cx-ricardo-jesus cx-ricardo-jesus merged commit 805ad00 into Checkmarx:master Jul 30, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws PR related with AWS Cloud community Community contribution query New query feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants