turbot / steampipe-mod-azure-compliance

Run individual configuration, compliance and security controls or full compliance benchmarks for CIS, HIPAA HITRUST, NIST, and more across all of your Azure subscriptions using Powerpipe and Steampipe.
https://hub.powerpipe.io/mods/turbot/azure_compliance
Apache License 2.0
56 stars 16 forks source link

Handle error null in iam_user_not_allowed_to_create_security_group & iam_user_not_allowed_to_register_application #216

Closed rajlearner17 closed 1 year ago

rajlearner17 commented 1 year ago

Describe the bug A clear and concise description of what the bug is. Used in CIS controls

  select
      a.id as resource,
      case
        when a.default_user_role_permissions ->> 'allowedToCreateSecurityGroups' = 'false' then 'ok'
        else 'alarm'
      end as status,
      case
        when a.default_user_role_permissions ->> 'allowedToCreateSecurityGroups' = 'false' then a.display_name || ' does not allow user to create security groups.'
        else a.display_name || ' allows user to create security groups.'
      end as reason,
      t.tenant_id
    from
      azure_tenant as t,
      azuread_authorization_policy as a;
Error: null (SQLSTATE HV000)

+----------+--------+--------+-----------+
| resource | status | reason | tenant_id |
+----------+--------+--------+-----------+
+----------+--------+--------+-----------+

Same result for iam_user_not_allowed_to_register_application

Steampipe version (steampipe -v) Example: v0.3.0

Plugin version (steampipe plugin list) Example: v0.5.0

To reproduce Steps to reproduce the behavior (please include relevant code and/or commands).

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

khushboo9024 commented 1 year ago

@rajlearner17 Thanks for raising the issue. The above query functions smoothly with a premium Azure AD, but it encounters errors when used with a free Azure AD.

Resolving this issue requires addressing it at the plugin level since the error originates from the table itself.

image
misraved commented 1 year ago

@khushboo9024 could you please raise an issue in the plugin to handle this error?