dfir-iris / iris-web

Collaborative Incident Response platform
GNU Lesser General Public License v3.0
1.08k stars 184 forks source link

[BUG] login page reloading constantly if the service behind ALB #318

Open barn4k opened 1 year ago

barn4k commented 1 year ago

Describe the bug I have a strange situation, that I cannot login to the dfir-iris if the service is behind the AWS ALB. It accepts my credentials and reloads the login page instead of pushing forward to the dashboard page. I see in the network logs, that I receive 302 for the /dashboard page instead of 200

Screen for the service behind ALB:

image

Screen for the service without ALB:

image

To Reproduce Steps to reproduce the behavior:

  1. Create a new security group for the dfir-iris ALB to allow access on port 8000 from your IPs
  2. Create a new security group for the dfir-iris ec2 instance, allowing access on port 8000 from that ALB security group and from your IPs
  3. Create a EC2 instance with dfir-iris with default listening port of 8000. Attach dfir-iris security group to it
  4. Create an AWS Application Load Balancer with dfir-iris target group that listens port 8000 and attach a dfir-iris alb security group
  5. Connect to the dfir-iris via it's IP (everything should work and the dashboard panel should be opened after the login page)
  6. Connect to the dfir-iris via the ALB DNS name (will receive the login page refresh constantly)

Expected behavior After I enter the credentials, I will get to the dashboard page

Desktop (please complete the following information):

whikernel commented 1 year ago

Hi @barn4k

Is your ALB doing the SSL termination? If not, could you please try on port 443 of IRIS (reverse proxy)?
I think that might be related to this discussion: https://discord.com/channels/922879298786975774/922883501974515733/1129502069951320125 Somehow in some conditions the browser isn't sending the session cookie that was set by the server and thus the server asks to reauth again. You can check that in the network tab of your browser debugger. We still need to understand why :/

barn4k commented 1 year ago

Hm... Seems the problem is with HTTP (we didn't use the HTTPS for testing service)

image