snowflakedb / SnowAlert

Security Analytics Using The Snowflake Data Warehouse
Apache License 2.0
179 stars 57 forks source link

SnowAlert WebUI Connection #481

Open cdom-4587 opened 3 years ago

cdom-4587 commented 3 years ago

I recently downloaded the docker image and was setting up SnowAlert to test on my personal Snowflake account. I followed the instructions from this link, https://docs.snowalert.com/getting-started, and made it to the point where I had to login to the UI with my account. Once I put in my credentials, I came to a screen that says "Acquiring Access Token". My problem is it stays stuck on this screen. Could it be related to the Security Integration creation within Snowflake? SnowAlert Access Token Screen

.

sfc-gh-afedorov commented 3 years ago

Thanks for trying out SnowAlert. Does the server's stdout or stderr streams in the terminal give any hint of what's going wrong? At this step, the WebUI should be making a request to the backend for the last part of the OAuth exchange.

cdom-4587 commented 3 years ago

I don't see anything that stands out to me. I have attached a screenshot of the current stream. Terminal

sfc-gh-afedorov commented 3 years ago

What browser are you using? Is there anything in the JavaScript Console?

cdom-4587 commented 3 years ago

I was primarily using Edge but I also tried to connect through Chrome and ran into the same issue. I didn't see anything in the JavaScript console either.

sfc-gh-afedorov commented 3 years ago

Strange! In the Developer Console Resource tab, do you see the server response to POST /api/sa/oauth/return including an access token, and does it show up in Local Storage section of the Application tab?

cdom-4587 commented 3 years ago

I found a message saying "This is an invalid client". Response

sfc-gh-afedorov commented 3 years ago

That sounds like the OAuth client secrets the server needs for the access token exchange aren't making it. Did you set the environment variables are set right, e.g. OAUTH_CLIENT_AB12345 and OAUTH_SECRET_AB12345?

cdom-4587 commented 3 years ago

The issue was with the environment variables. The OAUTH_CLIENT was set correctly but the OAUTH_SECRET had quotation marks around it. Once I removed the quotations, it connected successfully. Thank you for your help and quick responses.

smitthakkar1 commented 2 years ago

@cdom-4587 @sfc-gh-afedorov I am getting the same error and I have check my env variables and they don't have any quote. I am not sure why I get the same error.

image

General question : I noticed Snowalert git repo was last updated more than a year ago. Is it safe to use it in my company project ? Is there any other alternative ?

sfc-gh-afedorov commented 2 years ago

Sorry I missed this earlier, glad you re-asked in #608.

Panther is one available alternative, but costs money. Our product team is working on native alerting which will cover a lot of use-cases including SnowAlert's, but is not yet available publicly and probably doesn't have a public timeline (ask our support team for a more authoritative answer).

It might not have quotes, but could there be any other deviations from the way setup is documented in https://docs.snowalert.com/getting-started#snowalert-webui?