Skip to content

feat(query): implements "Beta - Storage Account Not Using Latest SMB Protocol Version"#7828

Merged
cx-andre-pereira merged 3 commits into
masterfrom
AST-116655_46_9.1.2_ensure_smb_protocol_version_is_set_to_smb_3.1.1_or_higher
Dec 5, 2025
Merged

feat(query): implements "Beta - Storage Account Not Using Latest SMB Protocol Version"#7828
cx-andre-pereira merged 3 commits into
masterfrom
AST-116655_46_9.1.2_ensure_smb_protocol_version_is_set_to_smb_3.1.1_or_higher

Conversation

@cx-andre-pereira

@cx-andre-pereira cx-andre-pereira commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • Currently there is no query to ensure that resources of type "azurerm_storage_account" has the "share_properties.smb.versions" array set to ["SMB3.1.1"].

  • Quoting CIS_Microsoft_Azure_Foundations_Benchmark_v5.0.0 page 479:

    • "Ensure that SMB file shares are configured to use the latest supported SMB protocol version. Keeping the SMB protocol updated helps mitigate risks associated with older SMB versions, which may contain vulnerabilities and lack essential security controls."
    • "Using the latest supported SMB protocol version enhances the security of SMB file shares by preventing the exploitation of known vulnerabilities in outdated SMB versions."
  • In the CIS Benchmark it is also stated that, by default, "all SMB versions are allowed".

Proposed Changes

  • Implemented the missing query.

  • The query will flag a "azurerm_storage_account" resource given any one of these 6 scenarios :

    • Undefined "share_properties" block
    • Undefined "share_properties.smb" block
    • Undefined "share_properties.smb.versions" field
    • Having its "share_properties.smb.versions" field set to []
    • Having its "share_properties.smb.versions" field not include the "SMB3.1.1" value
    • Having its "share_properties.smb.versions" include the "SMB3.1.1" value together with other, outdated, SMB protocol versions.
  • Note the "issueType" will be "MissingAttribute" for the first 3 scenarios and "IncorrectValue" for the last 3.

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions Bot added feature New feature query New query feature labels Nov 6, 2025
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.17

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@github-actions github-actions Bot added terraform Terraform query azure PR related with Azure Cloud labels Nov 6, 2025
@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review November 6, 2025 15:36
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner November 6, 2025 15:36

@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-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-andre-pereira cx-andre-pereira merged commit 8f70449 into master Dec 5, 2025
29 checks passed
@cx-andre-pereira cx-andre-pereira deleted the AST-116655_46_9.1.2_ensure_smb_protocol_version_is_set_to_smb_3.1.1_or_higher branch December 5, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure PR related with Azure Cloud feature New feature query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants