Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARG fix for D07.22 #945

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

ARG fix for D07.22 #945

wants to merge 1 commit into from

Conversation

igorjnzl
Copy link
Contributor

@igorjnzl igorjnzl commented Oct 1, 2024

Description

Small change in graph query to fix parsing issue. Renaming output to make results more readable

Checklist

  • [ x] I've tested my changes to ensure they are ready for review.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the documentation (if applicable).
  • [ x] Resource Graph queries have been included (and tested) for recommendations where ever possible1.
  • Resource Graph queries have NOT been included (please explain below).

Footnotes

  1. Details on how to add Azure Resource Graph queries to recommendations can be found here.

@igorjnzl igorjnzl requested review from a team as code owners October 1, 2024 20:02
Copy link
Collaborator

@brsteph brsteph left a comment

Choose a reason for hiding this comment

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

We need to add the compliant returned property to the query, and we want it to show the compliant and not compliant. I did a quick rework for this:

resources | where type =~ 'Microsoft.Network/azureFirewalls' | where isempty(properties.virtualHub.id) or isnull(properties.virtualHub.id) | mv-expand ipConfig = properties.ipConfigurations | project name, firewallId = id, tags, vNetName = split(ipConfig.properties.subnet.id, '/', 8)[0], vNetId = tolower(substring(ipConfig.properties.subnet.id, 0, indexof(ipConfig.properties.subnet.id, '/subnet'))) | join kind=fullouter ( resources | where type =~ 'Microsoft.Network/ddosProtectionPlans' | mv-expand vNet = properties.virtualNetworks | project ddosProtectionPlanId = id, vNetId = tolower(vNet.id) ) on vNetId | extend compliant = iif(isempty(ddosProtectionPlanId), false, true) | project name, compliant, id = firewallId, tags, network = strcat('vNet: ', vNetName)

Would that be OK to use instead? That way it works with the dashboarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants