Skip to content

Azure - Authorization_RequestDenied and incorrect JSON parsing #2323

Open
@SebDougnac

Description

@SebDougnac

Description

Hello,

I have two issues when trying to use Fix Inventory with my Azure subscription.

First, I get errors on some of my Network Security Groups as below :
Workflow collect started with id 5aa9ff1a-16b6-11f0-a7eb-0242ac120004.
09:21:58 workflow=collect,task=5aa9ff1a-16b6-11f0-a7eb-0242ac120004 [azure:] Failed to parse json into AzureNetworkSecurityGroup: Error for key security_rules: Error for key destination_port_ranges: invalid literal for int() with base 10: ''. Source: {'name': '', 'id': '', 'etag': '', 'type': 'Microsoft.Network/networkSecurityGroups', 'location': '', 'tags': {}, 'properties

Seems like it can't handle the case where destination port range is empty (in the ARM template, it's an empty array).

Secondly, I get an error that stops the workflow totally :
09:22:40 workflow=collect,task=5aa9ff1a-16b6-11f0-a7eb-0242ac120004 [azure:] [Authorization_RequestDenied] (Authorization_RequestDenied) Insufficient privileges to complete the operation.
Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation. Services and actions affected: graph: https://graph.microsoft.com/v1.0/organization

I have triple checked the authorizations and everything is as per the documentation.
I have an App Registration declared with the user_impersonation API permission granted and the Reader role on my subscription.

Thank you for your help.

Version

4.2.0

Environment

No response

Steps to Reproduce

  1. Have an Azure subscription
  2. Create a Network Security Group with rules containing empty destination port ranges
  3. Follow the documentation to setup Fix Inventory on Azure

Logs

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions