turbot / steampipe-plugin-azuread

Use SQL to instantly query groups, service principals, users and more from Azure Active Directory. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/azuread
Apache License 2.0
7 stars 12 forks source link

Risky IP / azuread_sign_in_report error #94

Closed Bobaero closed 2 years ago

Bobaero commented 2 years ago

Describe the bug In the Azure SignIn Report, IP Address can be "risky", if so, the IP address contains some "X", and azuread failed with the following error : select * from azuread_sign_in_report; Warning: executeQueries: query 1 of 1 failed: ERROR: rpc error: code = Unknown desc = ip_address: invalid ip address [DELETED].XX (SQLSTATE HV000)

More documentation : https://learn.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-health-adfs-risky-ip

Note : [DELETED] is the first 3 parts of a normal IP Address.

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

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

Many thanks for your help !

Subhajit97 commented 2 years ago

Hi @Bobaero, welcome to Steampipe! Sorry to see that you are running into issues. Appreciate the extra information; it really helps! I have pushed a commit addressing the above issue: https://github.com/turbot/steampipe-plugin-azuread/pull/95

If possible, can you please refer to this PR to validate whether the changes resolve the error?

You can use the below steps to build the plugin locally:

Let us know if you need any help. Thanks!

Bobaero commented 2 years ago

Hi @Subhajit97 ,

First, it's me who thanks you for your time ! You've doing a great job and my Azure AD bring bugs which you can't detect until someone get it :D

I've tried to make the issue-94 branche but i can't build as i get the following error : build github.com/Azure/azure-sdk-for-go/sdk/azcore: cannot load github.com/Azure/azure-sdk-for-go/sdk/azcore: no Go source files

Can you point me the must have go modules ?

Many thanks !

Subhajit97 commented 2 years ago

Hey @Bobaero, interesting. It takes a bit of time but works fine for me. Go modules are already there in go.mod. Few questions:

Bobaero commented 2 years ago

Hum, I'm using Ubuntu on Windows through WSL2.0 and i can only update golang-go to the 1.13.8 linux/amd64 through apt install.

go mod tidy failed with an error : runtime/metrics: malformed module path "runtime/metrics": missing dot in first path element

I'll try to find a way to update my go version.

Bobaero commented 2 years ago

Ok, with go 1.19, things are going smoothly, i'm waiting for the make to complete.

Bobaero commented 2 years ago

And it's working ! No more error due to IP address !

Many thanks !!!

Subhajit97 commented 2 years ago

Great! Thanks again, @Bobaero, for helping out in testing so quickly. Glad the fix worked for you! We have released a new Azure AD plugin version, v0.8.3, including this fix.