fix(query): change to keyExpectedValue on ARM 'default_azure_storage_account_network_access_is_too_permissive' query - #8101
Open
cx-andre-pereira wants to merge 7 commits into
Conversation
…nexpected values that are not enabled/allow, like the new 'SecuredByPerimeter'; Added bew samples for the new possible value
cx-andre-pereira
marked this pull request as ready for review
August 20, 2026 13:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for Proposed Changes
default_azure_storage_account_network_access_is_too_permissive" query states that "publicNetworkAccess should be set to false", when the actual value recommendation should be setting the targetpublicNetworkAccessfield to 'Disabled'.'Disabled' | 'Enabled' | 'SecuredByPerimeter'.Proposed Changes
Simply adjusted the query's
keyExpectedValueto properly reflect the valid options; now it is recommended that thepublicNetworkAccessfield be set to 'Disabled'.Another small adjustment was made on the "deny" recommendation to reflect use of single quotes (for consistency sake given the keyActualValue(s) used) , and the use of uppercase on the value ('Deny'), as per the documented valid values on the
defaultActionfield.Note
The query does not explicitly handle the case for the '
SecuredByPerimeter' value, considering that older documentation (2021) does not mention this value as a possibility, it is likely the query did not take it into account when first developed.It was decided that the '
SecuredByPerimeter' value be considered unsafe and so changes to the query structure itself took place:Enabled"/"Allow" values as the only ones that should be flagged, take a more reliable approach of flagging for any value whenpublicNetworkAccessand/ordefaultActionare not set to "Disabled"/"Deny" .With this change any additions to the list of possible values for each of the fields will cause the query to flag said value and properly display it on the new keyActualValue(s).
I believe this approach to be more reliable in the sense that it's likely that future new values will also be deemed too permissive and, even if they are not, this way we will see False Positive results pop up which are substantially easier to identify over the False Negatives that could go by unnoticed with the current approach.
Added new tests for scenarios involving the '
SecuredByPerimeter' value of thepublicNetworkAccessfield.I submit this contribution under the Apache-2.0 license.