{"id":20897,"date":"2009-12-16T15:34:15","date_gmt":"2009-12-16T19:34:15","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=20897"},"modified":"2020-10-27T15:28:38","modified_gmt":"2020-10-27T19:28:38","slug":"xwin32-security","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/services\/security\/server\/vulnerability-management\/xprobe\/xwin32-security\/","title":{"rendered":"Securing X-Win32"},"content":{"rendered":"<h3>What is X-Win32<\/h3>\n<p>X-Win32 is an application that provides X-Server capability for the Microsoft Windows operating system.\u00a0 This allows applications running in the Unix\/Linux environment to display graphical user interfaces on the Microsoft Windows desktop.\u00a0 This is needed to run Unix or Linux web browsers or xterminal commands, and to run certain applications like MatLab.<\/p>\n<p>Boston University has purchased a site-license for the X-Win32 product from <a href=\"http:\/\/www.starnet.com\/\">StarNet<\/a> for use by our community. We actively promote its use on our campus for your X-server needs.<\/p>\n<p>The <a href=\"http:\/\/www.opentext.com\/\">Open Text Connectivity Solutions Group<\/a> produces a software package called <a href=\"http:\/\/connectivity.opentext.com\/products\/exceed-products.aspx\">Exceed<\/a> that provides X server software which is also quite popular but is not supported by IS&amp;T at this time.<\/p>\n<h3>X-Win32 Security<\/h3>\n<p>Recent versions of X-Win32 have implemented a much better security model by default, but you will need to understand some aspects of how it works in order to be able to use it reliably, efficiently, and securely.<\/p>\n<p>To begin, you should understand the basics of the X-Windows system and security.\u00a0 If you do not know what xhost and xauth are, you should start by reading about <a href=\".\/xauth\">How X-Windows Access Control Works<\/a>.\u00a0 You may also be interested in knowing <a href=\".\/failure-matters\">what could happen if I fail to secure my X-Windows server<\/a>.<\/p>\n<p>For the impatient, you may jump to the <a href=\"#what\">What Should I Do<\/a> section,<\/p>\n<h3>Access Control in X-Win32<\/h3>\n<p>In X-Win32 the access control system is configured through the Xconfig tool, which can be launched via the Start Menu or by double clicking the X-Win32 Icon in the Task Bar.<\/p>\n<p>The default behavior of X-Win32 varies across versions, but everyone should be running version 9 or newer at this point.\u00a0 In old versions, the default behavior was to allow all connections, which was part of the inspiration to create the <a href=\"\/tech\/services\/security\/server\/vulnerability-management\/xprobe\">X-Windows Security Probe<\/a>.\u00a0 Newer versions have more secure defaults.<\/p>\n<p>If you have an older version of X-Win32 you should <a href=\"\/tech\/services\/infrastructure\/technical-support\/university-site-licensed-software\/xwindows\/\">update to the latest version<\/a>.\u00a0 If for some reason you cannot, please look at our advice on <a href=\"\/tech\/services\/security\/server\/vulnerability-management\/xprobe\/old-xwin32\">Securing Older Version of X-Win32<\/a>.<\/p>\n<p>Inside the XConfig tool there is a Security tab which deals exclusively with access control.\u00a0 The contents of the tab are shown below.<\/p>\n<div id=\"attachment20905\" style=\"width: 566px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment20905\" loading=\"lazy\" class=\"size-full wp-image-20905\" src=\"\/tech\/files\/2009\/12\/xwin32.jpg\" alt=\"Xconfig Security Tab\" width=\"556\" height=\"638\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2009\/12\/xwin32.jpg 556w, https:\/\/www.bu.edu\/tech\/files\/2009\/12\/xwin32-554x636.jpg 554w\" sizes=\"(max-width: 556px) 100vw, 556px\" \/><p id=\"caption-attachment20905\" class=\"wp-caption-text\">Xconfig Security Tab<\/p><\/div>\n<p><strong>Allow by Xauth Cookie<\/strong><\/p>\n<p>In the first section, &#8220;Allow by Xauth Cookie&#8221; you can use the Xauth mechanism to provide authentication. This is a little difficult to use in the Microsoft Windows environment, but if it is the best fit for you then please read the <a href=\"http:\/\/www.starnet.com\/xwin32\/\">X-Win32 help documentation for Xauth<\/a> for more information on how to use it.<\/p>\n<p><strong>Allow by Address<\/strong><\/p>\n<p>The second section, &#8220;Allow by Address&#8221;, you can use xhost style authentication where you allow one or more hosts to connect.\u00a0 There is a radio button at the top marked &#8220;Allow all host addresses&#8221;.\u00a0 Selecting this is equivalent to using &#8220;<em>xhost +<\/em>&#8221; and should not be done.\u00a0 Using the &#8220;Only allow these hosts addresses&#8221; radio button is equivalent to do &#8220;<em>xhost +hostname<\/em>&#8221; for some set of hosts.<\/p>\n<p><strong>Note: If you use SSH forwarding<\/strong>, you will need to add an entry for &#8220;localhost&#8221; (with out the quotes) to your allowed &#8220;Allowed Host Addresses&#8221; list.<\/p>\n<p><strong>Allow by Prompt<\/strong><\/p>\n<p>Finally, the panel offers &#8220;Allow by Prompt&#8221; which features one checkbox: &#8220;Prompt for connections not allowed by other means&#8221;.\u00a0 This last option is a feature that makes X-Windows easier to use under Microsoft Windows:<\/p>\n<p style=\"padding-left: 30px;\">If a client connects without a valid magic cookie (xauth) and isn&#8217;t in the list of allowed hosts (xhost), the X-Server may prompt and ask you if you want to accept the connection.<\/p>\n<p><strong>To check or not to check?<\/strong><\/p>\n<p><strong>If you do check this box<\/strong>: Any time <em>anyone<\/em> attempts to connect to your X-Windows server you will get a dialogue box asking you accept or refuse the connection.\u00a0 Since you cannot control how often people connect to your server, this can become an annoyance.\u00a0 To reduce this annoyance, read our section on <a href=\".\/firewall\">Using the Microsoft Windows Firewall to limit X-Server connections<\/a>.<\/p>\n<p><strong>If you do not check this box:<\/strong> If a connection is made that is not authorized by the other means it will be rejected without any notice to you.\u00a0 Usually this will result in a &#8220;Cannot connect to display&#8221; type error message.<\/p>\n<h3><a name=\"what\"><\/a>What Should I Do?<\/h3>\n<p><strong>Here&#8217;s what we recommend:<\/strong><\/p>\n<ol>\n<li>Do not run X-Win32 except when needed.\n<ol>\n<li>It does not need to launch at boot, launch it when you need it.<\/li>\n<li>When you&#8217;re done using it, single right-click the icon in the system tray and pick &#8220;Exit&#8221; to shut down the X-server.<\/li>\n<\/ol>\n<\/li>\n<li>Use Xauth if you&#8217;re comfortable with it.<\/li>\n<li>For Allow by Address, pick &#8220;Only allow these hosts&#8221; and delete any and all hosts in the &#8220;Allowed Host Addresses&#8221; until it says &#8220;No hosts allowed&#8221;.\n<ol>\n<li>If you use SSH X11 forwarding you will need to add an entry for &#8220;localhost&#8221; (with out the quotes) to the &#8220;Allowed Host Addresses&#8221; list.<\/li>\n<\/ol>\n<\/li>\n<li>Check the &#8220;Prompt for connections not allowed by other means&#8221; in the Allow by Prompt box.<\/li>\n<li>Save this configuration.<\/li>\n<\/ol>\n<p>Here&#8217;s an example of a well-configured system:<\/p>\n<div id=\"attachment20911\" style=\"width: 566px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment20911\" loading=\"lazy\" class=\"size-full wp-image-20911\" src=\"\/tech\/files\/2009\/12\/xwin32_good.jpg\" alt=\"Example of a properly configured x-win32 security tab.\" width=\"556\" height=\"638\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2009\/12\/xwin32_good.jpg 556w, https:\/\/www.bu.edu\/tech\/files\/2009\/12\/xwin32_good-554x636.jpg 554w\" sizes=\"(max-width: 556px) 100vw, 556px\" \/><p id=\"caption-attachment20911\" class=\"wp-caption-text\">Example of a properly configured x-win32 security tab.<\/p><\/div>\n<h3>The Big If<\/h3>\n<p>Here&#8217;s <strong>the big if<\/strong> in this security model:<\/p>\n<p style=\"padding-left: 30px;\"><strong>If<\/strong> you responsibly accept only those connection requests that you are expecting and deny all other connection requests, this will be the most secure way to go.\u00a0 If, however, you accept all requests then you have not achieved any better security than the dreaded <em>xhost +<\/em>.<\/p>\n<p><strong>How this works in practice<\/strong><\/p>\n<p>When you get a connection request a box will appear on the screen.\u00a0 If you are expecting a connection (you just launched Matlab, for example) and the host specified in the dialog box is the host you are expecting the connection from then we want to accept.\u00a0 Before clicking &#8220;yes&#8221; ensure that the &#8220;Always do this&#8221; checkbox is <strong>not<\/strong> checked.\u00a0\u00a0 If you were not expecting a connection, <strong>always<\/strong> select &#8220;No&#8221;.\u00a0 At the very worst you will refuse a connection that you wanted and the client will produce an error similar to &#8220;Cannot connect to display&#8221;.\u00a0 If you refuse a connection you wanted you can always run the remote program again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is X-Win32 X-Win32 is an application that provides X-Server capability for the Microsoft Windows operating system.\u00a0 This allows applications running in the Unix\/Linux environment to display graphical user interfaces on the Microsoft Windows desktop.\u00a0 This is needed to run Unix or Linux web browsers or xterminal commands, and to run certain applications like MatLab&#8230;.<\/p>\n","protected":false},"author":2620,"featured_media":0,"parent":6543,"menu_order":4,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/20897"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/2620"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=20897"}],"version-history":[{"count":13,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/20897\/revisions"}],"predecessor-version":[{"id":131665,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/20897\/revisions\/131665"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/6543"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=20897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}