{"id":132,"date":"2009-07-31T01:00:12","date_gmt":"2009-07-31T07:00:12","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=132"},"modified":"2019-10-30T06:18:01","modified_gmt":"2019-10-30T12:18:01","slug":"suhosin","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/suhosin\/","title":{"rendered":"Suhosin .."},"content":{"rendered":"<p><strong>What is Suhosin?<\/strong><\/p>\n<p>Suhosin is an advanced protection system for PHP installations.<\/p>\n<p>Designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core.<\/p>\n<p>Suhosin comes in two independent parts:-<\/p>\n<p>The first part is a small patch against the PHP core, that implements a few low-level protections against bufferoverflows or format string vulnerabilities .<\/p>\n<p>The second part is a powerful PHP extension that implements all the other protections.<\/p>\n<p><!--more--><\/p>\n<p><strong>Installing Suhosin:<\/strong><\/p>\n<p>Download the source file for the Suhosin extension<\/p>\n<p>cd \/usr\/local\/<\/p>\n<p>wget http:\/\/www.hardened-php.net\/suhosin\/sin-0.9.18.tgz<\/p>\n<p>tar -zxvf suhosin-0.9.18.tgz<\/p>\n<p>cd suhosin-0.9.18<\/p>\n<p>phpize<\/p>\n<p>.\/configure<\/p>\n<p>make<\/p>\n<p>make install<\/p>\n<p>copy suhosin.so to \/usr\/lib\/php\/extensions since our php.ini points to that directory.<\/p>\n<p><strong>Checking PHP :<\/strong><\/p>\n<p>php -i |grep php.ini<\/p>\n<p>Configuration File (php.ini) Path =&gt; \/usr\/local\/Zend\/etc\/php.ini<\/p>\n<p>Edit the php.ini<\/p>\n<p>vi \/usr\/local\/Zend\/etc\/php.ini<\/p>\n<p>Step 1) Ensure the include path\/extension is set properly.Search for: extension_dir<\/p>\n<p>You should see something like this:<\/p>\n<p>include_path = .:\/usr\/lib\/php:\/usr\/local\/lib\/php:\/usr\/lib\/php\/extensions:\/usr\/lib\/php\/extens ions\/no-debug-non-zts-20020429: ;extension_dir = \/usr\/lib\/php\/extensions\/no-debug-non-zts-20020429\/ ; directory in which the loadable extensions (modules) reside.<\/p>\n<p>Step 2) Add the suhosin.so extension to php.ini<\/p>\n<p>Search for Dynamic Extensions:<\/p>\n<p>EG you should see:<\/p>\n<p>extension=suhosin.so<\/p>\n<p><strong>Advanced Suhosin Configuration :<\/strong><\/p>\n<p>Modules:<\/p>\n<p>Logging Configuration<\/p>\n<p>Executor Options<\/p>\n<p>Misc Options<\/p>\n<p>Transparent Encryption Options<\/p>\n<p>Filtering Options<\/p>\n<p><strong>Advantages :<\/strong><\/p>\n<p>Suhosin is a patch protection for protecting PHP. In clear, you dont need to run apache as cgi to setup suhosin, and this will probably be a very good additional.<\/p>\n<p>Suhosin to control disable_functions per user and set open_basedir.<\/p>\n<p><strong>Disadvantages :<\/strong><\/p>\n<p>Check to make sure that PHP is not compiled with enable-versioning.<\/p>\n<p>Versioning breaks extensions. You will need to recompile PHP and make sure versioning is turned OFF.<\/p>\n<p>This only applies if you are using Zend Optimizer. Make sure you are using at least version 3.2.1 or above of Zend Optimizer.<\/p>\n<p>The extention has strict security settings and there is no guarantee that even useful, safe functions will not be blocked.<\/p>\n<p>Output of Suhosin:<\/p>\n<p>php -v<\/p>\n<p>PHP 4.4.6 (cli) (built: Mar 19 2007 09:54:33)?<\/p>\n<p>with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies<\/p>\n<p>with Suhosin v0.9.18, Copyright (c) 2002-2006, by Hardened-PHP Project<\/p>\n<p>with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies<\/p>\n<p><strong>Note to 64 bit OS users:<\/strong><\/p>\n<p>Check to make sure php.ini is using the proper extension_dir setting:<\/p>\n<p>extension_dir = \/usr\/lib64\/php4<\/p>\n<p>http:\/\/mysite.com\/phpinfo.php<\/p>\n<p><strong>Article Authored by Vinu Vijayan <\/strong><\/p>\n<p><strong>Author, Vinu Vijayan, is a Systems Engineer with SupportPRO. Vinu specializes in L2 and L3 Linux\/Windows administration. SupportPRO offers 24X7 technical support services to Web hosting companies and service providers.<\/strong><\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Suhosin? Suhosin is an advanced protection system for PHP installations. Designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core.&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-general-topics"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":8,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":4484,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions\/4484"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}