fix(query): add supports for Microsoft.Web/sites/config on Web App Not Using TLS Last Version for AzureResourceManager #7928
+239
−1
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
"Web App Not Using TLS Last Version"does not take into account the scenarios where a resource of typeMicrosoft.Web/sites/config, which is a 'child' resource fromMicrosoft.Web/sites, does not have the fieldminTlsVersiondefined or when it's defined to a version below 1.2.Proposed Changes
siteConfig.minTlsVersionwas not defined or when it was defined to a version that is not either1.2or1.3. The only changes in this policy are that it also searches for child resources and verifies if there are none. This is to prevent this policy from flagging the cases when the parent resource of typeMicrosoft.Web/sitesdoes not have the fieldminTlsVersiondefined, but the child resource of typeMicrosoft.Web/sites/configcan have or not any vulnerable configuration, which the second policy targets.Microsoft.Web/siteshas one or more child resources of typeMicrosoft.Web/sites/configand use an helper function calledcheck_tls_versionto handle all three scenarios:minTlsVersiondefined, and the parent resource has the field defined to a version that is not either1.2or1.3.minTlsVersiondefined.1.2or1.3.I submit this contribution under the Apache-2.0 license.