Removed broken type conversion in NSG resource #564
Merged
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.
Signed-off-by: Joe McCrea joe.mccrea@sap.com
Description
We discovered an issue when scanning certain Network Security Groups.
Within the 'destination_port_ranges' function, which takes 'properties' as an argument, a type conversion is done on 'properties' to convert it to a hash. This does not work and causes a nil value to be assigned to the new 'properties_hash' variable.
Any time this is then used it does not return the expected value, meaning that the proper checks are not carried out in order to return the correct value for the destination port ranges. The only reason this is not very visible or obvious is due to the values returned from the Azure API, as when 'destinationPortRanges' is returned, 'destinationPortRange' is not returned at all in the response. However when 'destinationPortRange' is returned, an empty value is returned for 'destinationPortRanges' here, which makes it look like the checks have worked even though they have not.
Issues Resolved
Bug in specific situations when the Network Security Group resource is used.
Check List
rake lint
passes