<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: xsoar initial admin login fails - websockets error and CSRF token match problem in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/527475#M1641</link>
    <description>&lt;P&gt;I figured this out.&lt;BR /&gt;&lt;BR /&gt;If you want to connect to xsoar via http via nginx as a https-terminated reverse proxy, you need to add this line to the first location directive:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;proxy_cookie_path / "/; secure";&lt;/PRE&gt;
&lt;P&gt;In the context of a nginx server{} section:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;map $http_upgrade $connection_upgrade {
	default upgrade;
	''	close;
}

server {
	listen [::]:443 ssl http2;
	listen 443 ssl http2;
	server_name xsoar.example.com;

	ssl_certificate		/etc/ssl/certs/example.com.cert.pem;
	ssl_certificate_key	/etc/ssl/certs/example.com.key.pem;

	ssl_session_cache	builtin:1000	shared:SSL:10m;

	access_log	/var/log/nginx/demisto.access.log;

	location / {
		proxy_set_header	Host $host;
		proxy_set_header	X-Real-IP $remote_addr;
		proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header	X-Forwarded-Proto $scheme;
		proxy_pass		http://localhost:8080;
		proxy_read_timeout	90;
		proxy_cookie_path	/	"/; secure";
	}

	location ~ ^/(acc_\S+/)?(websocket|d1ws|d2ws) {
		proxy_pass		http://localhost:8080;
		proxy_http_version	1.1;
		proxy_set_header	Upgrade $http_upgrade;
		proxy_set_header	Connection "upgrade";
		proxy_set_header	Host $host;
		proxy_set_header	Origin "";
		proxy_set_header	X-Real-IP $remote_addr;
		proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header	X-Forwarded-Proto $scheme;
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;1. The certificate example is a wildcard cert for *.example.com.&lt;/P&gt;
&lt;P&gt;2. The ssl config is handled in the http{} section which is not included here.&lt;/P&gt;
&lt;P&gt;3. This assumes xsoar is listening on http port 80.&lt;/P&gt;
&lt;P&gt;4. ipv6 and http v2 are also included above.&lt;/P&gt;
&lt;P&gt;5. Remember to reload nginx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The /etc/demisto.conf:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
	"Server": {
		"HttpPort": "8080"
	},
	"container": {
		"engine": {
			"type": "docker"
		}
	},
	"custom": {
		"fields": {
			"validate": {
				"grid": {
					"values": true
				}
			}
		}
	},
	"db": {
		"index": {
			"entry": {
				"disable": true
			}
		}
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;1. Remember to reload demisto.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 23:42:16 GMT</pubDate>
    <dc:creator>bchill</dc:creator>
    <dc:date>2023-01-17T23:42:16Z</dc:date>
    <item>
      <title>xsoar initial admin login fails - websockets error and CSRF token match problem</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/516350#M1263</link>
      <description>&lt;P&gt;I installed xsoar 6.6 according to the instructions and am using nginx as a front-end.&amp;nbsp; I also configured nginx according to the instructions, but I am connecting to xsoar from nginx via http and port 8080 (as opposed to https/443 as used in the example nginx config).&lt;BR /&gt;&lt;BR /&gt;I created the otc.conf.json file with the initial admin user and restarted the server, but I cannot login.&lt;BR /&gt;&lt;BR /&gt;In the Chrome console, I see this when I open the xsoar page:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;light-bundle-1647266668075.js?v=1647266668075:38&lt;STRONG&gt; WebSocket connection to 'wss://xsoar.example.com/websocket' failed: &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Oe @ light-bundle-1647266668075.js?v=1647266668075:38&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(anonymous) @ light-bundle-1647266668075.js?v=1647266668075:315&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;n @ light-bundle-1647266668075.js?v=1647266668075:1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(anonymous) @ light-bundle-1647266668075.js?v=1647266668075:1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(anonymous) @ light-bundle-1647266668075.js?v=1647266668075:1&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;In the xsoar server.log file, I see these each time I try to login:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2022-09-29 05:51:37.4687 error CSRF values not match (source: /builds/GOPATH/src/code.pan.run/xsoar/server/web/middleware.go:447)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I have no idea what the problem is.&lt;BR /&gt;&lt;BR /&gt;Does anyone have a clue?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 11:07:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/516350#M1263</guid>
      <dc:creator>bchill</dc:creator>
      <dc:date>2022-09-29T11:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: xsoar initial admin login fails - websockets error and CSRF token match problem</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/516881#M1264</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/240824"&gt;@bchill&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to get better traction for this I'm moving this discussion to the Cortex XSOAR area.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;-Kiwi.&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Oct 2022 10:10:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/516881#M1264</guid>
      <dc:creator>kiwi</dc:creator>
      <dc:date>2022-10-05T10:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: xsoar initial admin login fails - websockets error and CSRF token match problem</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/518430#M1300</link>
      <description>&lt;P&gt;Update:&lt;BR /&gt;&lt;BR /&gt;The websockets error also comes up when I set up xsoar directly on 443 (i.e. w/o nginx, etc), but logins do work as expected. The CSRF match errors do not show up in the server.log, however. That means that the websockets error is benign and not related. This is clearly about the CSRF matching.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:35:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/518430#M1300</guid>
      <dc:creator>bchill</dc:creator>
      <dc:date>2022-10-19T19:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: xsoar initial admin login fails - websockets error and CSRF token match problem</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/527475#M1641</link>
      <description>&lt;P&gt;I figured this out.&lt;BR /&gt;&lt;BR /&gt;If you want to connect to xsoar via http via nginx as a https-terminated reverse proxy, you need to add this line to the first location directive:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;proxy_cookie_path / "/; secure";&lt;/PRE&gt;
&lt;P&gt;In the context of a nginx server{} section:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;map $http_upgrade $connection_upgrade {
	default upgrade;
	''	close;
}

server {
	listen [::]:443 ssl http2;
	listen 443 ssl http2;
	server_name xsoar.example.com;

	ssl_certificate		/etc/ssl/certs/example.com.cert.pem;
	ssl_certificate_key	/etc/ssl/certs/example.com.key.pem;

	ssl_session_cache	builtin:1000	shared:SSL:10m;

	access_log	/var/log/nginx/demisto.access.log;

	location / {
		proxy_set_header	Host $host;
		proxy_set_header	X-Real-IP $remote_addr;
		proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header	X-Forwarded-Proto $scheme;
		proxy_pass		http://localhost:8080;
		proxy_read_timeout	90;
		proxy_cookie_path	/	"/; secure";
	}

	location ~ ^/(acc_\S+/)?(websocket|d1ws|d2ws) {
		proxy_pass		http://localhost:8080;
		proxy_http_version	1.1;
		proxy_set_header	Upgrade $http_upgrade;
		proxy_set_header	Connection "upgrade";
		proxy_set_header	Host $host;
		proxy_set_header	Origin "";
		proxy_set_header	X-Real-IP $remote_addr;
		proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header	X-Forwarded-Proto $scheme;
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;1. The certificate example is a wildcard cert for *.example.com.&lt;/P&gt;
&lt;P&gt;2. The ssl config is handled in the http{} section which is not included here.&lt;/P&gt;
&lt;P&gt;3. This assumes xsoar is listening on http port 80.&lt;/P&gt;
&lt;P&gt;4. ipv6 and http v2 are also included above.&lt;/P&gt;
&lt;P&gt;5. Remember to reload nginx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The /etc/demisto.conf:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
	"Server": {
		"HttpPort": "8080"
	},
	"container": {
		"engine": {
			"type": "docker"
		}
	},
	"custom": {
		"fields": {
			"validate": {
				"grid": {
					"values": true
				}
			}
		}
	},
	"db": {
		"index": {
			"entry": {
				"disable": true
			}
		}
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;1. Remember to reload demisto.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 23:42:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-initial-admin-login-fails-websockets-error-and-csrf-token/m-p/527475#M1641</guid>
      <dc:creator>bchill</dc:creator>
      <dc:date>2023-01-17T23:42:16Z</dc:date>
    </item>
  </channel>
</rss>

