{"id":8652,"date":"2015-10-08T03:30:14","date_gmt":"2015-10-08T02:30:14","guid":{"rendered":"https:\/\/wp.okra.host\/article\/platform-isolation-overview\/"},"modified":"2021-03-07T14:43:26","modified_gmt":"2021-03-07T13:43:26","slug":"platform-isolation-overview","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/platform-isolation-overview\/","title":{"rendered":"\u00dcbersicht \u00fcber die Plattformisolierung"},"content":{"rendered":"<h2 id=\"overview\" >\u00dcbersicht<\/h2>\n<p>Okra Host utilizes a unique platform that consists of multiple security subsystems and user roles to yield optimal throughput and keep your account secure. This article will explain how account partitioning works.<\/p>\n<h2 id=\"filesystem-layers\" >Filesystem Layers<\/h2>\n<p>Every account is comprised of several layers of files. These layers are read-only and provide a basic environment for services to operate. The top-most layer is\u00a0a read-write <strong>client layer<\/strong>. Any file created within the\u00a0<strong>pivot root<\/strong> resides on this top-most layer. Any file in the read-only layer is copied up to the <strong>client layer<\/strong>. If a duplicate file exists on multiple layers, the top-most layer is used. It will always be the read-write\u00a0<strong>client layer<\/strong>. Every <strong>client layer<\/strong> is separate from <em>andere<\/em> <strong>client layers<\/strong> ensuring integrity.<\/p>\n<pre style=\"padding-left: 30px\">\/home\/virtual\/site180\/shadow\/.aufs.xino\r\n\/home\/virtual\/site180\/shadow=rw\r\n\/home\/virtual\/FILESYSTEMTEMPLATE\/siteinfo=ro\r\n\/home\/virtual\/FILESYSTEMTEMPLATE\/ssh=ro<\/pre>\n<div style=\"padding-left: 30px\"><span style=\"color: #0000ff\"><strong>Figure:<\/strong><\/span> A sample filesystem layout. &#8220;ro&#8221; is read-only. &#8220;rw&#8221; is read-write. FILESYSTEMTEMPLATE are part of the basic layer shared by all accounts. &#8220;.aufs.xino&#8221; is a system file used by aufs for inode recycling\/translation.<\/div>\n<h3 id=\"benefits\" >Benefits<\/h3>\n<p>By keeping multiple layers shared between accounts, updates can be easily deployed, as well as new features. Separate layers also allow the primary user to manipulate system files without affecting other users or server integrity. In the event of an <a href=\"https:\/\/kb.okra.host\/de\/platform\/handling-a-hijacked-account\/\">account hack<\/a>, damage is limited only to the account read-write layer, which is isolated from system layers.<\/p>\n<h2 id=\"pivot-roots\" >Pivot Roots<\/h2>\n<p>Every process, except for PHP, operates within a <strong>pivot root<\/strong>. A <strong>pivot root<\/strong> is a separate filesystem with a separate environment from the main server that provides an environment in which applications can run. Each account has a <strong>pivot root<\/strong> tailored to that account. Depending upon the services enabled (terminal, Ruby, Java), different layers will be incorporated into the <strong>pivot root<\/strong>.<\/p>\n<h3 id=\"benefits\" >Benefits<\/h3>\n<p>A pivot root provides a personalized experience for you comprised of your files. As you add, remove, and modify\u00a0it, every application spawned from your account will inherit these changes. This ensures that your account will remain consistent and independent from its neighbors, like a virtual private server,\u00a0as it ages. In the event of an <a href=\"https:\/\/kb.okra.host\/de\/platform\/handling-a-hijacked-account\/\">account hack<\/a>, damage is limited only to the account read-write layer, which is isolated from other accounts.<\/p>\n<h2 id=\"php\" >PHP<\/h2>\n<p>PHP is the exception to the rule. PHP operates as an interpreted language embedded within the HTTP server (ISAPI module) for performance. HTTP processes have access to the entire filesystem, which is a composition of the system service filesystem + account <strong>pivot roots<\/strong>.\u00a0As HTTP processes spin-up and spin-down to accommodate server loads, the PHP interpreter is copied into each process. Consequently, only the HTTP process is necessary to serve a page, unlike CGI implementations that spawn a\u00a0<em>separate PHP process<\/em> to handle runtime compilation. CGI implementations leave behind dormant processes with compiled code in-memory anticipating future requests. ISAPI, on the otherhand, immediately releases the memory occupied by code anticipating a new request. This provides a <strong>memory-efficient implementation for PHP and the highest throughput<\/strong>.<\/p>\n<h3 id=\"php-security\" >PHP Security<\/h3>\n<p style=\"text-align: left\">Since PHP requests operate outside of a <strong>pivot root<\/strong>, special care is necessary to ensure PHP can only access your files and run trusted code. A separate set of directory restrictions are in place restricting PHP from accessing files outside your <a href=\"https:\/\/kb.okra.host\/de\/php\/open_basedir-restriction-messages\/\">absolute root<\/a>. A second pass restricts access to binaries non-conducive to PHP, including <code>rm<\/code>, <code>mv<\/code>, und <code>cp<\/code> via <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Access_Control_Lists\">access control lists<\/a>. A table below provides the PHP functions that provide similar functionality to the respective Linux commands:<\/p>\n<table>\n<caption><em>PHP equivalents of shell functions<\/em><\/caption>\n<tbody>\n<tr>\n<th>Shell command<\/th>\n<th>PHP equivalent<\/th>\n<\/tr>\n<tr>\n<td>mv<\/td>\n<td><a href=\"http:\/\/php.net\/rename\">rename<\/a>(oldname, newname)<\/td>\n<\/tr>\n<tr>\n<td>cp<\/td>\n<td><a href=\"http:\/\/php.net\/copy\">copy<\/a>(src, dest)<\/td>\n<\/tr>\n<tr>\n<td>rm<\/td>\n<td><a href=\"http:\/\/php.net\/unlink\">unlink<\/a>(file)<\/td>\n<\/tr>\n<tr>\n<td>rmdir<\/td>\n<td><a href=\"http:\/\/php.net\/rmdir\">rmdir<\/a>(dir)<\/td>\n<\/tr>\n<tr>\n<td>touch<\/td>\n<td><a href=\"http:\/\/php.net\/touch\">touch<\/a>(file)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"see-also\" >Siehe auch<\/h2>\n<ul>\n<li>KB: <a href=\"https:\/\/kb.okra.host\/de\/php\/open_basedir-restriction-messages\/\">open_basedir-Beschr\u00e4nkungsmeldung<\/a> (PHP)<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview Okra Host utilizes a unique platform that consists of multiple security subsystems and user roles to yield optimal throughput and keep your account secure. This article will explain how account partitioning works. Filesystem Layers Every account is comprised of several layers of files. These layers are read-only and provide&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[64],"ht-kb-tag":[],"class_list":["post-8652","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-platform"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8652"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8652\/revisions"}],"predecessor-version":[{"id":8653,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8652\/revisions\/8653"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8652"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8652"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}