Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-site POST form submissions are forbidden #838

Open
shertyben opened this issue Sep 18, 2024 · 5 comments
Open

Cross-site POST form submissions are forbidden #838

shertyben opened this issue Sep 18, 2024 · 5 comments
Assignees

Comments

@shertyben
Copy link

shertyben commented Sep 18, 2024

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo git clone --depth 1 --branch v1.7.5 https://github.com/intuitem/ciso-assistant-community.git
  2. cd ciso-assistant-community && vim docker-compose.yml
  3. Edit CISO_ASSISTANT_URL=http://localhost:8443 on both backend and caddy containers
  4. Edit PUBLIC_BACKEND_API_EXPOSED_URL=http://localhost:8443/api on backend container
  5. Add ORIGIN=http://localhost:8443 to backend container
  6. sh docker-compose.sh
  7. Fill in e-mail and password
  8. linx http://localhost:8443
  9. Fill in user and password and click on login
  10. See error Cross-site POST form submissions are forbidden

Expected behavior
Open dashboard

Screenshots
image

Environment (please complete the following information):

  • Device: VM Machine Proxmox
  • OS: Rocky Linux 8
  • Browser lynx, brave

Additional context
As per recommandations of this issue #227 (comment), added ORIGIN env variable but keep getting same error.

Below my docker-compose.yml

version: "3.9"

services:
backend:
container_name: backend
image: ghcr.io/intuitem/ciso-assistant-community/backend:latest
restart: always
environment:
- ALLOWED_HOSTS=backend,localhost,localhost
- CISO_ASSISTANT_URL=http://localhost:8443
- DJANGO_DEBUG=True
- AUTH_TOKEN_TTL=7200
volumes:
- ./db:/code/db

frontend:
container_name: frontend
environment:
- PUBLIC_BACKEND_API_URL=http://backend:8000/api
- PUBLIC_BACKEND_API_EXPOSED_URL=http://localhost:8443/api
- PROTOCOL_HEADER=x-forwarded-proto
- HOST_HEADER=x-forwarded-host
- ORIGIN=http://localhost:8443
image: ghcr.io/intuitem/ciso-assistant-community/frontend:latest
depends_on:
- backend

caddy:
container_name: caddy
image: caddy:2.7.6
environment:
- CISO_ASSISTANT_URL=http://localhost:8443
depends_on:
- frontend
restart: unless-stopped
ports:
- 8443:8443
volumes:
- ./caddy_data:/data
command: |
sh -c 'echo $$CISO_ASSISTANT_URL "{
reverse_proxy /api/iam/sso/redirect/ backend:8000
reverse_proxy /api/accounts/saml/0/acs/ backend:8000
reverse_proxy /api/accounts/saml/0/acs/finish/ backend:8000
reverse_proxy /* frontend:3000
}" > Caddyfile && caddy run'

@eric-intuitem
Copy link
Collaborator

On port 8443 it is https protocol, not http. Can you try again?

@shertyben
Copy link
Author

On port 8443 it is https protocol, not http. Can you try again?
Hello Eric, tried also to update http to https but, got same result.

@Mohamed-Hacene
Copy link
Collaborator

Hi @shertyben,

I have successfully tried the exact same docker-compose.yml as you, so I think that issue is related to your environment. How are you accessing CISO Assistant, from your VM directly ?

@shertyben
Copy link
Author

Hi @Mohamed-Hacene ,
Yes, i'm trying to connect from the local VM using lynx http://localhost:8443
I keep getting the same error.

@Mohamed-Hacene
Copy link
Collaborator

Mohamed-Hacene commented Sep 19, 2024

Ok, will try to test it in the same environment as you and let you know how it was

@Mohamed-Hacene Mohamed-Hacene self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants