<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1568325478662481719</id><updated>2011-07-30T22:40:16.744+03:00</updated><category term='Policy'/><category term='IPv6'/><category term='Mobile'/><category term='server core'/><category term='IIS 7.5'/><category term='Lighttpd'/><category term='MySQL'/><category term='NAC'/><category term='SFTP'/><category term='WordPress'/><category term='Nginx'/><category term='Certificate Authority'/><category term='Switch'/><category term='Cisco'/><category term='VSFTP'/><category term='Physical security'/><category term='Firewall'/><category term='Router'/><category term='3G'/><category term='PHP'/><category term='Drupal'/><category term='encryption'/><category term='Vulnerability Assessment'/><category term='Tomcat'/><category term='RedHat'/><category term='PIX'/><category term='ASA'/><category term='FTP'/><category term='Solaris'/><category term='SSL'/><category term='Windows 2008'/><category term='Apache'/><category term='Resin'/><category term='FWSM'/><category term='backup'/><category term='Cloud computing'/><title type='text'>Security 24/7</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-8950818765867783172</id><published>2010-08-22T22:22:00.004+03:00</published><updated>2010-08-22T22:51:16.483+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cloud computing'/><title type='text'>Cloud computing vision</title><content type='html'>Cloud computing is the latest buzz on the Internet this days.&lt;br /&gt;What does it mean to us and where does the future of Cloud computing goes?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Some background&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;In the mid 90's, we had Citrix, with its vision for server based-computing.&lt;br /&gt;Works similar to the Mainframe idea who came couple of decades before - you put all your resources on one server, and thin clients connect to receive resources.&lt;br /&gt;Couple of years later, we had new buzz, called ASP (Application service provider), which according to Wikipedia is a business that provides computer-based services to customers over a network.&lt;br /&gt;Few years later, ASP changed its name to SaaS (Software as a service), which also referred to as software on demand.&lt;br /&gt;In between, we had VMware who presented to world (at least the most famous) server virtualization.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;What is Cloud Computing?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;According to Wikipedia, Cloud computing is Internet-based computing, whereby shared resources, software, and information are provided to computers and other devices on demand, like the electricity grid.&lt;br /&gt;The idea of Cloud computing, enables the customers to avoid investing money on hardware and network equipment, and instead, renting usage from third-party provider.&lt;br /&gt;&lt;u&gt;Cloud computing has the following key features:&lt;/u&gt;&lt;br /&gt;* Agility improves with users' ability to rapidly and inexpensively re-provision technological infrastructure resources.&lt;br /&gt;* Cost is claimed to be greatly reduced.&lt;br /&gt;* Device and location independence enable users to access systems using a web browser regardless of their location or what device they are using (e.g., PC, mobile).&lt;br /&gt;* Multi-tenancy enables sharing of resources and costs across a large pool of users.&lt;br /&gt;* Reliability is improved if multiple redundant sites are used, which makes well designed cloud computing suitable for business continuity and disaster recovery.&lt;br /&gt;* Scalability via dynamic ("on-demand") provisioning of resources on a fine-grained, self-service basis near real-time, without users having to engineer for peak loads.&lt;br /&gt;* Maintenance cloud computing applications are easier to maintain, since they don't have to be installed on each user's computer.&lt;br /&gt;* Metering cloud computing resources usage should be measurable and should be metered per client and application on daily, weekly, monthly, and annual basis.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;The confusion point and vision&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;People tend to confuse between companies moving their data-centers and applications toward the cloud, and actual Cloud computing providers.&lt;br /&gt;A real Cloud computing provider is built from large-scale data centers around the world.&lt;br /&gt;Each rack is built from cheap (to manufacture) hot-swappable hardware - it's time to say goodbye to 1U-4U servers from all major vendors (HP, IBM, DELL, SUN, etc).&lt;br /&gt;Each blade has many core CPU (4-core, 6-core and above), with allot of memory (as much as the hardware supports).&lt;br /&gt;Each blade is connected to large-scale storage grid.&lt;br /&gt;Everything must be redundant - you must be able to add new racks on-demand, without affecting any customer.&lt;br /&gt;Servers, network equipment and storage devices must be configured in active-active clusters.&lt;br /&gt;Data should be replicated on the fly between data centers across the world, in-order to provide 24/7 availability.&lt;br /&gt;Guest operating system must be able to move between physical servers, transparently, as VMware introduced in its VMotion technology.&lt;br /&gt;Server maintenance should be performed on schedule basis - since everything is transparent to the customer, firmware upgrades, patch management and software/application upgrades will not affect any customer.&lt;br /&gt;The hardware/network/storage layer should be separated from the application layer, so that current SaaS companies will be able to integrate their current applications to the cloud era, and work transparently with Cloud computing infrastructure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Cloud computing Achilles&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The thing that drives most people off the cloud is security.&lt;br /&gt;Customers can't physically protect their hardware, since they don't own it.&lt;br /&gt;Customers having troubles protecting their data, since everything is built on virtual machines, connected to shared virtual storage.&lt;br /&gt;I hope that in the near future information security professionals will be able to close this gap, and enable customers transparent, cheap and secure solutions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-8950818765867783172?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/8950818765867783172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/cloud-computing-vision.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8950818765867783172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8950818765867783172'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/cloud-computing-vision.html' title='Cloud computing vision'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-9116294855555694970</id><published>2010-08-13T17:15:00.003+03:00</published><updated>2010-08-13T17:28:21.091+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Resin'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Lighttpd'/><category scheme='http://www.blogger.com/atom/ns#' term='Solaris'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='Nginx'/><title type='text'>Generating self-signed SSL certificate using OpenSSL</title><content type='html'>OpenSSL allows you to request, sign, generate, export and convert digital certificates.&lt;br /&gt;OpenSSL comes by-default in Unix platform as an RPM or package file (RedHat, Solaris, etc).&lt;br /&gt;The guide bellow explains how to generate a key store for digital certificates, generate private and self-signed SSL certificate for web servers, and export/convert the key store to PFX file (for importing to Windows platform).&lt;br /&gt;The guide bellow was tested on common Linux platform web servers (Apache, Lighttpd, Nginx, Resin) however the same syntax should work the same on Windows platform.&lt;br /&gt;&lt;strong&gt;Download link for Windows binaries:&lt;/strong&gt;&lt;u&gt; &lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.slproweb.com/products/Win32OpenSSL.html"&gt;http://www.slproweb.com/products/Win32OpenSSL.html&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Download link for Linux source files (pre-compiled): &lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.openssl.org/source/"&gt;http://www.openssl.org/source/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. Install OpenSSL.&lt;br /&gt;2. Run the command bellow to generate a new key store called “&lt;span style="color:#000099;"&gt;server.key&lt;/span&gt;”&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;openssl genrsa -des3 -out /tmp/server.key 1024&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;3. Run the commands bellow to request a new SSL certificate:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;openssl req -new -x509 -nodes -sha1 -days 1095 -key /tmp/server.key &gt; /tmp/server.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;openssl x509 -noout -fingerprint -text &lt; /tmp/server.crt &gt; /tmp/server.info&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. Run the command bellow to backup the key store file that has a password:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;cp /tmp/server.key /tmp/server.key.bak&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Run the command bellow to generate a new key store without a password:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;openssl rsa -in /tmp/server.key -out /tmp/no.pwd.server.key&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. Run the command bellow only if you need to generate a PEM file that contains a chain of both the key store and the public key in one file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;cat /tmp/no.pwd.server.key /tmp/server.crt &gt; /tmp/no.pwd.server.pem&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;7. Run the command bellow only if you need to export a key store (without a password) to a PFX file (for importing to Windows platform)&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;openssl pkcs12 -export -in /tmp/server.crt -inkey /tmp/no.pwd.server.key -certfile /tmp/no.pwd.server.pem -out /tmp/server.pfx&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Appendix:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;server.key&lt;/span&gt;&lt;/strong&gt; - Key store file&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;server.crt&lt;/span&gt;&lt;/strong&gt; - Server SSL public key file&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;no.pwd.server.key&lt;/span&gt;&lt;/strong&gt; - Key store file (without a password)&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;no.pwd.server.pem&lt;/span&gt;&lt;/strong&gt; - Key store file + server SSL public key file (without a password)&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;server.pfx&lt;/span&gt;&lt;/strong&gt; - Private key + public key, exportable for Windows platform (i.e IIS server)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-9116294855555694970?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/9116294855555694970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/generating-self-signed-ssl-certificate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/9116294855555694970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/9116294855555694970'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/generating-self-signed-ssl-certificate.html' title='Generating self-signed SSL certificate using OpenSSL'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3782014918395896456</id><published>2010-08-10T21:30:00.004+03:00</published><updated>2010-08-10T21:49:05.836+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Policy'/><category scheme='http://www.blogger.com/atom/ns#' term='Vulnerability Assessment'/><title type='text'>Security Vulnerability Assessment Process and Policy</title><content type='html'>&lt;span style="font-size:130%;"&gt;Overview: &lt;/span&gt;&lt;br /&gt;&lt;dd&gt;&lt;br /&gt;In order to maintain high security standards, identify potential vulnerabilities and evaluate the effectiveness of various security controls that were implemented within the infrastructure, it is crucial to perform periodic security assessments.&lt;br /&gt;&lt;/dd&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Goal:&lt;br /&gt;&lt;/span&gt;&lt;dd&gt;&lt;br /&gt;This procedure defines the controls and steps that are required for identifying security vulnerabilities and ensuring reasonable level of security for the infrastructure and application levels.&lt;br /&gt;&lt;/dd&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Process:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;External Facing:&lt;br /&gt;&lt;dd&gt;&lt;br /&gt;1. Perform automated external application level scans on a daily basis for website and application. (e.g. McAfee Secure, Acunetix).&lt;br /&gt;2. Perform automated external network level scans on a weekly basis (e.g. McAfee Secure)&lt;br /&gt;3. Perform in-house, half automated scans with a vulnerability assessment tool (e.g. Qualys)&lt;br /&gt;4. Execute a dedicated application level and network penetration test by a professional third party.&lt;br /&gt;This should be executed twice a year or on every major application release.&lt;br /&gt;&lt;/dd&gt;&lt;br /&gt;Internal:&lt;br /&gt;&lt;dd&gt;&lt;br /&gt;1. Discovery: run NMAP scan on all VLANs to identify all the devices and create an asset inventory that outlines devices and services. [weekly / monthly]&lt;br /&gt;2. Network and Infra vulnerabilities: Run a weekly scan with NESSUS or similar tool to identify infrastructure gap and non hardened devices.&lt;br /&gt;3. Purchase and run vulnerability scanner (such as Qualys or NetIQ) – every week.&lt;br /&gt;4. Patch Management:&lt;br /&gt;    a. Install Microsoft WSUS server to maintain security patches for Windows infrastructure.&lt;br /&gt;    b. Install Linux YUM server to maintain security patches for RedHat infrastructure.&lt;br /&gt;    c. Generate reports on weekly basis to find vulnerable systems.&lt;br /&gt;5. Penetration test: run an annual internal pen-test to identify internal gaps with orientation to threats from within the organization.&lt;br /&gt;&lt;/dd&gt;&lt;br /&gt;Implement a Production Change Management policy that includes a hardening and implementation clearance process for new devices (e.g. addition of new network device, operating system, web server, DB server, etc).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3782014918395896456?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3782014918395896456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/security-vulnerability-assessment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3782014918395896456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3782014918395896456'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/security-vulnerability-assessment.html' title='Security Vulnerability Assessment Process and Policy'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-2217976583298613696</id><published>2010-08-10T21:06:00.003+03:00</published><updated>2010-08-10T21:26:35.895+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Resin'/><title type='text'>How to implement SSL on Resin 4.0.8</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2010/08/resin-professional-408-installation.html"&gt;Hardening guide for Resin Professional 4.0.8 on RHEL 5.4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Change permissions on the keys folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chmod 640 /usr/local/resin/keys&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;3. Run the command bellow to generate a key pair:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/usr/bin/openssl genrsa -des3 -out /usr/local/resin/keys/server.key 1024&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Specify a complex pass phrase for the private key (and document it)&lt;br /&gt;4. Run the command bellow to generate the CSR:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/usr/bin/openssl req -new -newkey rsa:1024 -nodes -keyout /usr/local/resin/keys/server.key -out /tmp/resin.csr&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: The command above should be written as one line.&lt;br /&gt;5. Send the file &lt;span style="color:#000099;"&gt;/tmp/resin.csr&lt;/span&gt; to a Certificate Authority server.&lt;br /&gt;6. As soon as you receive the signed public key from the CA server via email, copy all lines starting with “&lt;span style="color:#000099;"&gt;Begin&lt;/span&gt;” and ending with “&lt;span style="color:#000099;"&gt;End&lt;/span&gt;” (include those two lines), into notepad, and save the file as "&lt;span style="color:#000099;"&gt;server.crt&lt;/span&gt;"&lt;br /&gt;7. Copy the file "&lt;span style="color:#000099;"&gt;server.crt&lt;/span&gt;" using SCP into &lt;span style="color:#000099;"&gt;/usr/local/resin/keys/&lt;/span&gt;&lt;br /&gt;8. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;span style="color:#000099;"&gt;ca-bundle.crt&lt;/span&gt;” (Note: &lt;strong&gt;&lt;span style="color:#990000;"&gt;The file must be PEM (base64) encoded&lt;/span&gt;&lt;/strong&gt;).&lt;br /&gt;9. Copy the file "&lt;span style="color:#000099;"&gt;ca-bundle.crt&lt;/span&gt;" using SCP into &lt;span style="color:#000099;"&gt;/usr/local/resin/keys/&lt;/span&gt;&lt;br /&gt;10. Edit using VI, the file &lt;span style="color:#000099;"&gt;/usr/local/resin/conf/resin.xml&lt;/span&gt; and replace the section bellow from:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;!-- SSL port configuration: --&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;http address="*" port="8443"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;jsse-ssl self-signed-certificate-name="resin@localhost"/&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/http&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;http address="&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;" port="443"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;openssl&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;certificate-key-file&lt;str&gt;&gt;&lt;/str&gt;/usr/local/resin/keys/server.key&lt;str&gt;&lt;&lt;/str&gt;/certificate-key-file&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;certificate-file&lt;str&gt;&gt;&lt;/str&gt;/usr/local/resin/keys/server.crt&lt;str&gt;&lt;&lt;/str&gt;/certificate-file&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;certificate-chain-file&lt;str&gt;&gt;&lt;/str&gt;/usr/local/resin/keys/ca-bundle.crt&lt;str&gt;&lt;&lt;/str&gt;/certificate-chain-file&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;password&lt;str&gt;&gt;&lt;/str&gt;&lt;span style="color:#006600;"&gt;my-password&lt;/span&gt;&lt;str&gt;&lt;&lt;/str&gt;/password&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/openssl&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/http&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace “&lt;span style="color:#000099;"&gt;my-password&lt;/span&gt;” with the password for the “&lt;span style="color:#000099;"&gt;server.key&lt;/span&gt;” file.&lt;br /&gt;11. Restart the Resin services:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/etc/init.d/resin restart&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;12. Backup the file &lt;span style="color:#000099;"&gt;/usr/local/resin/keys/server.key&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-2217976583298613696?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/2217976583298613696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/how-to-implement-ssl-on-resin-408.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2217976583298613696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2217976583298613696'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/how-to-implement-ssl-on-resin-408.html' title='How to implement SSL on Resin 4.0.8'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-5390048894284687792</id><published>2010-08-09T21:43:00.005+03:00</published><updated>2010-08-09T22:44:07.896+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resin'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><title type='text'>Hardening guide for Resin Professional 4.0.8 on RHEL 5.4</title><content type='html'>Pre-requirements:&lt;br /&gt;• JDK 1.6 source file&lt;br /&gt;• Resin Professional 4.0.8 source file&lt;br /&gt;&lt;br /&gt;Installation phase&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;groupadd resin&lt;br /&gt;useradd -g resin -d /home/resin -s /bin/bash resin&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Create folder for the web content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;mkdir -p /www&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. Updating Ownership and Permissions on the web content folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chown -R root /www&lt;br /&gt;chmod -R 775 /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;5. Copy JDK 1.6 into /tmp&lt;br /&gt;6. Change the permissions on the JDK 1.6:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chmod +x /tmp/jdk-6u20-linux-i586-rpm.bin&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;7. Run the command bellow to install JDK 1.6:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/tmp/jdk-6u20-linux-i586-rpm.bin&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Remove the JDK 1.6 source files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;rm -f /tmp/jdk-6u20-linux-i586-rpm.bin&lt;br /&gt;rm -f /usr/java/jdk1.6.0_20/src.zip&lt;br /&gt;rm -rf /usr/java/jdk1.6.0_20/demo&lt;br /&gt;rm -rf /usr/java/jdk1.6.0_20/sample&lt;br /&gt;rm -rf /opt/sun/javadb/demo&lt;br /&gt;rm -rf /opt/sun/javadb/docs&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;9. Before compiling the Resin environment, install the following RPM from the RHEL DVD:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm&lt;br /&gt;rpm -ivh glibc-headers-2.5-42.i386.rpm&lt;br /&gt;rpm -ivh glibc-devel-2.5-42.i386.rpm&lt;br /&gt;rpm -ivh gmp-4.1.4-10.el5.i386.rpm&lt;br /&gt;rpm -ivh libgomp-4.4.0-6.el5.i386.rpm&lt;br /&gt;rpm -ivh gcc-4.1.2-46.el5.i386.rpm&lt;br /&gt;rpm -ivh pcre-devel-6.6-2.el5_1.7.i386.rpm&lt;br /&gt;rpm -ivh e2fsprogs-devel-1.39-23.el5.i386.rpm&lt;br /&gt;rpm -ivh keyutils-libs-devel-1.2-1.el5.i386.rpm&lt;br /&gt;rpm -ivh libsepol-devel-1.15.2-2.el5.i386.rpm&lt;br /&gt;rpm -ivh libselinux-devel-1.33.4-5.5.el5.i386.rpm&lt;br /&gt;rpm -ivh krb5-devel-1.6.1-36.el5.i386.rpm&lt;br /&gt;rpm -ivh zlib-devel-1.2.3-3.i386.rpm&lt;br /&gt;rpm -ivh openssl-devel-0.9.8e-12.el5.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;10. Copy the Resin 4.0.8 source file using PSCP (or SCP) into &lt;span style="color:#000099;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;11. Move to &lt;span style="color:#000099;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;cd /tmp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Extract the &lt;span style="color:#000099;"&gt;resin-pro-4.0.8.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;tar -zxvf resin-pro-4.0.8.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Move to the Resin 4.0.8 source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;cd /tmp/resin-pro-4.0.8&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;14. Run the commands bellow to compile the Resin 4.0.8 environment:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;./configure --with-resin-conf=/usr/local/resin/conf --with-resin-root=/www --with-resin-log=/var/log/resin --enable-ssl --with-java-home=/usr/java/jdk1.6.0_20&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;make&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;make install&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;15. Edit using VI, the file &lt;span style="color:#000099;"&gt;/usr/local/resin/conf/resin.xml&lt;/span&gt; and change the string bellow:&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;resin:if test="${resin.userName == 'root'}"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;resin:if test="${resin.userName == 'resin'}"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;user-name&lt;str&gt;&gt;&lt;/str&gt;www-data&lt;str&gt;&lt;&lt;/str&gt;/user-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;user-name&lt;str&gt;&gt;&lt;/str&gt;resin&lt;str&gt;&lt;&lt;/str&gt;/user-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;group-name&lt;str&gt;&gt;&lt;/str&gt;www-data&lt;str&gt;&lt;&lt;/str&gt;/group-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;group-name&lt;str&gt;&gt;&lt;str&gt;resin&lt;str&gt;&lt;&lt;/str&gt;/group-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;server id="" address="127.0.0.1" port="6800"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;server id="" address="&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;" port="6800"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;http address="*" port="8080"/&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;http address="&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;" port="8080"/&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;str&gt;dependency-check-interval&lt;str&gt;&gt;&lt;/str&gt;2s&lt;str&gt;&lt;&lt;/str&gt;/dependency-check-interval&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;dependency-check-interval&lt;str&gt;&gt;&lt;/str&gt;600s&lt;str&gt;&lt;&lt;/str&gt;/dependency-check-interval&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;host id="" root-directory="."&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;host id="&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;" root-directory="/www"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;root-directory&lt;str&gt;&gt;&lt;/str&gt;.&lt;str&gt;&lt;&lt;/str&gt;/root-directory&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;root-directory&lt;str&gt;&gt;&lt;/str&gt;/www&lt;str&gt;&lt;&lt;/str&gt;/root-directory&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;resin:set var="resin_admin_external" value="false"/&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;&lt;/str&gt;resin:set var="resin_admin_external" value="true"/&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;16. Change the ownership on the folder bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chown resin:root -R /www/*&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;17. Manually start the Resin service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/usr/local/resin/bin/resin.sh start -root-directory /www --log-directory /var/log/resin&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;18. Manually stop the Resin service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;/usr/local/resin/bin/resin.sh stop&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. Copy the Resin license file into &lt;span style="color:#000099;"&gt;/usr/local/resin/licenses&lt;/span&gt;&lt;br /&gt;20. Change the ownership and permissions on the folders bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chmod 664 -R /www/watchdog-data/&lt;br /&gt;chmod 777 /www/watchdog-data/default/&lt;br /&gt;chown resin:root -R /www/watchdog-data/*&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;21. Remove the Resin 4.0.8 source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;rm -rf /tmp/resin-pro-4.0.8&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;22. Remove default documents:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;rm -rf /www/doc/resin-doc&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;23. To start Resin service at server start-up, run the commands bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;chkconfig --add resin&lt;br /&gt;chkconfig resin on&lt;br /&gt;/etc/init.d/resin start&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;24. From a client machine, open an internet browser and login to the address:&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;strong&gt;&lt;em&gt;http://&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;:8080/resin-admin/&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;25. Enter a username and password in the lower half of the page, then click "Create Configuration File". The recommended username is "&lt;span style="color:#000099;"&gt;admin&lt;/span&gt;".&lt;br /&gt;26. Rename the &lt;span style="color:#000099;"&gt;admin-users.xml&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;mv /usr/local/resin/conf/admin-users.xml.generated /usr/local/resin/conf/admin-users.xml&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;27. Browse back to &lt;span style="color:#000099;"&gt;http://&lt;span style="color:#006600;"&gt;Server_DNS_Name&lt;/span&gt;:8080/resin-admin/&lt;/span&gt;. The change you made should force Resin to restart and return a 503 error. Just hit refresh in a few moments to bring up the page again.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-5390048894284687792?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/5390048894284687792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/resin-professional-408-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5390048894284687792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5390048894284687792'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/08/resin-professional-408-installation.html' title='Hardening guide for Resin Professional 4.0.8 on RHEL 5.4'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-1205621285489112312</id><published>2010-07-24T11:29:00.003+03:00</published><updated>2010-07-24T11:46:39.319+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>Hardening guide for WordPress 3.0 for hosted web sites</title><content type='html'>Important note: Make sure your hosting provider is using the most up-to-date build of WordPress.&lt;br /&gt;&lt;br /&gt;1. Request from your hosting provider access through SSH.&lt;br /&gt;2. Login to the hosted server using SSH.&lt;br /&gt;3. Edit using VI the file &lt;span style="color:#3333ff;"&gt;~/html/wp-config.php&lt;/span&gt; and write down the data of the following values:&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DB_NAME&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DB_USER&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DB_PASSWORD&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. Create using VI the file ~/config.php with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;?php&lt;br /&gt;define('DB_NAME', &lt;span style="color:#006600;"&gt;'m6gf42s'&lt;/span&gt;);&lt;br /&gt;define('DB_USER', '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;');&lt;br /&gt;define('DB_PASSWORD', '&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;');&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here');&lt;br /&gt;define('AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_SALT', 'put your unique phrase here');&lt;br /&gt;define('NONCE_SALT', 'put your unique phrase here');&lt;br /&gt;?&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;Note 1: Make sure there are no spaces, newlines, or other strings before an opening '&lt;span style="color:#3333ff;"&gt;&lt; ?php&lt;/span&gt;' tag or after a closing '&lt;span style="color:#3333ff;"&gt;?&gt;&lt;/span&gt;' tag.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;blgusr&lt;/span&gt;” with the MySQL account to access the database.&lt;br /&gt;Note 3: Replace “&lt;span style="color:#3333ff;"&gt;password2&lt;/span&gt;” with the MySQL account password.&lt;br /&gt;Note 4: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with the WordPress database name.&lt;br /&gt;Note 5: In-order to generate random values for the &lt;span style="color:#3333ff;"&gt;AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;SECURE_AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;LOGGED_IN_KEY&lt;/span&gt; and &lt;span style="color:#3333ff;"&gt;NONCE_KEY&lt;/span&gt;, use the web site bellow:&lt;br /&gt;&lt;a href="http://api.wordpress.org/secret-key/1.1/"&gt;http://api.wordpress.org/secret-key/1.1/&lt;/a&gt;&lt;br /&gt;5. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;~/html/wp-config.php&lt;/span&gt;&lt;br /&gt;• Add the following line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;include('&lt;span style="color:#006600;"&gt;/path/&lt;/span&gt;config.php');&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;/path/&lt;/span&gt; with the full path to the config.php file.&lt;br /&gt;• Remove the following sections:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('DB_NAME', 'putyourdbnamehere');&lt;br /&gt;define('DB_USER', 'usernamehere');&lt;br /&gt;define('DB_PASSWORD', 'yourpasswordhere');&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here');&lt;br /&gt;define('AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_SALT', 'put your unique phrase here');&lt;br /&gt;define('NONCE_SALT', 'put your unique phrase here'); &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. Remove default content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f ~/html/license.txt&lt;br /&gt;rm -f ~/html/readme.html&lt;br /&gt;rm -f ~/html/wp-config-sample.php&lt;br /&gt;rm -f ~/html/wp-content/plugins/hello.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;7. Create using VI the file &lt;span style="color:#3333ff;"&gt;~/html/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;files wp-config.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/files&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;Files wp-login.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Files&lt;str&gt;&gt;&lt;/str&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;8. Create using VI the file &lt;span style="color:#3333ff;"&gt;~/html/wp-content/plugins/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;9. Create the following folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p ~/html/wp-content/cache&lt;br /&gt;mkdir -p ~/html/wp-content/uploads&lt;br /&gt;mkdir -p ~/html/wp-content/upgrade&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;10. Change the file permissions:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;&lt;em&gt;chmod -R 777 ~/html/wp-content/cache&lt;br /&gt;chmod -R 777 ~/html/wp-content/uploads&lt;br /&gt;chmod -R 777 ~/html/wp-content/upgrade &lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;11. Download "&lt;span style="color:#3333ff;"&gt;Login Lockdown&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.bad-neighborhood.com/login-lockdown.html"&gt;http://www.bad-neighborhood.com/login-lockdown.html&lt;/a&gt;&lt;br /&gt;12. Download "&lt;span style="color:#3333ff;"&gt;Limit Login&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/limit-login-attempts/"&gt;http://wordpress.org/extend/plugins/limit-login-attempts/&lt;/a&gt;&lt;br /&gt;13. Download "&lt;span style="color:#3333ff;"&gt;WP-Secure Remove Wordpress Version&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/"&gt;http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/&lt;/a&gt;&lt;br /&gt;14. Download "&lt;span style="color:#3333ff;"&gt;WP Security Scan&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-security-scan/"&gt;http://wordpress.org/extend/plugins/wp-security-scan/&lt;/a&gt;&lt;br /&gt;15. Download "&lt;span style="color:#3333ff;"&gt;KB Robots.txt&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/kb-robotstxt/"&gt;http://wordpress.org/extend/plugins/kb-robotstxt/&lt;/a&gt;&lt;br /&gt;16. Download "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.seoegghead.com/software/wordpress-firewall.seo"&gt;http://www.seoegghead.com/software/wordpress-firewall.seo&lt;/a&gt;&lt;br /&gt;17. Copy the "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin file "&lt;span style="color:#3333ff;"&gt;wordpress-firewall.php&lt;/span&gt;" using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/html/wp-content/plugins&lt;/span&gt;&lt;br /&gt;18. Open a web browser from a client machine, and enter the URL bellow:&lt;br /&gt;&lt;a href="http://server_fqdn/wp-login.php"&gt;&lt;em&gt;http://&lt;span style="color:#cc0000;"&gt;Server_FQDN&lt;/span&gt;/wp-login.php&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;19. From WordPress dashboard, click on "settings" -&gt; make sure that "Anyone can register" is left unchecked -&gt; put a new value inside the "Tagline" field -&gt; click on "Save changes".&lt;br /&gt;20. Click on "Save changes".&lt;br /&gt;21. From WordPress dashboard, click on "Plugins" -&gt; Add New -&gt; choose "Upload" -&gt; click Browse to locate the plugin -&gt; click "Install Now" -&gt; click "Proceed" -&gt; click on "Activate Plugin".&lt;br /&gt;Note: Install and activate all the above downloaded plugins.&lt;br /&gt;22. From WordPress dashboard, click on "settings" -&gt; click on "KB Robots.txt" -&gt; add the following content into the Robots.txt editor field:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Disallow: /wp-*&lt;br /&gt;Disallow: /wp-admin&lt;br /&gt;Disallow: /wp-includes&lt;br /&gt;Disallow: /wp-content/plugins&lt;br /&gt;Disallow: /wp-content/cache&lt;br /&gt;Disallow: /wp-content/themes&lt;br /&gt;Disallow: /wp-login.php&lt;br /&gt;Disallow: /wp-register.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;23. Click "Submit".&lt;br /&gt;24. From the upper pane, click on "Log Out".&lt;br /&gt;25. In-case the server was configured with SSL certificate, add the following line to the config.php file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('FORCE_SSL_LOGIN', true);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-1205621285489112312?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/1205621285489112312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/hardening-guide-for-wordpress-30-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/1205621285489112312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/1205621285489112312'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/hardening-guide-for-wordpress-30-for.html' title='Hardening guide for WordPress 3.0 for hosted web sites'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-982589398374639816</id><published>2010-07-23T15:56:00.005+03:00</published><updated>2010-07-23T16:04:47.058+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='IPv6'/><category scheme='http://www.blogger.com/atom/ns#' term='Solaris'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='Nginx'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>IPv6 - Problem and some solutions</title><content type='html'>The Internet is about to face one of its most serious issues in its history: experts have warned that the Internet is running out of addresses, and may run out by 2011. At issue is slow adoption of a new system intended to vastly increase the available pool, further complicating matters.&lt;br /&gt;Currently, the web uses IPv4 (Internet Protocol version 4). 32-bit numbers are used; meaning about 4 billion addresses are available. About 94 percent of them have already been allocated. There is a new system, however, called IPv6. That uses 128-bit numbers, and the number of available addresses skyrocket.&lt;br /&gt;It is time to start migration from IPv4 to IPv6.&lt;br /&gt;&lt;br /&gt;Here is couple of articles about the problem:&lt;br /&gt;&lt;a href="http://www.betanews.com/article/Internet-has-less-than-a-years-worth-of-IP-addresses-left-say-experts/1279816984"&gt;http://www.betanews.com/article/Internet-has-less-than-a-years-worth-of-IP-addresses-left-say-experts/1279816984&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neowin.net/news/iana-ipv4-addresses-will-dry-up-in-a-year"&gt;http://www.neowin.net/news/iana-ipv4-addresses-will-dry-up-in-a-year&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have searched the web, and found articles about support and configuration of IPv6 on popular operating systems and applications:&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;Microsoft Announces IPv6 Technical Preview for Windows 2000&lt;/u&gt;:&lt;br /&gt;&lt;a href="http://www.microsoft.com/presspass/press/2000/Mar00/IPv6PR.mspx"&gt;http://www.microsoft.com/presspass/press/2000/Mar00/IPv6PR.mspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Installing IPv6 on Windows XP&lt;/u&gt;&lt;br /&gt;&lt;a href="http://forums.techarena.in/networking-security/1098260.htm"&gt;http://forums.techarena.in/networking-security/1098260.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;How IIS 6.0 Supports IPv6 (IIS 6.0)&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1ecff3af-36c2-41b5-957a-8bcc6fac8abc.mspx?mfr=true"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1ecff3af-36c2-41b5-957a-8bcc6fac8abc.mspx?mfr=true&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Changes to IPv6 in Windows Vista and Windows Server 2008&lt;/u&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb878121.aspx"&gt;http://technet.microsoft.com/en-us/library/bb878121.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Next Generation TCP/IP Stack in Windows Vista and Windows Server 2008&lt;/u&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb878108.aspx"&gt;http://technet.microsoft.com/en-us/library/bb878108.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;DNS Enhancements in Windows Server 2008&lt;/u&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/magazine/2008.01.cableguy.aspx"&gt;http://technet.microsoft.com/en-us/magazine/2008.01.cableguy.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Support for IPv6 in Windows Server 2008 R2 and Windows 7&lt;/u&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/magazine/2009.07.cableguy.aspx"&gt;http://technet.microsoft.com/en-us/magazine/2009.07.cableguy.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Using IPv6 with IIS7&lt;/u&gt;&lt;br /&gt;&lt;a href="http://blogs.iis.net/nazim/archive/2008/05/03/using-ipv6-with-iis7.aspx"&gt;http://blogs.iis.net/nazim/archive/2008/05/03/using-ipv6-with-iis7.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPv6 Support in Exchange 2007 SP1 and SP2&lt;/u&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb629624(EXCHG.80).aspx"&gt;http://technet.microsoft.com/en-us/library/bb629624(EXCHG.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Red Hat / CentOS IPv6 Network Configuration&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/faq/rhel-redhat-fedora-centos-ipv6-network-configuration/"&gt;http://www.cyberciti.biz/faq/rhel-redhat-fedora-centos-ipv6-network-configuration/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPv6 on Fedora Core mini-HOWTO&lt;/u&gt;&lt;br /&gt;&lt;a href="http://linux.yyz.us/ipv6-fc2-howto.html"&gt;http://linux.yyz.us/ipv6-fc2-howto.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Adding IPv6 to Ubuntu systems&lt;/u&gt;&lt;br /&gt;&lt;a href="http://knowledgelayer.softlayer.com/questions/468/Adding+IPv6+to+Ubuntu+systems"&gt;http://knowledgelayer.softlayer.com/questions/468/Adding+IPv6+to+Ubuntu+systems&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Enabling IPv6 on a Network (Solaris 10)&lt;/u&gt;&lt;br /&gt;&lt;a href="http://docs.sun.com/app/docs/doc/819-3000/ipv6-config-tasks-1?a=view"&gt;http://docs.sun.com/app/docs/doc/819-3000/ipv6-config-tasks-1?a=view&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Building a Linux IPv6 DNS Server&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.linuxjournal.com/article/6541"&gt;http://www.linuxjournal.com/article/6541&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Networking IPv6 User Guide for J2SDK/JRE 1.4&lt;/u&gt;&lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/guide/net/ipv6_guide/index.html"&gt;http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/guide/net/ipv6_guide/index.html&lt;/a&gt;&lt;br /&gt;&lt;u&gt;Networking IPv6 User Guide for JDK/JRE 5.0&lt;/u&gt;&lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/net/ipv6_guide/index.html"&gt;http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/net/ipv6_guide/index.html&lt;/a&gt;&lt;br /&gt;&lt;u&gt;Apache Talking IPv6&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.linuxjournal.com/article/5451"&gt;http://www.linuxjournal.com/article/5451&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;How-to IPv6 in Globus Toolkit 3&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.cs.ucl.ac.uk/staff/sjiang/webpage/how-to-IPv6-Globus.htm"&gt;http://www.cs.ucl.ac.uk/staff/sjiang/webpage/how-to-IPv6-Globus.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Enabling IPv6 Support in Nginx&lt;/u&gt;&lt;br /&gt;&lt;a href="http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/"&gt;http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPv6 Support in iOS 4&lt;/u&gt;&lt;br /&gt;&lt;a href="http://isc.sans.edu/diary.html?storyid=9058"&gt;http://isc.sans.edu/diary.html?storyid=9058&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPv6 - Cisco Systems&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.cisco.com/en/US/products/ps6553/products_ios_technology_home.html"&gt;http://www.cisco.com/en/US/products/ps6553/products_ios_technology_home.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Cisco - IP version 6 Introduction&lt;/u&gt;&lt;br /&gt;&lt;a href="http://ciscosystems.com/en/US/tech/tk872/tk373/tsd_technology_support_sub-protocol_home.html"&gt;http://ciscosystems.com/en/US/tech/tk872/tk373/tsd_technology_support_sub-protocol_home.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Hewlett-Packard Next Generation Internet Protocol version 6 (IPv6) web sites&lt;/u&gt;&lt;br /&gt;&lt;a href="http://h10026.www1.hp.com/netipv6/Ipv6.htm"&gt;http://h10026.www1.hp.com/netipv6/Ipv6.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;EMC Product Support for IPv6&lt;/u&gt;&lt;br /&gt;&lt;a href="http://india.emc.com/products/interoperability/ipv6.htm"&gt;http://india.emc.com/products/interoperability/ipv6.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Nokia IPv6 How To&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.nokia.com/NOKIA_COM_1/About_Nokia/Press/White_Papers/pdf_files/techwhitepaper_ipv6_howto.pdf"&gt;http://www.nokia.com/NOKIA_COM_1/About_Nokia/Press/White_Papers/pdf_files/techwhitepaper_ipv6_howto.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-982589398374639816?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/982589398374639816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/ipv6-problem-and-some-solutions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/982589398374639816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/982589398374639816'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/ipv6-problem-and-some-solutions.html' title='IPv6 - Problem and some solutions'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-6090215441753640542</id><published>2010-07-19T10:51:00.001+03:00</published><updated>2010-07-19T10:52:34.955+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NAC'/><title type='text'>NAC technology</title><content type='html'>Here is a good article (in Hebrew) from a colleague of mine, explaining about NAC technology.&lt;br /&gt;The article contains some background about the NAC technology, possible solutions, how to manage the MAC address, Agent Based NAC, Port NAC and summary of the topic.&lt;br /&gt;&lt;br /&gt;The article can be found at:&lt;br /&gt;&lt;a href="http://www.digitalwhisper.co.il/files/Zines/0x07/DW7-3-NAC.pdf"&gt;http://www.digitalwhisper.co.il/files/Zines/0x07/DW7-3-NAC.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Roy Horev, the author of the article can be reached at &lt;a href="mailto:royhorev@gmail.com"&gt;royhorev@gmail.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-6090215441753640542?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/6090215441753640542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/nac-technology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/6090215441753640542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/6090215441753640542'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/nac-technology.html' title='NAC technology'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-4446057839907776486</id><published>2010-07-19T10:45:00.004+03:00</published><updated>2010-07-19T10:50:47.397+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='3G'/><title type='text'>3G Mobile Network Security</title><content type='html'>Here is a good article (in Hebrew) from a colleague of mine, explaining about 3G Mobile Network Security.&lt;br /&gt;The article contains some background about the cellular technology, how things are working, possible risks and how to deal with the risks.&lt;br /&gt;&lt;br /&gt;The article can be found at:&lt;br /&gt;&lt;a href="http://www.digitalwhisper.co.il/files/Zines/0x08/DW8-1-3GSecurity.pdf"&gt;http://www.digitalwhisper.co.il/files/Zines/0x08/DW8-1-3GSecurity.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Roy Horev, the author of the article can be reached at &lt;a href="mailto:royhorev@gmail.com"&gt;royhorev@gmail.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-4446057839907776486?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/4446057839907776486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/3g-mobile-network-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4446057839907776486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4446057839907776486'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/3g-mobile-network-security.html' title='3G Mobile Network Security'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-645609217302745359</id><published>2010-07-17T17:56:00.009+03:00</published><updated>2010-07-17T18:40:48.906+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server core'/><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.5'/><title type='text'>Windows 2008 R2 Certification Authority installation guide</title><content type='html'>This step-by-step guide explains how to install and configure public key infrastructure, based on:&lt;br /&gt;* Windows 2008 R2 Server core - offline Root CA&lt;br /&gt;* Windows 2008 R2 domain controller&lt;br /&gt;* Windows 2008 R2 enterprise edition - Subordinate Enterprise CA server&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Offline Root CA - OS installation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Boot the server using Windows 2008 R2 bootable DVD.&lt;br /&gt;2. Specify the product ID -&gt; click Next.&lt;br /&gt;3. From the installation option, choose "&lt;span style="color:#990000;"&gt;&lt;strong&gt;Windows Server 2008 R2 (Server Core Installation)&lt;/strong&gt;&lt;/span&gt;" -&gt; click Next.&lt;br /&gt;4. Accept the license agreement -&gt; click Next.&lt;br /&gt;5. Choose "Custom (Advanced)" installation type -&gt; specify the hard drive to install the operating system -&gt; click Next.&lt;br /&gt;6. Allow the installation phase to continue and restart the server automatically.&lt;br /&gt;7. To login to the server for the first time, press CTRL+ALT+DELETE&lt;br /&gt;8. Choose "Administrator" account -&gt; click OK to replace the account password -&gt; specify complex password and confirm it -&gt; press Enter -&gt; Press OK.&lt;br /&gt;9. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;sconfig.cmd&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;10. Press "2" to replace the computer name -&gt; specify new computer name -&gt; click "Yes" to restart the server.&lt;br /&gt;11. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;12. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;sconfig.cmd&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;13. Press "5" to configure "Windows Update Settings" -&gt; select "A" for automatic -&gt; click OK.&lt;br /&gt;14. Press "6" to download and install Windows Updates -&gt; choose "A" to search for all updates -&gt; Choose "A" to download and install all updates -&gt; click "Yes" to restart the server.&lt;br /&gt;15. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;16. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;sconfig.cmd&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. In-case you need to use RDP to access and manage the server, press "7" to enable "Remote Desktop" -&gt; choose "E" to enable -&gt; choose either "1" or "2" according to your client settings -&gt; Press OK.&lt;br /&gt;18. Press "8" to configure "Network settings" -&gt; select the network adapter by its Index number -&gt; press "1" to configure the IP settings -&gt; choose "S" for static IP address -&gt; specify the IP address, subnet mask and default gateway -&gt; press "2" to configure the DNS servers -&gt; click OK -&gt; press "4" to return to the main menu.&lt;br /&gt;19. Press "9" to configure "Date and Time" -&gt; choose the correct "date/time" and "time zone" -&gt; click OK&lt;br /&gt;20. Press "11" to restart the server to make sure all settings take effect -&gt; click "Yes" to restart the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Offline Root CA - Certificate Authority server installation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;2. Install Certificate services:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;start /w ocsetup.exe CertificateServices /norestart /quiet&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;3. To check that the installation completed, run the command:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;oclist find /i "CertificateServices"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. Download the file “&lt;span style="color:#000099;"&gt;setupca.vbs&lt;/span&gt;” from:&lt;br /&gt;&lt;a href="http://blogs.technet.com/b/pki/archive/2009/09/18/automated-ca-installs-using-vb-script-on-windows-server-2008-and-2008r2.aspx"&gt;http://blogs.technet.com/b/pki/archive/2009/09/18/automated-ca-installs-using-vb-script-on-windows-server-2008-and-2008r2.aspx&lt;/a&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;C:\Windows\system32&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Run the command bellow to configure the Root CA:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;Cscript /nologo C:\Windows\System32\setupca.vbs /is /sn &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;ca_server_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; /sk 4096 /sp "RSA#Microsoft Software Key Storage Provider" /sa SHA256&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. In-order to verify that the installation completed successfully, open using Notepad, the file “&lt;span style="color:#000099;"&gt;_SetupCA.log&lt;/span&gt;” located in the current running directory, and make sure the last line is:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;Install complete! Passed&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;7. Run the command bellow to enable remote management of the Root CA:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;netsh advfirewall firewall set rule group="Remote Service Management" new enable=yes&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;8. Run the command bellow to stop the CertSvc service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;Net stop CertSvc&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;9. Run the command bellow to change new certificate validity period time:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;reg add HKLM\SYSTEM\CurrentControlSet\services\CertSvc\Configuration\&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;rootca_netbios_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; /v ValidityPeriodUnits /t REG_DWORD /d 5 /f&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: The command above should be written in one line.&lt;br /&gt;10. Run the command bellow to start the CertSvc service:&lt;br /&gt;Net start CertSvc&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Enterprise Subordinate CA - OS installation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Pre-requirements:&lt;/u&gt;&lt;br /&gt;• Active Directory (Forest functional level – Windows 2008 R2)&lt;br /&gt;• Add “A” record for the Root CA to the Active Directory DNS.&lt;br /&gt;&lt;br /&gt;1. Boot the server using &lt;span style="color:#990000;"&gt;&lt;strong&gt;Windows 2008 R2 Enterprise Edition&lt;/strong&gt;&lt;/span&gt; bootable DVD.&lt;br /&gt;2. Specify the product ID -&gt; click Next.&lt;br /&gt;3. From the installation option, choose "&lt;strong&gt;&lt;span style="color:#990000;"&gt;Windows Server 2008 R2 Enterprise Edition Full installation&lt;/span&gt;&lt;/strong&gt;" -&gt; click Next.&lt;br /&gt;4. Accept the license agreement -&gt; click Next.&lt;br /&gt;5. Choose "Custom (Advanced)" installation type -&gt; specify the hard drive to install the operating system -&gt; click Next.&lt;br /&gt;6. Allow the installation phase to continue and restart the server automatically.&lt;br /&gt;7. To login to the server for the first time, press CTRL+ALT+DELETE&lt;br /&gt;8. Choose "Administrator" account -&gt; click OK to replace the account password -&gt; specify complex password and confirm it -&gt; press Enter -&gt; Press OK.&lt;br /&gt;9. From the “Initial Configuration Tasks” window, configure the following settings:&lt;br /&gt;o Set time zone&lt;br /&gt;o Configure networking – specify static IP address, netmask, gateway, DNS&lt;br /&gt;o Provide computer name and domain – add the server to the domain&lt;br /&gt;o Enable Remote Desktop&lt;br /&gt;10. In-order to be able to remotely manage the Root CA, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;cmdkey /add:&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;RootCA_Hostname&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; /user:Administrator /pass:&lt;str&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;RootCA_Admin_Password&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Enterprise Subordinate CA - Certificate Authority server installation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Pre-requirements:&lt;/u&gt;&lt;br /&gt;• DNS CNAME record named "wwwca" for the Enterprise Subordinate CA.&lt;br /&gt;&lt;br /&gt;1. To login to the server, press CTRL+ALT+DELETE -&gt; specify the credentials of account member of “Schema Admins”, “Enterprise Admins” and “Domain Admins”.&lt;br /&gt;2. Start -&gt; Administrative Tools -&gt; Server Manager.&lt;br /&gt;3. From the left pane, right click on Roles -&gt; Add Roles -&gt; Next -&gt; select “&lt;span style="color:#000099;"&gt;&lt;strong&gt;Web Server (IIS)&lt;/strong&gt;&lt;/span&gt;” -&gt; click Next twice -&gt; select the following role services:&lt;br /&gt;• Web Server&lt;br /&gt;o Common HTTP Features&lt;br /&gt;Static Content&lt;br /&gt;Default Document&lt;br /&gt;Directory Browsing&lt;br /&gt;HTTP Errors&lt;br /&gt;HTTP Redirection&lt;br /&gt;o Application Development&lt;br /&gt;.NET Extensibility&lt;br /&gt;ASP&lt;br /&gt;ISAPI Extensions&lt;br /&gt;o Health and Diagnostics&lt;br /&gt;HTTP Logging&lt;br /&gt;Logging Tools&lt;br /&gt;Tracing&lt;br /&gt;Request Monitor&lt;br /&gt;o Security&lt;br /&gt;Windows Authentication&lt;br /&gt;Client Certificate Mapping Authentication&lt;br /&gt;IIS Client Certificate Mapping Authentication&lt;br /&gt;Request Filtering&lt;br /&gt;o Performance&lt;br /&gt;Static Content Compression&lt;br /&gt;• Management Tools&lt;br /&gt;o IIS Management Console&lt;br /&gt;o IIS Management Scripts and Tools&lt;br /&gt;o IIS 6 Management Compatibility&lt;br /&gt;IIS 6 Metabase Compatibility&lt;br /&gt;4. Click Next -&gt; click Install -&gt; click Close.&lt;br /&gt;5. From the left pane, right click on Features -&gt; Add Features -&gt; Next -&gt; expand “Windows Process Activation Service” -&gt; select “.NET Environment” and “Configuration APIs” -&gt; select the feature “.NET Framework 3.5.1 Features” -&gt; click Next -&gt; click Install -&gt; click Close.&lt;br /&gt;6. From the left pane, right click on Roles -&gt; Add Roles -&gt; Next -&gt; select “&lt;strong&gt;&lt;span style="color:#000099;"&gt;Active Directory Certificate Services&lt;/span&gt;&lt;/strong&gt;” -&gt; click Next twice -&gt; select the following role services:&lt;br /&gt;• Certification Authority&lt;br /&gt;• Certification Authority Web Enrollment&lt;br /&gt;• Certificate Enrollment Policy Web Service&lt;br /&gt;7. Click Next.&lt;br /&gt;8. Configure the following settings:&lt;br /&gt;• Specify Setup Type: Enterprise&lt;br /&gt;• CA Type: Subordinate CA&lt;br /&gt;• Private Key: Create a new private key&lt;br /&gt;• Cryptography:&lt;br /&gt;Cryptographic service provider (CSP): RSA#Microsoft software Key Storage Provider&lt;br /&gt;Key length: 2048&lt;br /&gt;Hash algorithm SHA256&lt;br /&gt;• CA Name:&lt;br /&gt;Common name: specify here the subordinate server NetBIOS name&lt;br /&gt;Distinguished name suffix: leave the default domain settings&lt;br /&gt;• Certificate Request: Save a certificate to file and manually send it later&lt;br /&gt;• Certificate Database: leave the default settings&lt;br /&gt;• Authentication Type: Windows Integrated Authentication&lt;br /&gt;• Server Authentication Certificate: Choose and assign a certificate for SSL later&lt;br /&gt;9. Click Next twice -&gt; click Install -&gt; click Close.&lt;br /&gt;10. Close the Server Manager.&lt;br /&gt;11. Start -&gt; Administrative Tools -&gt; Certification Authority&lt;br /&gt;12. From the left pane, right click on “Certification Authority (Local)” -&gt; “Retarget Certification Authority” -&gt; choose “Another computer” -&gt; specify the RootCA hostname -&gt; click Finish.&lt;br /&gt;13. Right click on the RootCA server name -&gt; Properties -&gt; -&gt; Extensions tab -&gt; extension type: CRL Distribution Point (CDP):&lt;br /&gt;• Uncheck "Publish Delta CRLs to this location".&lt;br /&gt;• Mark the line begins with "LDAP", and click remove.&lt;br /&gt;• Mark the line begins with "HTTP", and click remove.&lt;br /&gt;• Mark the line begins with "file", and click remove.&lt;br /&gt;• Click on Add -&gt; on the location, put:&lt;br /&gt;&lt;a href="http://wwwca/CertEnroll/%3CRootCA_Server_Name%3E.crl"&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;http://wwwca/CertEnroll/&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;RootCA_Server_Name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;.crl&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;• Click on the line begins with "HTTP", and make sure the only option checked is: "Include in CDP extension of issued certificates".&lt;br /&gt;• Click on the line begins with "C:\Windows", and make sure the only option checked is: "Publish CRLs to this location"&lt;br /&gt;14. Extensions tab -&gt; extension type: Authority Information Access (AIA):&lt;br /&gt;• Mark the line begins with "LDAP", and click remove.&lt;br /&gt;• Mark the line begins with "HTTP", and click remove.&lt;br /&gt;• Mark the line begins with "file", and click remove.&lt;br /&gt;• Click on Add -&gt; on the location, put:&lt;br /&gt;&lt;a href="http://wwwca/CertEnroll/%3CRootCA_Server_Name%3E.crt"&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://wwwca/CertEnroll/&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;RootCA_Server_Name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;15. Click OK and allow the CA server to restart its services.&lt;br /&gt;16. From the "Certification Authority" left pane, right click on "Revoked certificates"-&gt; Properties:&lt;br /&gt;• CRL publication interval: 180 days&lt;br /&gt;• Make sure "Publish Delta CRLs" is not checked&lt;br /&gt;• Click OK&lt;br /&gt;17. Right click on the CA name -&gt; All tasks -&gt; Stop service&lt;br /&gt;18. Right click on the CA name -&gt; All tasks -&gt; Start service&lt;br /&gt;19. Run the commands bellow from command line, to configure the Offline Root CA to publish in the active-directory:&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;certutil.exe -setreg ca\DSConfigDN "CN=Configuration,&lt;span style="color:#006600;"&gt;DC=mycompany,DC=com&lt;/span&gt;"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;certutil.exe -setreg ca\DSDomainDN "&lt;span style="color:#006600;"&gt;DC=mycompany,DC=com&lt;/span&gt;"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace "&lt;strong&gt;&lt;span style="color:#006600;"&gt;DC=mycompany,DC=com&lt;/span&gt;&lt;/strong&gt;" according to your domain name.&lt;br /&gt;20. From the "Certification Authority" left pane, right click on "Revoked certificates"-&gt; All tasks -&gt; Publish -&gt; click OK.&lt;br /&gt;21. Close the "Certification Authority" snap-in and logoff the subordinate CA server.&lt;br /&gt;22. Login to a domain controller in the forest root domain, with account member of Domain Admins and Enterprise Admins.&lt;br /&gt;23. Copy the file bellow from the Offline Root CA server to a temporary folder on the domain controller:&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;C:\Windows\System32\CertSrv\CertEnroll\*.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;24. Start -&gt; Administrative Tools -&gt; Group Policy Management.&lt;br /&gt;25. From the left pane, expand the forest name -&gt; expand Domains -&gt; expand the relevant domain name -&gt; right click on “Default domain policy” -&gt; Edit.&lt;br /&gt;26. From the left pane, under “Computer Configuration” -&gt; expand Policies -&gt; expand “Windows Settings” -&gt; expand “Security Settings” -&gt; expand “Public Key Policies” -&gt; right click on “Trusted Root Certification Authorities” -&gt; Import -&gt; click Next -&gt; click Browse to locate the CRT file from the Root CA -&gt; click Open -&gt; click Next twice -&gt; click Finish -&gt; click OK.&lt;br /&gt;27. Logoff the domain controller.&lt;br /&gt;28. Return to the subordinate enterprise CA server.&lt;br /&gt;29. Start -&gt; Administrative Tools -&gt; Certification Authority.&lt;br /&gt;30. From the left pane, right click on “Certification Authority (Local)” -&gt; “Retarget Certification Authority” -&gt; choose “Another computer” -&gt; specify the RootCA hostname -&gt; click Finish.&lt;br /&gt;31. Right click on the RootCA server name -&gt; All Tasks -&gt; Submit new request -&gt; locate the subordinate CA request file (.req) -&gt; Open.&lt;br /&gt;32. Expand the RootCA server name -&gt; right click on “Pending Requests” -&gt; locate the subordinate CA request ID according to the date -&gt; right click on the request -&gt; All Tasks -&gt; Issue.&lt;br /&gt;33. From the left pane, click on “Issued Certificates” -&gt; locate the subordinate CA request ID -&gt; right click on the request -&gt; All Tasks -&gt; “Export Binary Data” -&gt; choose “Binary Certificate” -&gt; click “Save binary data to a file” -&gt; click OK -&gt; specify location and the file name - &lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;&lt;&lt;/str&gt;subordinate_ca_server_name_signed_certificate&lt;str&gt;&gt;&lt;/str&gt;.p7b&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; -&gt; click Save.&lt;br /&gt;34. Run the command bellow from command line to avoid offline CRL errors:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;Certutil.exe -setreg ca\CRLFlags +CRLF_REVCHECK_IGNORE_OFFLINE&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;35. From the left pane, right click on “Certificate Authority” -&gt; “Retarget Certification Authority” -&gt; choose “Local computer” -&gt; click Finish.&lt;br /&gt;36. Right click on the subordinate CA server name -&gt; All Tasks -&gt; “Install CA Certificate” -&gt; locate the file &lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;&lt;&lt;/str&gt;Subordinate_CA_Server_Name_Signed_Certificate&lt;str&gt;&gt;&lt;/str&gt;.p7b&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; -&gt; click Open.&lt;br /&gt;37. Right click on the subordinate CA server name -&gt; All Tasks -&gt; Start Service.&lt;br /&gt;38. Right click on the subordinate CA server name -&gt; Properties -&gt; -&gt; Extensions tab -&gt; extension type: CRL Distribution Point (CDP):&lt;br /&gt;• Mark the line begins with "HTTP" -&gt; click Remove -&gt; click Yes.&lt;br /&gt;• Mark the line begins with "file" -&gt; click Remove -&gt; click Yes.&lt;br /&gt;• Click on Add -&gt; on the location, put:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://wwwca/CertEnroll/&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;subordinate_CA_Server_Name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;.crl&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• Click on the line begins with "HTTP", and make sure the following options are checked: "Include in CRLs" and "Include in the CDP".&lt;br /&gt;39. Extensions tab -&gt; extension type: Authority Information Access (AIA):&lt;br /&gt;• Mark the line begins with "HTTP" -&gt; click Remove -&gt; click Yes.&lt;br /&gt;• Mark the line begins with "file" -&gt; click Remove -&gt; click Yes.&lt;br /&gt;• Click on Add -&gt; on the location, put:&lt;br /&gt;&lt;a href="http://wwwca/CertEnroll/%3CSubordinateCA-FQDN_Subordinate_NetBIOS_Name%3E.crt"&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://wwwca/CertEnroll/&lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;SubordinateCA-FQDN_Subordinate_NetBIOS_Name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;Example: &lt;strong&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://wwwca/CertEnroll/MyCA.mydomain.com_MyCA.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• Click on the line begins with "HTTP", and make sure the following option is checked: "Include in the AIA".&lt;br /&gt;40. Click OK and allow the CA server to restart its services.&lt;br /&gt;41. From the "Certification Authority" left pane, right click on "Revoked certificates"-&gt; All tasks -&gt; Publish -&gt; click OK.&lt;br /&gt;42. Close the "Certification Authority" snap-in&lt;br /&gt;43. Copy the files bellow from the Root CA to the subordinate CA (same location):&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;C:\Windows\System32\CertSrv\CertEnroll\*.crl&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;C:\Windows\System32\CertSrv\CertEnroll\*.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;44. Logoff the subordinate CA server.&lt;br /&gt;45. Login to a domain controller in the forest root domain, with account member of Domain Admins and Enterprise Admins.&lt;br /&gt;46. Copy the file bellow from the subordinate CA server to a temporary folder on the domain controller:&lt;br /&gt;• &lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;C:\Windows\System32\CertSrv\CertEnroll\*.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; – copy the newest file&lt;br /&gt;47. Start -&gt; Administrative Tools -&gt; Group Policy Management.&lt;br /&gt;48. From the left pane, expand the forest name -&gt; expand Domains -&gt; expand the relevant domain name -&gt; right click on “Default domain policy” -&gt; Edit.&lt;br /&gt;49. From the left pane, under “Computer Configuration” -&gt; expand Policies -&gt; expand “Windows Settings” -&gt; expand “Security Settings” -&gt; expand “Public Key Policies” -&gt; right click on “Intermediate Certification Authorities” -&gt; Import -&gt; click Next -&gt; click Browse to locate the CRT file from the subordinate CA server -&gt; click Open -&gt; click Next twice -&gt; click Finish -&gt; click OK.&lt;br /&gt;50. Logoff the domain controller.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-645609217302745359?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/645609217302745359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/windows-2008-r2-certification-authority.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/645609217302745359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/645609217302745359'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/07/windows-2008-r2-certification-authority.html' title='Windows 2008 R2 Certification Authority installation guide'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-8885171394553874204</id><published>2010-06-18T15:26:00.006+03:00</published><updated>2010-06-18T15:42:50.367+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>Hardening guide for WordPress 3.0</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guides:&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html"&gt;Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-mysql-5147-on.html"&gt;Hardening guide for MySQL 5.1.47 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-php-532-on-apache.html"&gt;Hardening guide for PHP 5.3.2 on Apache 2.2.15 / MySQL 5.1.47 (RHEL 5.4)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Installation and configuration phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create a new account for uploading files using SSH:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd sshaccount&lt;br /&gt;useradd -g sshaccount -d /home/sshaccount -m sshaccount&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Run the commands bellow to switch to the SSH account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;su sshaccount&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;4. Run the command bellow to generate SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ssh-keygen&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Leave deafult values for the ssh-keygen.&lt;br /&gt;5. Copy the SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /home/sshaccount/.ssh/id_rsa.pub /home/sshaccount/.ssh/authorized_keys&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;6. Change permissions for the SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 755 /home/sshaccount/.ssh&lt;br /&gt;chmod 644 /home/sshaccount/.ssh/*&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;7. Exit the SSH account shell and return to the Root account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Run the command bellow to login to the MySQL:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/mysql -uroot -p&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Replace the string “&lt;span style="color:#3333ff;"&gt;new-password&lt;/span&gt;” with the actual password for the root account.&lt;br /&gt;9. Run the following commands from the MySQL prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;CREATE USER '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;'@'localhost' IDENTIFIED BY '&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;';&lt;br /&gt;SET PASSWORD FOR '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;'@'localhost' = OLD_PASSWORD('&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;');&lt;br /&gt;CREATE DATABASE &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;;&lt;br /&gt;GRANT ALL PRIVILEGES ON &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;.* TO "&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;"@"localhost" IDENTIFIED BY "&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;";&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Replace “&lt;span style="color:#3333ff;"&gt;blgusr&lt;/span&gt;” with your own MySQL account to access the database.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;password2&lt;/span&gt;” with complex password (at least 14 characters).&lt;br /&gt;Note 3: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with your own WordPress database name.&lt;br /&gt;10. Download WordPress 3.0 from:&lt;br /&gt;&lt;a href="http://wordpress.org/download"&gt;http://wordpress.org/download&lt;/a&gt;&lt;br /&gt;11. Copy the WordPress 3.0 source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/www&lt;/span&gt;&lt;br /&gt;12. Move to &lt;span style="color:#3333ff;"&gt;/www&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Extract the &lt;span style="color:#3333ff;"&gt;wordpress-3.0.zip&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;unzip wordpress-3.0.zip&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;14. Remove WordPress source file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /www/wordpress-3.0.zip &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;15. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/config.php&lt;/span&gt; with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;?php&lt;br /&gt;define('DB_NAME', '&lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;');&lt;br /&gt;define('DB_USER', '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;');&lt;br /&gt;define('DB_PASSWORD', '&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;');&lt;br /&gt;define('DB_HOST', '127.0.0.1');&lt;br /&gt;$table_prefix = '&lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;_';&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here');&lt;br /&gt;define('AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_SALT', 'put your unique phrase here');&lt;br /&gt;define('NONCE_SALT', 'put your unique phrase here');&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('FS_METHOD', 'direct');&lt;br /&gt;define('FS_CHMOD_DIR', 0777);&lt;br /&gt;define('FS_CHMOD_FILE', 0777);&lt;br /&gt;define('FTP_BASE', '/www/wordpress/');&lt;br /&gt;define('FTP_CONTENT_DIR', '/www/wordpress/wp-content/');&lt;br /&gt;define('FTP_PLUGIN_DIR ', '/www/wordpress/wp-content/plugins/');&lt;br /&gt;define('FTP_PUBKEY', '/home/sshaccount/.ssh/id_rsa.pub');&lt;br /&gt;define('FTP_PRIKEY', '/home/sshaccount/.ssh/id_rsa');&lt;br /&gt;define('FTP_USER', 'sshaccount');&lt;br /&gt;define('FTP_HOST', '127.0.0.1:22');&lt;br /&gt;?&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Make sure there are no spaces, newlines, or other strings before an opening '&lt;str&gt;&lt;span style="color:#3333ff;"&gt;&lt;&lt;/str&gt; ?php&lt;/span&gt;' tag or after a closing '&lt;span style="color:#3333ff;"&gt;?&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;' tag.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;blgusr&lt;/span&gt;” with your own MySQL account to access the database.&lt;br /&gt;Note 3: Replace “&lt;span style="color:#3333ff;"&gt;password2&lt;/span&gt;” with complex password (at least 14 characters).&lt;br /&gt;Note 4: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with your own WordPress database name.&lt;br /&gt;Note 5: In-order to generate random values for the &lt;span style="color:#3333ff;"&gt;AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;SECURE_AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;LOGGED_IN_KEY&lt;/span&gt; and &lt;span style="color:#3333ff;"&gt;NONCE_KEY&lt;/span&gt;, use the web site bellow:&lt;br /&gt;&lt;a href="http://api.wordpress.org/secret-key/1.1/"&gt;http://api.wordpress.org/secret-key/1.1/&lt;/a&gt;&lt;br /&gt;16. Copy the &lt;span style="color:#3333ff;"&gt;wp-config.php&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /www/wordpress/wp-config-sample.php /www/wordpress/wp-config.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-config.php&lt;/span&gt;&lt;br /&gt;Add the following line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;include('/www/config.php');&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Remove the following sections:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('DB_NAME', 'putyourdbnamehere');&lt;br /&gt;define('DB_USER', 'usernamehere');&lt;br /&gt;define('DB_PASSWORD', 'yourpasswordhere');&lt;br /&gt;define('DB_HOST', 'localhost');&lt;br /&gt;$table_prefix = 'wp_';&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here');&lt;br /&gt;define('AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_SALT', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_SALT', 'put your unique phrase here');&lt;br /&gt;define('NONCE_SALT', 'put your unique phrase here'); &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;18. Remove default content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /www/wordpress/license.txt&lt;br /&gt;rm -f /www/wordpress/readme.html&lt;br /&gt;rm -f /www/wordpress/wp-config-sample.php&lt;br /&gt;rm -f /www/wordpress/wp-content/plugins/hello.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;Replace the value of the string, from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www/wordpress"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Replace the value of the string, from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LimitRequestBody 10000&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LimitRequestBody 200000&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;20. Restart the Apache service.&lt;br /&gt;21. Open a web browser from a client machine, and enter the URL bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;http://Server_FQDN/wp-admin/install.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;22. Specify the following information:&lt;br /&gt;• Site Title&lt;br /&gt;• Username - replace the default "&lt;span style="color:#3333ff;"&gt;admin&lt;/span&gt;"&lt;br /&gt;• Password&lt;br /&gt;• E-mail&lt;br /&gt;23. Click on “&lt;span style="color:#3333ff;"&gt;Install WordPress&lt;/span&gt;” button, and close the web browser.&lt;br /&gt;24. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;files wp-config.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/files&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;Files wp-login.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from All&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Files&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;RewriteEngine On&lt;br /&gt;RewriteCond %{REQUEST_METHOD} POST&lt;br /&gt;RewriteCond %{REQUEST_URI} .wp-comments-post\.php*&lt;br /&gt;RewriteCond %{HTTP_REFERER} !.*Server_FQDN.* [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^$&lt;br /&gt;RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note 1: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;Note 2: Replace &lt;span style="color:#3333ff;"&gt;Server_FQDN&lt;/span&gt; with the server FQDN (DNS name).&lt;br /&gt;25. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-admin/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName “Access Control”&lt;br /&gt;AuthType Basic&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;LIMIT GET POST&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/LIMIT&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;IfModule mod_security.c&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;SecFilterInheritance Off&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/IfModule&lt;str&gt;&gt;&lt;/str&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;26. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-content/plugins/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from All&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;27. Create the following folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www/wordpress/wp-content/cache&lt;br /&gt;mkdir -p /www/wordpress/wp-content/uploads&lt;br /&gt;mkdir -p /www/wordpress/wp-content/upgrade&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;28. Change the file permissions:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /www/wordpress&lt;br /&gt;chown daemon:root /www/wordpress/wp-content/plugins&lt;br /&gt;chmod 644 /www/config.php&lt;br /&gt;chmod 644 /www/wordpress/wp-config.php&lt;br /&gt;chmod 644 /www/wordpress/.htaccess&lt;br /&gt;chmod 644 /www/wordpress/wp-admin/.htaccess&lt;br /&gt;chmod 644 /www/wordpress/wp-content/plugins/.htaccess&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/cache&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/uploads&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/upgrade &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;29. Download "&lt;span style="color:#3333ff;"&gt;Login Lockdown&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.bad-neighborhood.com/login-lockdown.html"&gt;http://www.bad-neighborhood.com/login-lockdown.html&lt;/a&gt;&lt;br /&gt;30. Download "&lt;span style="color:#3333ff;"&gt;Limit Login&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/limit-login-attempts/"&gt;http://wordpress.org/extend/plugins/limit-login-attempts/&lt;/a&gt;&lt;br /&gt;31. Download "&lt;span style="color:#3333ff;"&gt;WP-Secure Remove Wordpress Version&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/"&gt;http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/&lt;/a&gt;&lt;br /&gt;32. Download "&lt;span style="color:#3333ff;"&gt;WP Security Scan&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-security-scan/"&gt;http://wordpress.org/extend/plugins/wp-security-scan/&lt;/a&gt;&lt;br /&gt;33. Download "&lt;span style="color:#3333ff;"&gt;KB Robots.txt&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/kb-robotstxt/"&gt;http://wordpress.org/extend/plugins/kb-robotstxt/&lt;/a&gt;&lt;br /&gt;34. Download "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://austinmatzko.com/wordpress-plugins/wp-db-backup/"&gt;http://austinmatzko.com/wordpress-plugins/wp-db-backup/&lt;/a&gt;&lt;br /&gt;35. Download "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.seoegghead.com/software/wordpress-firewall.seo"&gt;http://www.seoegghead.com/software/wordpress-firewall.seo&lt;/a&gt;&lt;br /&gt;36. Copy the "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin file "&lt;span style="color:#3333ff;"&gt;wordpress-firewall.php&lt;/span&gt;" using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-content/plugins&lt;/span&gt;&lt;br /&gt;37. Create a folder for the "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www/wordpress/wp-content/backup-ed602&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;38. Set permissions for the "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 777 /www/wordpress/wp-content/backup-ed602&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;39. Open a web browser from a client machine, and enter the URL bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;http://Server_FQDN/wp-login.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;40. From WordPress dashboard, click on "settings" -&gt; make sure that "&lt;span style="color:#3333ff;"&gt;Anyone can register&lt;/span&gt;" is left unchecked -&gt; put a new value inside the "&lt;span style="color:#3333ff;"&gt;Tagline&lt;/span&gt;" field -&gt; click on "Save changes".&lt;br /&gt;41. From WordPress dashboard, click on "settings" -&gt; click on "Media" -&gt; "Store uploads in this folder" -&gt; specify:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;wp-content/uploads&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;42. Click on "Save changes".&lt;br /&gt;43. From WordPress dashboard, click on "Plugins" -&gt; Add New -&gt; choose "Upload" -&gt; click Browse to locate the plugin -&gt; click "Install Now" -&gt; click "Proceed" -&gt; click on "Activate Plugin".&lt;br /&gt;Note: Install and activate all the above downloaded plugins.&lt;br /&gt;44. From WordPress dashboard, click on "settings" -&gt; click on "&lt;span style="color:#3333ff;"&gt;KB Robots.txt&lt;/span&gt;" -&gt; add the following content into the Robots.txt editor field:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Disallow: /wp-*&lt;br /&gt;Disallow: /wp-admin&lt;br /&gt;Disallow: /wp-includes&lt;br /&gt;Disallow: /wp-content/plugins&lt;br /&gt;Disallow: /wp-content/cache&lt;br /&gt;Disallow: /wp-content/themes&lt;br /&gt;Disallow: /wp-login.php&lt;br /&gt;Disallow: /wp-register.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;45. Click "Submit".&lt;br /&gt;46. From the upper pane, click on "Log Out".&lt;br /&gt;47. In-case the server was configured with SSL certificate, add the following line to the &lt;span style="color:#3333ff;"&gt;/www/config.php&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('FORCE_SSL_LOGIN', true); &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-8885171394553874204?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/8885171394553874204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-wordpress-30.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8885171394553874204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8885171394553874204'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-wordpress-30.html' title='Hardening guide for WordPress 3.0'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-1566056213727134499</id><published>2010-06-16T15:14:00.005+03:00</published><updated>2010-06-16T15:28:58.278+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='VSFTP'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='SFTP'/><title type='text'>Hardening guide for VSFTPD on RHEL 5.4</title><content type='html'>The guide bellow instruct how to install, configure and secure FTP server called VSFTP, based on RHEL 5.4, enabling only SFTP access to the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Installation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Install from the RHEL 5.4 DVD the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh vsftpd-2.0.5-16.el5.i386.rpm&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;3. Create a group for FTP users:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd ftp-users&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. Create folder for the FTP:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /ftp&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Change ownership and permissions on the FTP folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown root:ftp-users /ftp&lt;br /&gt;chmod 777 -R /ftp &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. Example of user creation:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;useradd -g ftp-users -d /ftp user1&lt;br /&gt;passwd user1&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;7. Edit using VI, the file &lt;span style="color:#000099;"&gt;/etc/vsftpd/vsftpd.conf&lt;/span&gt;&lt;br /&gt;Change from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;anonymous_enable=YES&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;anonymous_enable=NO&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Change from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;xferlog_std_format=YES&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;xferlog_std_format=NO&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Change from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#tftpd_banner=Welcome to blah FTP service.&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;tftpd_banner=Secure FTP server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Add the lines bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;local_root=/ftp&lt;br /&gt;userlist_file=/etc/vsftpd/user_list&lt;br /&gt;userlist_deny=NO&lt;br /&gt;vsftpd_log_file=/var/log/vsftpd.log&lt;br /&gt;ssl_enable=YES&lt;br /&gt;allow_anon_ssl=NO&lt;br /&gt;force_local_data_ssl=YES&lt;br /&gt;force_local_logins_ssl=YES&lt;br /&gt;ssl_tlsv1=YES&lt;br /&gt;ssl_sslv2=NO&lt;br /&gt;ssl_sslv3=NO&lt;br /&gt;ssl_ciphers=ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP&lt;br /&gt;rsa_cert_file=/etc/vsftpd/vsftpd.pem&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;8. Run the command bellow to create VSFTP SSL key:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;&lt;em&gt;openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;Note: The command above should written as one line.&lt;/span&gt;&lt;br /&gt;9. Edit using VI, the file &lt;span style="color:#000099;"&gt;/etc/vsftpd/user_list&lt;/span&gt; and add members of the FTP-Users group to this list.&lt;br /&gt;10. Run the command bellow to manually start the VSFTP service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/vsftpd start&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;11. Run the command bellow to configure the VSFTP to start at server startup:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chkconfig vsftpd on &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-1566056213727134499?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/1566056213727134499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-vsftpd-on-rhel-54.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/1566056213727134499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/1566056213727134499'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-vsftpd-on-rhel-54.html' title='Hardening guide for VSFTPD on RHEL 5.4'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-2743161534031096552</id><published>2010-06-06T09:52:00.003+03:00</published><updated>2010-06-06T10:12:12.238+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='PIX'/><category scheme='http://www.blogger.com/atom/ns#' term='FWSM'/><category scheme='http://www.blogger.com/atom/ns#' term='ASA'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Hardening guide for Cisco Firewall (PIX, ASA, FWSM)</title><content type='html'>&lt;strong&gt;&lt;u&gt;Important note&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow instructs how to secure Cisco Firewall (PIX, ASA, FWSM).&lt;br /&gt;Not all commands will work on every device series or on every IOS version.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;It is highly recommended to test each setting in a test lab before implementing changes to production systems.&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Hardening phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for Enable Mode (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;aaa authentication enable console LOCAL&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for Console and VTY Lines (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;aaa authentication serial console LOCAL&lt;br /&gt;aaa authentication ssh console LOCAL&lt;br /&gt;aaa authentication http console LOCAL&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;Configure Local Password (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;passwd &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;login_password&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; encrypted&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;Configure ASDM Access Control (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;&lt;em&gt;http &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;remote_ip_address&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;remote_subnet_mask&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Configuring SSH (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;hostname &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;device_hostname&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;domain-name &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;domain-name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;crypto key generate rsa modulus 2048&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure SSH for Remote Device Access (ASA, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no telnet 0.0.0.0 0.0.0.0 &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;ssh &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;remote_ip_address&lt;str&gt;&gt;&lt;/str&gt; &lt;str&gt;&lt;&lt;/str&gt;remote_subnet_mask&lt;str&gt;&gt;&lt;/str&gt; &lt;str&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;ssh version 2&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Timeout for Login Sessions (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;console timeout 10&lt;br /&gt;ssh timeout 10&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Local User and Encrypted Password (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;username &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;local_username&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; password &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;local_password&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; encrypted&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Configure Enable Password (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;enable password &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;enable_password&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt; encrypted&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable SNMP Read Access (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;clear configure snmp-server&lt;br /&gt;no snmp-server host &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/str&gt; &lt;str&gt;&lt;&lt;/str&gt;remote_ip_address&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable SNMP Traps (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no snmp-server enable traps all&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Clock Time Zone (ASA, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;clock timezone GMT &lt;str&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;hours offset&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Disable DHCP Server Service (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;clear configure dhcpd&lt;br /&gt;no dhcpd enable &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable HTTP Service (ASA, FWSM, PIX) - &lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no http server enable &lt;str&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;https_&lt;&gt;port&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Configure Console Logging Severity Level (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;logging console critical&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Timestamps in Log Messages (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;logging timestamp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Flood Guard (FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;floodguard enable&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Configure Fragment Chain Fragmentation Checks (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;fragment chain 1 &lt;str&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Configure Protocol Inspection (FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;fixup protocol ftp &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;port&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;fixup protocol http &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;port&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;fixup protocol smtp &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;port&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Protocol Inspection (ASA)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;inspect ftp &lt;span style="color:#006600;"&gt;[map_name]&lt;/span&gt;&lt;br /&gt;inspect http &lt;span style="color:#006600;"&gt;[map_name]&lt;/span&gt;&lt;br /&gt;inspect esmtp &lt;span style="color:#006600;"&gt;[map_name]&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Unicast Reverse-Path Forwarding (ASA, FWSM, PIX)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_id&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;ip verify reverse-path interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface_name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;exit &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Save the changes&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;wr&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-2743161534031096552?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/2743161534031096552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-cisco-firewall-pix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2743161534031096552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2743161534031096552'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-cisco-firewall-pix.html' title='Hardening guide for Cisco Firewall (PIX, ASA, FWSM)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-5961710319227456472</id><published>2010-06-03T16:43:00.006+03:00</published><updated>2010-06-03T17:06:46.572+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Router'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Hardening guide for Cisco Routers and Switches</title><content type='html'>&lt;strong&gt;&lt;u&gt;Important note&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow instructs how to secure Cisco router/switch.&lt;br /&gt;Not all commands will work on every device series (router/switch) or on every IOS version.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;It is highly recommended to test each setting in a test lab before implementing changes to production systems&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Hardening phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA service&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;aaa new-model&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for Login&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;aaa authentication login default local-case&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for Enable Mode&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;aaa authentication enable default enable&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for Local Console Line&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;line console 0&lt;br /&gt;login authentication default&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure AAA Authentication for VTY Lines&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;line vty 0 4&lt;br /&gt;login authentication default&lt;br /&gt;exit&lt;br /&gt;line vty 5 15&lt;br /&gt;login authentication default&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Set and secure passwords&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;service password-encryption&lt;br /&gt;enable secret 0 &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;password&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Local User and Encrypted Password&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;username &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;username&lt;str&gt;&gt;&lt;/span&gt; &lt;/str&gt;password &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;password&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Use the following syntax for version after 12.0(18)S, 12.1(8a)E, 12.2(8)T:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;username &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;username&gt;&lt;/span&gt; secret &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;password&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure SSH&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;hostname &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;device_hostname&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;domain-name &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;domain-name&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;crypto key generate rsa modulus 2048&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure SSH for Remote Device Access&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ip ssh timeout 60&lt;br /&gt;ip ssh authentication-retries 3&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure VTY Transport SSH&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;line console 0&lt;br /&gt;transport input ssh&lt;br /&gt;exit&lt;br /&gt;line vty 0 4&lt;br /&gt;transport input ssh&lt;br /&gt;exit&lt;br /&gt;line vty 5 15&lt;br /&gt;transport input ssh&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Timeout for Login Sessions&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;line vty 0 4&lt;br /&gt;exec-timeout 5 0&lt;br /&gt;exit&lt;br /&gt;line vty 5 15&lt;br /&gt;exec-timeout 5 0&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Auxiliary Port&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;line aux 0&lt;br /&gt;no exec&lt;br /&gt;exec-timeout 0 10&lt;br /&gt;transport input none&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable SNMP server (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no snmp-server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable SNMP Community Strings private and public&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no snmp-server community private&lt;br /&gt;no snmp-server community public&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;Configure Clock Timezone - GMT&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;clock timezone GMT &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;hours&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Router Name and DNS Name Resolution (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no ip domain-lookup&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable CDP Run Globally&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no cdp run&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable PAD service (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no service pad&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Finger Service&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no service finger&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Maintenance Operations Protocol (MOP)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface-id&lt;str&gt;&gt;&lt;/span&gt;&lt;str&gt;&lt;br /&gt;no mop enabled&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable DHCP server (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no service dhcp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable IP BOOTP server (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no ip bootp server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Identification Service&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no identd&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable IP HTTP Server (&lt;span style="color:#cc0000;"&gt;in-case not in use&lt;/span&gt;)&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no ip http server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Remote Startup Configuration&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no boot network&lt;br /&gt;no service config&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure TCP keepalives Services&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;service tcp-keepalives-in&lt;br /&gt;service tcp-keepalives-out&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable small-servers&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no service tcp-small-servers&lt;br /&gt;no service udp-small-servers&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable TFTP Server&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no tftp-server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Logging&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;logging on&lt;br /&gt;logging buffered 16000&lt;br /&gt;logging console critical&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Service Timestamps for Debug and Log Messages&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;service timestamps debug datetime msec show-timezone localtime&lt;br /&gt;service timestamps log datetime msec show-timezone localtime&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable IP source-route&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no ip source-route&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Directed Broadcast&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface-id&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;no ip directed-broadcast&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure Unicast Reverse-Path Forwarding&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface-id&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;ip verify unicast reverse-path&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable IP Proxy ARP&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;interface &lt;str&gt;&lt;span style="color:#006600;"&gt;&lt;&lt;/str&gt;interface-id&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;&lt;br /&gt;no ip proxy-arp&lt;br /&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Disable Gratuitous-Arps&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;no ip gratuitous-arps&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;u&gt;Configure switch port-security&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;switchport port-security&lt;br /&gt;switchport port-security violation shutdown&lt;br /&gt;switchport port-security maximum 1&lt;br /&gt;switchport port-security mac-address sticky &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Save the changes&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;wr&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-5961710319227456472?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/5961710319227456472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-cisco-routers-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5961710319227456472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5961710319227456472'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/hardening-guide-for-cisco-routers-and.html' title='Hardening guide for Cisco Routers and Switches'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3274378196273783406</id><published>2010-06-01T20:04:00.003+03:00</published><updated>2010-06-01T20:10:35.511+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>How to implement SSL on Apache 2.2.15</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html"&gt;Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;SSL implementation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create folder for the SSL certificate files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /usr/local/apache2/ssl&lt;br /&gt;chmod 600 /usr/local/apache2/ssl&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Run the command bellow to generate a key pair:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl genrsa -des3 -out /usr/local/apache2/ssl/server.key 1024&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Specify a complex pass phrase for the private key (and document it)&lt;br /&gt;4. Run the command bellow to generate the CSR:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl req -new -newkey rsa:1024 -nodes -keyout /usr/local/apache2/ssl/server.key -out /tmp/apache.csr&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;5. Send the file &lt;span style="color:#3333ff;"&gt;/tmp/apache.csr&lt;/span&gt; to a Certificate Authority server.&lt;br /&gt;6. As soon as you receive the signed public key from the CA server via email, copy all lines starting with “Begin” and ending with “End” (include those two lines), into notepad, and save the file as "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;"&lt;br /&gt;7. Copy the file "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/ssl/&lt;/span&gt;&lt;br /&gt;8. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;” (Note: &lt;span style="color:#cc0000;"&gt;&lt;strong&gt;The file must be PEM (base64) encoded&lt;/strong&gt;&lt;/span&gt;).&lt;br /&gt;9. Copy the file "&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/ssl/&lt;/span&gt;&lt;br /&gt;10. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/conf/httpd.conf&lt;/span&gt; and add the following lines:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Listen &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;:443&lt;br /&gt;SSLEngine on&lt;br /&gt;SSLCertificateKeyFile /usr/local/apache2/ssl/server.key&lt;br /&gt;SSLCertificateFile /usr/local/apache2/ssl/server.crt&lt;br /&gt;SSLCACertificateFile /usr/local/apache2/ssl/ca-bundle.crt&lt;br /&gt;SSLCipherSuite ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;Server_FQDN&lt;/span&gt; with the server DNS name (as written on the certificate).&lt;br /&gt;11. Restart the Apache services:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/local/apache2/bin/apachectl restart&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Backup the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/ssl/server.key&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3274378196273783406?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3274378196273783406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/how-to-implement-ssl-on-apache-2215.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3274378196273783406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3274378196273783406'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/06/how-to-implement-ssl-on-apache-2215.html' title='How to implement SSL on Apache 2.2.15'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-4010846945772327449</id><published>2010-05-31T17:19:00.003+03:00</published><updated>2010-05-31T17:27:34.803+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Nginx'/><title type='text'>How to implement SSL on Nginx 0.7.65</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-nginx-0765-on.html"&gt;Hardening guide for Nginx 0.7.65 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;SSL implementation phase &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create folder for the SSL certificate files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /usr/local/nginx/ssl&lt;br /&gt;chmod 600 /usr/local/nginx/ssl&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Run the command bellow to generate a key pair:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl genrsa -des3 -out /usr/local/nginx/ssl/server.key 1024&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Specify a complex pass phrase for the private key (and document it)&lt;br /&gt;4. Run the command bellow to generate the CSR:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl req -new -newkey rsa:1024 -nodes -keyout /usr/local/nginx/ssl/server.key -out /tmp/nginx.csr&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;5. Send the file &lt;span style="color:#3333ff;"&gt;/tmp/nginx.csr&lt;/span&gt; to a Certificate Authority server.&lt;br /&gt;6. As soon as you receive the signed public key from the CA server via email, copy all lines starting with “Begin” and ending with “End” (include those two lines), into notepad, and save the file as "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;"&lt;br /&gt;7. Copy the file "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/usr/local/nginx/ssl&lt;/span&gt;&lt;br /&gt;8. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;” (Note: &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;The file must be PEM (base64) encoded&lt;/span&gt;&lt;/strong&gt;).&lt;br /&gt;9. Copy the file "&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/usr/local/nginx/ssl&lt;/span&gt;&lt;br /&gt;10. Combine the content of both the public key (&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;) and the Root CA chain (&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;) into one file:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cat /usr/local/nginx/ssl/ca-bundle.crt /usr/local/nginx/ssl/server.crt &gt; /usr/local/nginx/ssl/server.pem&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;11. Remove the original &lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt; and &lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt; files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /usr/local/nginx/ssl/server.crt&lt;br /&gt;rm -f /usr/local/nginx/ssl/ca-bundle.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/nginx/conf/nginx.conf&lt;/span&gt; and replace the section bellow from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;# HTTPS server&lt;br /&gt;#&lt;br /&gt;#server {&lt;br /&gt;# listen 443;&lt;br /&gt;# server_name localhost;&lt;br /&gt;&lt;br /&gt;# ssl on;&lt;br /&gt;# ssl_certificate cert.pem;&lt;br /&gt;# ssl_certificate_key cert.key;&lt;br /&gt;&lt;br /&gt;# ssl_session_timeout 5m;&lt;br /&gt;&lt;br /&gt;# ssl_protocols SSLv2 SSLv3 TLSv1;&lt;br /&gt;# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;&lt;br /&gt;# ssl_prefer_server_ciphers on;&lt;br /&gt;&lt;br /&gt;# location / {&lt;br /&gt;# root html;&lt;br /&gt;# index index.html index.htm;&lt;br /&gt;# }&lt;br /&gt;#}&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server {&lt;br /&gt;listen 443;&lt;br /&gt;server_name &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;ssl on;&lt;br /&gt;ssl_certificate /usr/local/nginx/ssl/server.pem;&lt;br /&gt;ssl_certificate_key /usr/local/nginx/ssl/server.key;&lt;br /&gt;&lt;br /&gt;ssl_session_timeout 5m;&lt;br /&gt;&lt;br /&gt;ssl_protocols SSLv3;&lt;br /&gt;ssl_ciphers HIGH:!ADH:!MD5;&lt;br /&gt;ssl_prefer_server_ciphers on;&lt;br /&gt;&lt;br /&gt;location / {&lt;br /&gt;root /www;&lt;br /&gt;index index.html index.htm;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Restart the Nginx service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/nginx restart &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-4010846945772327449?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/4010846945772327449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/how-to-implement-ssl-on-nginx-0765.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4010846945772327449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4010846945772327449'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/how-to-implement-ssl-on-nginx-0765.html' title='How to implement SSL on Nginx 0.7.65'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-8516110748196355080</id><published>2010-05-31T17:06:00.003+03:00</published><updated>2010-05-31T17:18:51.506+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Nginx'/><title type='text'>Hardening guide for Nginx 0.7.65 on RedHat 5.4 (64bit edition)</title><content type='html'>1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd nginx&lt;br /&gt;useradd -g nginx -d /dev/null -s /sbin/nologin nginx&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Mount RHEL 5.4 DVD, and move to the RPM folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mount /dev/hdc /media&lt;br /&gt;cd /media/Server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;4. Before compiling the Nginx environment, install the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh kernel-headers-2.6.18-164.el5.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-headers-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-devel-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh gmp-4.1.4-10.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libgomp-4.4.0-6.el5.x86_64.rpm&lt;br /&gt;rpm -ivh gcc-4.1.2-46.el5.x86_64.rpm&lt;br /&gt;rpm -ivh pcre-devel-6.6-2.el5_1.7.x86_64.rpm&lt;br /&gt;rpm -ivh e2fsprogs-devel-1.39-23.el5.x86_64.rpm&lt;br /&gt;rpm -ivh keyutils-libs-devel-1.2-1.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libsepol-devel-1.15.2-2.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libselinux-devel-1.33.4-5.5.el5.x86_64.rpm&lt;br /&gt;rpm -ivh krb5-devel-1.6.1-36.el5.x86_64.rpm&lt;br /&gt;rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm&lt;br /&gt;rpm -ivh openssl-devel-0.9.8e-12.el5.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;5. Download &lt;span style="color:#3333ff;"&gt;Nginx 0.7.65&lt;/span&gt; from:&lt;br /&gt;&lt;a href="http://wiki.nginx.org/NginxInstall"&gt;http://wiki.nginx.org/NginxInstall&lt;/a&gt;&lt;br /&gt;6. Copy the &lt;span style="color:#3333ff;"&gt;Nginx 0.7.65&lt;/span&gt; source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;7. Move to &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Extract the &lt;span style="color:#3333ff;"&gt;nginx-0.7.65.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;tar -zxvf nginx-0.7.65.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;9. Move to the Nginx source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp/nginx-0.7.65&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;10. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/tmp/nginx-0.7.65/src/http/ngx_http_header_filter_module.c&lt;/span&gt; and replace the following section, from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;static char ngx_http_server_string[] = "Server: nginx" CRLF;&lt;br /&gt;static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;static char ngx_http_server_string[] = "Server: Secure Web Server" CRLF;&lt;br /&gt;static char ngx_http_server_full_string[] = "Server: Secure Web Server" CRLF;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;11. Run the commands bellow to compile the Nginx environment:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;./configure --with-http_ssl_module --without-http_autoindex_module --without-http_ssi_module&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make install&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Remove the Nginx source files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /tmp/nginx-0.7.65&lt;br /&gt;rm -f /tmp/nginx-0.7.65.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Remove Default Content&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /usr/local/nginx/html&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;14. Updating Ownership and Permissions on Nginx folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /usr/local/nginx&lt;br /&gt;chmod 750 /usr/local/nginx/sbin/nginx&lt;br /&gt;chmod -R 640 /usr/local/nginx/conf&lt;br /&gt;chmod -R 770 /usr/local/nginx/logs&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;15. Create folder for the web content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;16. Updating Ownership and Permissions on the web content folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root /www&lt;br /&gt;chmod -R 775 /www &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/nginx/conf/nginx.conf&lt;/span&gt; and change the following settings:&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#user nobody;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;user nginx nginx;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#error_log logs/error.log notice;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;error_log logs/error.log notice;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server_name localhost;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server_name Server_FQDN;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;root html;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;root /www; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;18. Add the following sections to the end of the &lt;span style="color:#3333ff;"&gt;/usr/local/nginx/conf/nginx.conf&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server_tokens off;&lt;br /&gt;client_body_buffer_size 1K;&lt;br /&gt;client_header_buffer_size 1k;&lt;br /&gt;client_max_body_size 1k;&lt;br /&gt;large_client_header_buffers 2 1k;&lt;br /&gt;client_body_timeout 10;&lt;br /&gt;client_header_timeout 10;&lt;br /&gt;send_timeout 10;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. Create using VI, the file &lt;span style="color:#3333ff;"&gt;/etc/init.d/nginx&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# nginx - this script starts and stops the nginx daemon&lt;br /&gt;#&lt;br /&gt;# chkconfig: - 85 15&lt;br /&gt;# description: Nginx is an HTTP(S) server, HTTP(S) reverse \&lt;br /&gt;# proxy and IMAP/POP3 proxy server&lt;br /&gt;# processname: nginx&lt;br /&gt;# config: /etc/nginx/nginx.conf&lt;br /&gt;# config: /etc/sysconfig/nginx&lt;br /&gt;# pidfile: /var/run/nginx.pid&lt;br /&gt;&lt;br /&gt;# Source function library.&lt;br /&gt;. /etc/rc.d/init.d/functions&lt;br /&gt;&lt;br /&gt;# Source networking configuration.&lt;br /&gt;. /etc/sysconfig/network&lt;br /&gt;&lt;br /&gt;# Check that networking is up.&lt;br /&gt;[ "$NETWORKING" = "no" ] &amp;amp;&amp;amp; exit 0&lt;br /&gt;&lt;br /&gt;nginx="/usr/local/nginx/sbin/nginx"&lt;br /&gt;prog=$(basename $nginx)&lt;br /&gt;&lt;br /&gt;NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"&lt;br /&gt;&lt;br /&gt;[ -f /etc/sysconfig/nginx ] &amp;amp;&amp;amp; . /etc/sysconfig/nginx&lt;br /&gt;&lt;br /&gt;lockfile=/var/lock/subsys/nginx&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;[ -x $nginx ]  exit 5&lt;br /&gt;[ -f $NGINX_CONF_FILE ]  exit 6&lt;br /&gt;echo -n $"Starting $prog: "&lt;br /&gt;daemon $nginx -c $NGINX_CONF_FILE&lt;br /&gt;retval=$?&lt;br /&gt;echo&lt;br /&gt;[ $retval -eq 0 ] &amp;amp;&amp;amp; touch $lockfile&lt;br /&gt;return $retval&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;stop() {&lt;br /&gt;echo -n $"Stopping $prog: "&lt;br /&gt;killproc $prog -QUIT&lt;br /&gt;retval=$?&lt;br /&gt;echo&lt;br /&gt;[ $retval -eq 0 ] &amp;amp;&amp;amp; rm -f $lockfile&lt;br /&gt;return $retval&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;restart() {&lt;br /&gt;configtest  return $?&lt;br /&gt;stop&lt;br /&gt;sleep 1&lt;br /&gt;start&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;reload() {&lt;br /&gt;configtest  return $?&lt;br /&gt;echo -n $"Reloading $prog: "&lt;br /&gt;killproc $nginx -HUP&lt;br /&gt;RETVAL=$?&lt;br /&gt;echo&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;force_reload() {&lt;br /&gt;restart&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;configtest() {&lt;br /&gt;$nginx -t -c $NGINX_CONF_FILE&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;rh_status() {&lt;br /&gt;status $prog&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;rh_status_q() {&lt;br /&gt;rh_status &gt;/dev/null 2&gt;&amp;amp;1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;rh_status_q &amp;amp;&amp;amp; exit 0&lt;br /&gt;$1&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;rh_status_q  exit 0&lt;br /&gt;$1&lt;br /&gt;;;&lt;br /&gt;restartconfigtest)&lt;br /&gt;$1&lt;br /&gt;;;&lt;br /&gt;reload)&lt;br /&gt;rh_status_q  exit 7&lt;br /&gt;$1&lt;br /&gt;;;&lt;br /&gt;force-reload)&lt;br /&gt;force_reload&lt;br /&gt;;;&lt;br /&gt;status)&lt;br /&gt;rh_status&lt;br /&gt;;;&lt;br /&gt;condrestarttry-restart)&lt;br /&gt;rh_status_q  exit 0&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo $"Usage: $0 {startstopstatusrestartcondrestarttry-restartreloadforce-reloadconfigtest}"&lt;br /&gt;exit 2&lt;br /&gt;esac&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;20. Change the permissions of the file &lt;span style="color:#3333ff;"&gt;/etc/init.d/nginx&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod +x /etc/init.d/nginx&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;21. To start Nginx service at server start-up, run the command:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chkconfig nginx on&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;22. To manually start the Nginx service, use the command:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/nginx start&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;23. Uninstall the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -e gcc-4.1.2-46.el5&lt;br /&gt;rpm -e libgomp-4.4.0-6.el5&lt;br /&gt;rpm -e gmp-4.1.4-10.el5&lt;br /&gt;rpm -e glibc-devel-2.5-42&lt;br /&gt;rpm -e glibc-headers-2.5-42&lt;br /&gt;rpm -e kernel-headers-2.6.18-164.el5&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-8516110748196355080?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/8516110748196355080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-nginx-0765-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8516110748196355080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8516110748196355080'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-nginx-0765-on.html' title='Hardening guide for Nginx 0.7.65 on RedHat 5.4 (64bit edition)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-5454340911285236809</id><published>2010-05-29T23:42:00.003+03:00</published><updated>2010-05-29T23:50:46.241+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Lighttpd'/><title type='text'>How to implement SSL on Lighttpd 1.4.26</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-lighttpd-1426-on.html"&gt;Hardening guide for Lighttpd 1.4.26 on RedHat 5.5 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;SSL implementation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create folder for the SSL certificate files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /etc/lighttpd/ssl&lt;br /&gt;chmod 600 /etc/lighttpd/ssl&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Run the command bellow to generate a key pair:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl genrsa -des3 -out /etc/lighttpd/ssl/server.key 1024&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Specify a complex pass phrase for the private key (and document it)&lt;br /&gt;4. Run the command bellow to generate the CSR:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/openssl req -new -newkey rsa:1024 -nodes -keyout /etc/lighttpd/ssl/server.key -out /tmp/lighttpd.csr&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;5. Send the file &lt;span style="color:#3333ff;"&gt;/tmp/lighttpd.csr&lt;/span&gt; to a Certificate Authority server.&lt;br /&gt;6. As soon as you receive the signed public key from the CA server via email, copy all lines starting with “Begin” and ending with “End” (include those two lines), into notepad, and save the file as "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;"&lt;br /&gt;7. Copy the file "&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/etc/lighttpd/ssl/&lt;/span&gt;&lt;br /&gt;8. Combine the content of both the private key (&lt;span style="color:#3333ff;"&gt;server.key&lt;/span&gt;) and the public key (&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;) into one file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cat /etc/lighttpd/ssl/server.key /etc/lighttpd/ssl/server.crt &gt; /etc/lighttpd/ssl/server.pem&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: The command above should be written as one line.&lt;br /&gt;9. Remove the original server.crt file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /etc/lighttpd/ssl/server.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;10. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;” (Note: &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;The file must be PEM (base64) encoded&lt;/span&gt;&lt;/strong&gt;).&lt;br /&gt;11. Copy the file "&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;" using SCP into &lt;span style="color:#3333ff;"&gt;/etc/lighttpd/ssl&lt;/span&gt;&lt;br /&gt;12. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/etc/lighttpd/lighttpd.conf&lt;/span&gt; and add the following strings:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;$SERVER["socket"] == "&lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;:443" {&lt;br /&gt;ssl.engine = "enable"&lt;br /&gt;ssl.pemfile = "/etc/lighttpd/ssl/server.pem"&lt;br /&gt;ssl.ca-file = "/etc/lighttpd/ssl/ca-bundle.crt"&lt;br /&gt;server.name = "&lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;"&lt;br /&gt;server.document-root = "/www"&lt;br /&gt;server.errorlog = "/var/log/lighttpd/serror.log"&lt;br /&gt;accesslog.filename = "/var/log/lighttpd/saccess.log"&lt;br /&gt;ssl.use-sslv2 = "disable"&lt;br /&gt;ssl.cipher-list ="HIGH:!MEDIUM:!SSLv2:!LOW:!EXP:!aNULL:@STRENGTH"&lt;br /&gt;} &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;13. Restart the Lighttpd service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-5454340911285236809?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/5454340911285236809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/how-to-implement-ssl-on-lighttpd-1426.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5454340911285236809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5454340911285236809'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/how-to-implement-ssl-on-lighttpd-1426.html' title='How to implement SSL on Lighttpd 1.4.26'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-2881181637458375445</id><published>2010-05-29T23:29:00.004+03:00</published><updated>2010-05-29T23:41:31.940+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Lighttpd'/><title type='text'>Hardening guide for Lighttpd 1.4.26 on RedHat 5.5 (64bit edition)</title><content type='html'>1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd lighttpd&lt;br /&gt;useradd -g lighttpd -d /dev/null -s /sbin/nologin lighttpd&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Mount RHEL 5.4 DVD, and move to the RPM folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mount /dev/hdc /media&lt;br /&gt;cd /media/Server&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;4. Before compiling the Lighttpd environment, install the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh kernel-headers-2.6.18-194.el5.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-headers-2.5-49.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-devel-2.5-49.x86_64.rpm&lt;br /&gt;rpm -ivh gmp-4.1.4-10.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libgomp-4.4.0-6.el5.x86_64.rpm&lt;br /&gt;rpm -ivh gcc-4.1.2-48.el5.x86_64.rpm&lt;br /&gt;rpm -ivh pcre-devel-6.6-2.el5_1.7.x86_64.rpm&lt;br /&gt;rpm -ivh e2fsprogs-devel-1.39-23.el5.x86_64.rpm&lt;br /&gt;rpm -ivh keyutils-libs-devel-1.2-1.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libsepol-devel-1.15.2-3.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libselinux-devel-1.33.4-5.5.el5.x86_64.rpm&lt;br /&gt;rpm -ivh krb5-devel-1.6.1-36.el5_4.1.x86_64.rpm&lt;br /&gt;rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm&lt;br /&gt;rpm -ivh openssl-devel-0.9.8e-12.el5_4.6.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;5. Download &lt;span style="color:#3333ff;"&gt;Lighttpd 1.4.26&lt;/span&gt; from:&lt;br /&gt;&lt;a href="http://www.lighttpd.net/download/"&gt;http://www.lighttpd.net/download/&lt;/a&gt;&lt;br /&gt;6. Copy the &lt;span style="color:#3333ff;"&gt;Lighttpd 1.4.26&lt;/span&gt; source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;7. Move to &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Extract the &lt;span style="color:#3333ff;"&gt;lighttpd-1.4.26.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;tar -zxvf lighttpd-1.4.26.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;9. Download into the folder &lt;span style="color:#3333ff;"&gt;/tmp/lighttpd-1.4.26/src&lt;/span&gt;, the file bellow: &lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;a href="http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/2716/raw/branches/lighttpd-1.4.x/src/network.c"&gt;http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/2716/raw/branches/lighttpd-1.4.x/src/network.c&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;10. Move to the Lighttpd source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp/lighttpd-1.4.26&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;11. Run the commands bellow to compile the Lighttpd environment:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;./configure --with-openssl --without-bzip2&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Create the following folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /etc/lighttpd&lt;br /&gt;mkdir -p /var/log/lighttpd&lt;br /&gt;mkdir -p /var/cache/lighttpd/compress&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Copy the &lt;span style="color:#3333ff;"&gt;lighttpd.conf&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /tmp/lighttpd-1.4.26/doc/lighttpd.conf /etc/lighttpd/lighttpd.conf &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;14. Updating Ownership and Permissions on Lighttpd folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown lighttpd:lighttpd /var/log/lighttpd&lt;br /&gt;chown lighttpd:root /etc/lighttpd/lighttpd.conf&lt;br /&gt;chown lighttpd:lighttpd /var/cache/lighttpd/compress&lt;br /&gt;chmod o-r /etc/lighttpd/lighttpd.conf&lt;br /&gt;chmod -R o-r /var/log/lighttpd&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;15. Create folder for the web content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;16. Updating Ownership and Permissions on the web content folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root /www&lt;br /&gt;chmod -R 775 /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;17. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/etc/lighttpd/lighttpd.conf&lt;/span&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.document-root = "/srv/www/htdocs/"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.document-root = "/www"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#server.bind = "127.0.0.1"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.bind = "&lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;# server.tag = "lighttpd"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.tag = "Secure Web Server"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#server.username = "wwwrun"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.username = "lighttpd"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#server.groupname = "wwwrun"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;server.groupname = "lighttpd"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#dir-listing.activate = "enable"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;dir-listing.activate = "disable"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;18. Create using VI, a file called &lt;span style="color:#3333ff;"&gt;/etc/sysconfig/lighttpd&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LIGHTTPD_CONF_PATH=/etc/lighttpd/lighttpd.conf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. To manually start Lighttpd use the command:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;20. To start Lighttpd service at server start-up, edit using VI, the file &lt;span style="color:#3333ff;"&gt;/etc/rc.local&lt;/span&gt; and add the line bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;21. Remove the Lighttpd source files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /tmp/lighttpd-1.4.26&lt;br /&gt;rm -f /tmp/lighttpd-1.4.26.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;22. Uninstall the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -e gcc-4.1.2-48.el5&lt;br /&gt;rpm -e libgomp-4.4.0-6.el5&lt;br /&gt;rpm -e gmp-4.1.4-10.el5&lt;br /&gt;rpm -e glibc-devel-2.5-49&lt;br /&gt;rpm -e glibc-headers-2.5-49&lt;br /&gt;rpm -e kernel-headers-2.6.18-194.el5 &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-2881181637458375445?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/2881181637458375445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-lighttpd-1426-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2881181637458375445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/2881181637458375445'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-lighttpd-1426-on.html' title='Hardening guide for Lighttpd 1.4.26 on RedHat 5.5 (64bit edition)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3185375069795205516</id><published>2010-05-28T17:46:00.003+03:00</published><updated>2010-05-28T18:15:18.382+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>Hardening guide for WordPress 2.9.2</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guides:&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html"&gt;Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-mysql-5147-on.html"&gt;Hardening guide for MySQL 5.1.47 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-php-532-on-apache.html"&gt;Hardening guide for PHP 5.3.2 on Apache 2.2.15 / MySQL 5.1.47 (RHEL 5.4)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Installation and configuration phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create a new account for uploading files using SSH:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd sshaccount&lt;br /&gt;useradd -g sshaccount -d /home/sshaccount -m sshaccount&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Run the commands bellow to switch to the SSH account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;su sshaccount&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;4. Run the command bellow to generate SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ssh-keygen&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Leave deafult values for the ssh-keygen.&lt;br /&gt;5. Copy the SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /home/sshaccount/.ssh/id_rsa.pub /home/sshaccount/.ssh/authorized_keys&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;6. Change permissions for the SSH keys:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 755 /home/sshaccount/.ssh&lt;br /&gt;chmod 644 /home/sshaccount/.ssh/*&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;7. Exit the SSH account shell and return to the Root account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;exit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Run the command bellow to login to the MySQL:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/mysql -uroot -p&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Replace the string “&lt;span style="color:#3333ff;"&gt;new-password&lt;/span&gt;” with the actual password for the root account.&lt;br /&gt;9. Run the following commands from the MySQL prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;CREATE USER '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;'@'localhost' IDENTIFIED BY '&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;';&lt;br /&gt;SET PASSWORD FOR '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;'@'localhost' = OLD_PASSWORD('&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;');&lt;br /&gt;CREATE DATABASE &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;;&lt;br /&gt;GRANT ALL PRIVILEGES ON &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;.* TO "&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;"@"localhost" IDENTIFIED BY "&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;";&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Replace “&lt;span style="color:#3333ff;"&gt;blgusr&lt;/span&gt;” with your own MySQL account to access the database.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;password2&lt;/span&gt;” with complex password (at least 14 characters).&lt;br /&gt;Note 3: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with your own WordPress database name.&lt;br /&gt;10. Download WordPress 2.9.2 from:&lt;br /&gt;&lt;a href="http://wordpress.org/download"&gt;http://wordpress.org/download&lt;/a&gt;&lt;br /&gt;11. Copy the WordPress 2.9.2 source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/www&lt;/span&gt;&lt;br /&gt;12. Move to &lt;span style="color:#3333ff;"&gt;/www&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /www&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Extract the &lt;span style="color:#3333ff;"&gt;wordpress-2.9.2.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;tar -zxvf wordpress-2.9.2.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;14. Remove WordPress source file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /www/wordpress-2.9.2.tar.gz &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;15. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/config.php&lt;/span&gt; with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;?php&lt;br /&gt;define('DB_NAME', '&lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;');&lt;br /&gt;define('DB_USER', '&lt;span style="color:#006600;"&gt;blgusr&lt;/span&gt;');&lt;br /&gt;define('DB_PASSWORD', '&lt;span style="color:#006600;"&gt;password2&lt;/span&gt;');&lt;br /&gt;define('DB_HOST', '127.0.0.1');&lt;br /&gt;$table_prefix = '&lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;_';&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here');&lt;br /&gt;define('FS_METHOD', 'direct');&lt;br /&gt;define('FS_CHMOD_DIR', 0777);&lt;br /&gt;define('FS_CHMOD_FILE', 0777);&lt;br /&gt;define('FTP_BASE', '/www/wordpress/');&lt;br /&gt;define('FTP_CONTENT_DIR', '/www/wordpress/wp-content/');&lt;br /&gt;define('FTP_PLUGIN_DIR ', '/www/wordpress/wp-content/plugins/');&lt;br /&gt;define('FTP_PUBKEY', '/home/sshaccount/.ssh/id_rsa.pub');&lt;br /&gt;define('FTP_PRIKEY', '/home/sshaccount/.ssh/id_rsa');&lt;br /&gt;define('FTP_USER', 'sshaccount');&lt;br /&gt;define('FTP_HOST', '127.0.0.1:22');&lt;br /&gt;?&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Make sure there are no spaces, newlines, or other strings before an opening '&lt;str&gt;&lt;span style="color:#3333ff;"&gt;&lt;&lt;/str&gt; ?php&lt;/span&gt;' tag or after a closing '&lt;span style="color:#3333ff;"&gt;?&lt;str&gt;&gt;&lt;/span&gt;&lt;/str&gt;' tag.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;blgusr&lt;/span&gt;” with your own MySQL account to access the database.&lt;br /&gt;Note 3: Replace “&lt;span style="color:#3333ff;"&gt;password2&lt;/span&gt;” with complex password (at least 14 characters).&lt;br /&gt;Note 4: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with your own WordPress database name.&lt;br /&gt;Note 5: In-order to generate random values for the &lt;span style="color:#3333ff;"&gt;AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;SECURE_AUTH_KEY&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;LOGGED_IN_KEY&lt;/span&gt; and &lt;span style="color:#3333ff;"&gt;NONCE_KEY&lt;/span&gt;, use the web site bellow:&lt;br /&gt;&lt;a href="http://api.wordpress.org/secret-key/1.1/"&gt;http://api.wordpress.org/secret-key/1.1/&lt;/a&gt;&lt;br /&gt;16. Copy the &lt;span style="color:#3333ff;"&gt;wp-config.php&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /www/wordpress/wp-config-sample.php /www/wordpress/wp-config.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-config.php&lt;/span&gt;&lt;br /&gt;Add the following line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;include('/www/config.php');&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Remove the following sections:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('DB_NAME', 'putyourdbnamehere');&lt;br /&gt;define('DB_USER', 'usernamehere');&lt;br /&gt;define('DB_PASSWORD', 'yourpasswordhere');&lt;br /&gt;define('DB_HOST', 'localhost');&lt;br /&gt;$table_prefix = 'wp_';&lt;br /&gt;define('AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('SECURE_AUTH_KEY', 'put your unique phrase here');&lt;br /&gt;define('LOGGED_IN_KEY', 'put your unique phrase here');&lt;br /&gt;define('NONCE_KEY', 'put your unique phrase here'); &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;18. Remove default content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /www/wordpress/license.txt&lt;br /&gt;rm -f /www/wordpress/readme.html&lt;br /&gt;rm -f /www/wordpress/wp-config-sample.php&lt;br /&gt;rm -f /www/wordpress/wp-content/plugins/hello.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;Replace the value of the string, from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www/wordpress"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Replace the value of the string, from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LimitRequestBody 10000&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LimitRequestBody 200000&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;20. Restart the Apache service.&lt;br /&gt;21. Open a web browser from a client machine, and enter the URL bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;http://Server_FQDN/wp-admin/install.php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;22. Specify the following information:&lt;br /&gt;• Blog Title&lt;br /&gt;• E-Mail&lt;br /&gt;23. Click on “&lt;span style="color:#3333ff;"&gt;Install WordPress&lt;/span&gt;” button, and close the web browser.&lt;br /&gt;24. Run the command bellow to login to the MySQL:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/mysql -uroot -p&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Replace the string “&lt;span style="color:#3333ff;"&gt;new-password&lt;/span&gt;” with the actual password for the root account.&lt;br /&gt;25. Run the following commands from the MySQL prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;use &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;;&lt;br /&gt;UPDATE &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;_users SET user_login='&lt;span style="color:#006600;"&gt;johnd&lt;/span&gt;' WHERE user_login='admin';&lt;br /&gt;UPDATE &lt;span style="color:#006600;"&gt;m6gf42s&lt;/span&gt;_users SET user_pass=MD5('&lt;span style="color:#006600;"&gt;password3&lt;/span&gt;') WHERE user_login='&lt;span style="color:#006600;"&gt;johnd&lt;/span&gt;';&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Replace “&lt;span style="color:#3333ff;"&gt;m6gf42s&lt;/span&gt;” with your own WordPress database name.&lt;br /&gt;Note 1: Replace “&lt;span style="color:#3333ff;"&gt;johnd&lt;/span&gt;” with your own new WordPress admin.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;password3&lt;/span&gt;” with complex password (at least 14 characters).&lt;br /&gt;26. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-includes/http.php&lt;/span&gt; and replace the following line from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;'timeout' =&gt; apply_filters( 'http_request_timeout', 5),&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;'timeout' =&gt; apply_filters( 'http_request_timeout', 30), &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;27. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;files wp-config.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/files&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;Files wp-login.php&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from All&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Files&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;RewriteEngine On&lt;br /&gt;RewriteCond %{REQUEST_METHOD} POST&lt;br /&gt;RewriteCond %{REQUEST_URI} .wp-comments-post\.php*&lt;br /&gt;RewriteCond %{HTTP_REFERER} !.*Server_FQDN.* [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^$&lt;br /&gt;RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note 1: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;Note 2: Replace &lt;span style="color:#3333ff;"&gt;Server_FQDN&lt;/span&gt; with the server FQDN (DNS name).&lt;br /&gt;28. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-admin/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName “Access Control”&lt;br /&gt;AuthType Basic&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;LIMIT GET POST&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/LIMIT&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;IfModule mod_security.c&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;SecFilterInheritance Off&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/IfModule&lt;str&gt;&gt;&lt;/str&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;29. Create using VI the file &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-content/plugins/.htaccess&lt;/span&gt; with the following content:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AuthUserFile /dev/null&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;AuthName "Access Control"&lt;br /&gt;AuthType Basic&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from All&lt;br /&gt;Allow from &lt;span style="color:#006600;"&gt;1.1.1.0&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Note: Replace &lt;span style="color:#3333ff;"&gt;1.1.1.0&lt;/span&gt; with the internal network IP address.&lt;br /&gt;30. Create the following folders:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www/wordpress/wp-content/cache&lt;br /&gt;mkdir -p /www/wordpress/wp-content/uploads&lt;br /&gt;mkdir -p /www/wordpress/wp-content/upgrade&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;31. Change the file permissions:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /www/wordpress&lt;br /&gt;chown daemon:root /www/wordpress/wp-content/plugins&lt;br /&gt;chmod 644 /www/config.php&lt;br /&gt;chmod 644 /www/wordpress/wp-config.php&lt;br /&gt;chmod 644 /www/wordpress/.htaccess&lt;br /&gt;chmod 644 /www/wordpress/wp-admin/.htaccess&lt;br /&gt;chmod 644 /www/wordpress/wp-content/plugins/.htaccess&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/cache&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/uploads&lt;br /&gt;chmod -R 777 /www/wordpress/wp-content/upgrade &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;32. Download "&lt;span style="color:#3333ff;"&gt;Login Lockdown&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.bad-neighborhood.com/login-lockdown.html"&gt;http://www.bad-neighborhood.com/login-lockdown.html&lt;/a&gt;&lt;br /&gt;33. Download "&lt;span style="color:#3333ff;"&gt;WP-Secure Remove Wordpress Version&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/"&gt;http://wordpress.org/extend/plugins/wp-secure-remove-wordpress-version/&lt;/a&gt;&lt;br /&gt;34. Download "&lt;span style="color:#3333ff;"&gt;WP Security Scan&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/wp-security-scan/"&gt;http://wordpress.org/extend/plugins/wp-security-scan/&lt;/a&gt;&lt;br /&gt;35. Download "&lt;span style="color:#3333ff;"&gt;KB Robots.txt&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://wordpress.org/extend/plugins/kb-robotstxt/"&gt;http://wordpress.org/extend/plugins/kb-robotstxt/&lt;/a&gt;&lt;br /&gt;36. Download "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://austinmatzko.com/wordpress-plugins/wp-db-backup/"&gt;http://austinmatzko.com/wordpress-plugins/wp-db-backup/&lt;/a&gt;&lt;br /&gt;37. Download "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin from:&lt;br /&gt;&lt;a href="http://www.seoegghead.com/software/wordpress-firewall.seo"&gt;http://www.seoegghead.com/software/wordpress-firewall.seo&lt;/a&gt;&lt;br /&gt;38. Copy the "&lt;span style="color:#3333ff;"&gt;WordPress Firewall&lt;/span&gt;" plugin file "&lt;span style="color:#3333ff;"&gt;wordpress-firewall.php&lt;/span&gt;" using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/www/wordpress/wp-content/plugins&lt;/span&gt;&lt;br /&gt;39. Create a folder for the "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www/wordpress/wp-content/backup-ed602&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;40. Set permissions for the "&lt;span style="color:#3333ff;"&gt;WordPress Database Backup&lt;/span&gt;" plugin:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 777 /www/wordpress/wp-content/backup-ed602&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;41. Open a web browser from a client machine, and enter the URL bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;http://Server_FQDN/wp-login.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;42. From WordPress dashboard, click on "settings" -&gt; make sure that "&lt;span style="color:#3333ff;"&gt;Anyone can register&lt;/span&gt;" is left unchecked -&gt; click on "Save changes".&lt;br /&gt;43. From WordPress dashboard, click on "settings" -&gt; click on "Miscellaneous" -&gt; "Store uploads in this folder" -&gt; specify:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;wp-content/uploads&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;44. Click on "Save changes".&lt;br /&gt;45. From WordPress dashboard, click on "Plugins" -&gt; Add New -&gt; choose "Upload" -&gt; click Browse to locate the plugin -&gt; click "Install Now" -&gt; click "Proceed" -&gt; click on "Activate Plugin".&lt;br /&gt;Note: Install and activate all the above downloaded plugins.&lt;br /&gt;46. From WordPress dashboard, click on "settings" -&gt; click on "&lt;span style="color:#3333ff;"&gt;KB Robots.txt&lt;/span&gt;" -&gt; add the following content into the Robots.txt editor field:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Disallow: /wp-*&lt;br /&gt;Disallow: /wp-admin&lt;br /&gt;Disallow: /wp-includes&lt;br /&gt;Disallow: /wp-content/plugins&lt;br /&gt;Disallow: /wp-content/cache&lt;br /&gt;Disallow: /wp-content/themes&lt;br /&gt;Disallow: /wp-login.php&lt;br /&gt;Disallow: /wp-register.php&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;47. Click "Submit".&lt;br /&gt;48. From the upper pane, click on "Log Out".&lt;br /&gt;49. In-case the server was configured with SSL certificate, add the following line to the &lt;span style="color:#3333ff;"&gt;/www/config.php&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;define('FORCE_SSL_LOGIN', true); &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3185375069795205516?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3185375069795205516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-wordpress-292.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3185375069795205516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3185375069795205516'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-wordpress-292.html' title='Hardening guide for WordPress 2.9.2'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-5289921537969583672</id><published>2010-05-25T19:55:00.004+03:00</published><updated>2010-05-25T20:14:35.659+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Hardening guide for PHP 5.3.2 on Apache 2.2.15 / MySQL 5.1.47 (RHEL 5.4)</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guides:&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html"&gt;Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-mysql-5147-on.html"&gt;Hardening guide for MySQL 5.1.47 on RedHat 5.4 (64bit edition)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Installation and configuration phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Before compiling the PHP environment, install the following RPM from the RHEL 5.4 (64bit) DVD source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh kernel-headers-2.6.18-164.el5.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-headers-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-devel-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh gmp-4.1.4-10.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libgomp-4.4.0-6.el5.x86_64.rpm&lt;br /&gt;rpm -ivh gcc-4.1.2-46.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libxml2-2.6.26-2.1.2.8.x86_64.rpm&lt;br /&gt;rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm&lt;br /&gt;rpm -ivh libxml2-devel-2.6.26-2.1.2.8.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Download MySQL development RPM from:&lt;br /&gt;&lt;a href="http://download.softagency.net/MySQL/Downloads/MySQL-5.1/"&gt;http://download.softagency.net/MySQL/Downloads/MySQL-5.1/&lt;/a&gt;&lt;br /&gt;4. Download PHP 5.3.2 source files from:&lt;br /&gt;&lt;a href="http://php.net/downloads.php"&gt;http://php.net/downloads.php&lt;/a&gt;&lt;br /&gt;5. Copy the MySQL development RPM using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;6. Copy the PHP 5.3.2 source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;7. Move to &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;8. Install the MySQL development RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh MySQL-devel-community-5.1.47-1.rhel5.x86_64.rpm&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;9. Remove MySQL development RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f MySQL-devel-community-5.1.47-1.rhel5.x86_64.rpm&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;10. Extract the &lt;span style="color:#3333ff;"&gt;php-5.3.2.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;tar -zxvf php-5.3.2.tar.gz&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;11. Move to the PHP source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp/php-5.3.2&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Run the commands bellow to compile the PHP environment:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;./configure --with-mysql=/var/lib/mysql --with-libdir=lib64 --prefix=/usr/local/apache2 --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl --with-zlib&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make install&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;12. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;Make sure the following string exists at the end of the &lt;span style="color:#3333ff;"&gt;LoadModule&lt;/span&gt; section:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LoadModule php5_module modules/libphp5.so&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Add the following string, to the end of the &lt;span style="color:#3333ff;"&gt;AddType&lt;/span&gt; section:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;AddType application/x-httpd-php .php&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Replace the line from:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DirectoryIndex index.html&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;DirectoryIndex index.php index.html index.htm&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;13. Copy the &lt;span style="color:#3333ff;"&gt;PHP.ini&lt;/span&gt; file&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /tmp/php-5.3.2/php.ini-development /etc/php.ini&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;14. Change the permissions on the &lt;span style="color:#3333ff;"&gt;php.ini&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 640 /etc/php.ini&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;15. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/etc/php.ini&lt;/span&gt; and replace the following values:&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mysql.default_host =&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mysql.default_host = 127.0.0.1:3306&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;allow_url_fopen = On&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;allow_url_fopen = Off&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;expose_php = On&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;expose_php = Off&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;memory_limit = 128M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;memory_limit = 8M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;;open_basedir =&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;open_basedir = "/www"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;post_max_size = 8M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;post_max_size = 2M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;upload_max_filesize = 2M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;upload_max_filesize = 1M&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;disable_functions =&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;disable_functions = fpassthru,crack_check,crack_closedict,crack_getlastmessage,crack_opendict, psockopen,php_ini_scanned_files,shell_exec,chown,hell-exec,dl,ctrl_dir,phpini,tmp,safe_mode,systemroot,server_software, get_current_user,HTTP_HOST,ini_restore,popen,pclose,exec,suExec,passthru,proc_open,proc_nice,proc_terminate, proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid, posix_setsid,posix_setuid,escapeshellcmd,escapeshellarg,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid, posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,system,posix_getsid,posix_getuid,posix_isatty, posix_setegid,posix_seteuid,posix_setgid,posix_times,posix_ttyname,posix_uname,posix_access,posix_get_last_error,posix_mknod, posix_strerror,posix_initgroups,posix_setsidposix_setuid&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;;include_path = ".:/php/includes"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;include_path = "/usr/local/lib/php;/usr/local/apache2/include/php"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;display_errors = On&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;display_errors = Off&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;display_startup_errors = On&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;display_startup_errors = Off&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;16. Run the commands bellow to restart the Apache service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/local/apache2/bin/apachectl stop&lt;br /&gt;/usr/local/apache2/bin/apachectl start&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;17. Remove the PHP source and test files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /tmp/php-5.3.2&lt;br /&gt;rm -f /tmp/php-5.3.2.tar.gz&lt;br /&gt;rm -rf /usr/local/apache2/lib/php/test&lt;br /&gt;rm -rf /usr/local/lib/php/test&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;18. Uninstall the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -e libxml2-devel-2.6.26-2.1.2.8&lt;br /&gt;rpm -e gcc-4.1.2-46.el5&lt;br /&gt;rpm -e libgomp-4.4.0-6.el5&lt;br /&gt;rpm -e gmp-4.1.4-10.el5&lt;br /&gt;rpm -e glibc-devel-2.5-42&lt;br /&gt;rpm -e glibc-headers-2.5-42&lt;br /&gt;rpm -e kernel-headers-2.6.18-164.el5 &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-5289921537969583672?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/5289921537969583672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-php-532-on-apache.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5289921537969583672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5289921537969583672'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-php-532-on-apache.html' title='Hardening guide for PHP 5.3.2 on Apache 2.2.15 / MySQL 5.1.47 (RHEL 5.4)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3783595161898613150</id><published>2010-05-21T15:03:00.007+03:00</published><updated>2010-05-25T19:51:06.592+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><title type='text'>Hardening guide for MySQL 5.1.47 on RedHat 5.4 (64bit edition)</title><content type='html'>1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;groupadd mysql&lt;br /&gt;useradd -d /dev/null -g mysql -s /bin/false mysql&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;3. Download MySQL server and client RPM from:&lt;br /&gt;&lt;a href="http://download.softagency.net/MySQL/Downloads/MySQL-5.1/"&gt;http://download.softagency.net/MySQL/Downloads/MySQL-5.1/&lt;/a&gt;&lt;br /&gt;4. Copy the MySQL 5.1.47 source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;5. Move to &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;6. Install the MySQL packages:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh MySQL-server-community-5.1.47-1.rhel5.x86_64.rpm&lt;br /&gt;rpm -ivh MySQL-client-community-5.1.47-1.rhel5.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;7. Delete the MySQL source files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -f /tmp/MySQL-server-community-5.1.47-1.rhel5.x86_64.rpm&lt;br /&gt;rm -f /tmp/MySQL-client-community-5.1.47-1.rhel5.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;8. Run the commands bellow to set ownership and permissions:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R root /usr/bin/mysql*&lt;br /&gt;chown -R mysql:root /var/lib/mysql&lt;br /&gt;chmod -R go-rwx /var/lib/mysql&lt;br /&gt;mkdir -p /var/log/mysql&lt;br /&gt;chown -R mysql:root /var/log/mysql&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;9. Run the command bellow to copy the main configuration file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cp /usr/share/mysql/my-medium.cnf /etc/my.cnf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;10. Run the commands bellow to remove default folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /var/lib/mysql/test&lt;br /&gt;rm -f /usr/share/mysql/*.cnf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;11. Run the command bellow to set ownership and permissions for &lt;span style="color:#3333ff;"&gt;my.cnf&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown root /etc/my.cnf&lt;br /&gt;chmod 644 /etc/my.cnf&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;12. Edit using VI, the file &lt;span style="color:#3333ff;"&gt;/etc/my.cnf&lt;/span&gt;&lt;br /&gt;Add the strings bellow under the &lt;span style="color:#3333ff;"&gt;[mysqld]&lt;/span&gt; section&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;pid-file = /var/lib/mysql/mysqld.pid&lt;br /&gt;log = /var/log/mysql/mysql.log&lt;br /&gt;bind-address = 127.0.0.1&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Add the section bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;[safe_mysqld]&lt;br /&gt;err-log = /var/log/mysql/mysql.err&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;13. Run the command bellow to restart the target server:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;reboot&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;14. Login to the server using Root account.&lt;br /&gt;15. Run the commands bellow to set password for the MySQL root user:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/mysqladmin -u root password '&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;'&lt;br /&gt;/usr/bin/mysqladmin -u root -h &lt;span style="color:#006600;"&gt;hostname&lt;/span&gt; password '&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;'&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note 1: Specify complex password (at least 14 characters) and document it.&lt;br /&gt;Note 2: Replace “&lt;span style="color:#3333ff;"&gt;hostname&lt;/span&gt;” with the server FQDN (DNS name)&lt;br /&gt;16. Run the command bellow to login to the MySQL:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/bin/mysql -uroot -p&lt;span style="color:#006600;"&gt;new-password&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: Replace the string “&lt;span style="color:#3333ff;"&gt;new-password&lt;/span&gt;” with the actual password for the root account.&lt;br /&gt;17. Run the following commands from the MySQL prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;use mysql;&lt;br /&gt;DELETE FROM mysql.user WHERE user = '';&lt;br /&gt;DELETE FROM mysql.user WHERE user = 'root' AND host = '%';&lt;br /&gt;DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';&lt;br /&gt;DROP DATABASE test;&lt;br /&gt;DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;18. Run the command bellow to stop the MySQL service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/mysql stop&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;19. Run the command bellow to start the MySQL service:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/mysql start &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3783595161898613150?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3783595161898613150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-mysql-5147-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3783595161898613150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3783595161898613150'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-mysql-5147-on.html' title='Hardening guide for MySQL 5.1.47 on RedHat 5.4 (64bit edition)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-8743522254604661952</id><published>2010-05-20T21:12:00.010+03:00</published><updated>2010-05-25T19:49:19.107+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)</title><content type='html'>1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;groupadd apache&lt;br /&gt;useradd -g apache -d /dev/null -s /bin/false apache&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;3. Mount RHEL 5.4 DVD, and move to the RPM folder:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;mount /dev/hdc /media&lt;br /&gt;cd /media/Server&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;4. Before compiling the Apache environment, install the following RPM:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rpm -ivh kernel-headers-2.6.18-164.el5.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-headers-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh glibc-devel-2.5-42.x86_64.rpm&lt;br /&gt;rpm -ivh gmp-4.1.4-10.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libgomp-4.4.0-6.el5.x86_64.rpm&lt;br /&gt;rpm -ivh gcc-4.1.2-46.el5.x86_64.rpm&lt;br /&gt;rpm -ivh e2fsprogs-devel-1.39-23.el5.x86_64.rpm&lt;br /&gt;rpm -ivh keyutils-libs-devel-1.2-1.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libsepol-devel-1.15.2-2.el5.x86_64.rpm&lt;br /&gt;rpm -ivh libselinux-devel-1.33.4-5.5.el5.x86_64.rpm&lt;br /&gt;rpm -ivh krb5-devel-1.6.1-36.el5.x86_64.rpm&lt;br /&gt;rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm&lt;br /&gt;rpm -ivh openssl-devel-0.9.8e-12.el5.x86_64.rpm&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;5. Copy the &lt;span style="color:#3333ff;"&gt;Httpd 2.2.15&lt;/span&gt; source files using PSCP (or SCP) into &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;6. Move to &lt;span style="color:#3333ff;"&gt;/tmp&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cd /tmp&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;7. Extract the &lt;span style="color:#3333ff;"&gt;httpd-2.2.15.tar.gz&lt;/span&gt; file:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;tar -zxvf httpd-2.2.15.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;8. Move to the Apache source folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;cd httpd-2.2.15&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;9. Run the commands bellow to compile the Apache environment:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;make install&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;10. Remove the Apache source files:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /tmp/httpd-2.2.15&lt;br /&gt;rm -f /tmp/httpd-2.2.15.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;11. Remove Default Content&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm -rf /usr/local/apache2/cgi-bin&lt;br /&gt;rm -rf /usr/local/apache2/htdocs&lt;br /&gt;rm -rf /usr/local/apache2/icons&lt;br /&gt;rm -rf /usr/local/apache2/man&lt;br /&gt;rm -rf /usr/local/apache2/manual&lt;br /&gt;rm -rf /usr/local/apache2/conf/extra&lt;br /&gt;rm -rf /usr/local/apache2/conf/original&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;12. Updating Ownership and Permissions on Apache2 folders:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown root:root /usr/local/apache2/bin/apachectl&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown root:root /usr/local/apache2/bin/httpd*&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod 770 /usr/local/apache2/bin/apachectl&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod 770 /usr/local/apache2/bin/httpd*&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /usr/local/apache2&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod -R go-r /usr/local/apache2&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /usr/local/apache2/logs&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod -R 700 /usr/local/apache2/logs&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;13. Create folder for the web content:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;14. Updating Ownership and Permissions on the web content folder:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown -R root /www&lt;br /&gt;chmod -R 775 /www&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;15. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/conf/httpd.conf&lt;/span&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/var/www/html"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Listen 80&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Listen &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;:80&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerAdmin root@localhost &lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ServerAdmin webmaster@&lt;span style="color:#006600;"&gt;mycompany&lt;/span&gt;.com&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#ServerName www.example.com:80&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ServerName &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LogLevel warn&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;LogLevel notice&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;# ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/" &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory &lt;str&gt;/&gt;&lt;/str&gt;&lt;br /&gt;Options FollowSymLinks&lt;br /&gt;AllowOverride None&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Directory&lt;str&gt;&gt;&lt;/str&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory /&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Options None&lt;br /&gt;AllowOverride None&lt;br /&gt;Order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Directory&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory "/usr/local/apache2/htdocs"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory "/www"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;LimitExcept GET POST&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/limitexcept&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Options Indexes FollowSymLinks&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;Options -FollowSymLinks -Includes -Indexes -MultiViews&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;16. Add the following sections to the end of the &lt;span style="color:#3333ff;"&gt;httpd.conf&lt;/span&gt; file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;ServerSignature Off&lt;br /&gt;ServerTokens Prod&lt;br /&gt;Timeout 60&lt;br /&gt;# Maximum size of the request body.&lt;br /&gt;LimitRequestBody 10000&lt;br /&gt;# Maximum number of request headers in a request.&lt;br /&gt;LimitRequestFields 40&lt;br /&gt;# Maximum size of request header lines.&lt;br /&gt;LimitRequestFieldSize 4094&lt;br /&gt;# Maximum size of the request line.&lt;br /&gt;LimitRequestLine 500 &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Remove the sections bellow from the file &lt;span style="color:#3333ff;"&gt;httpd.conf&lt;/span&gt;&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory "/usr/local/apache2/cgi-bin"&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;18. Edit using VI the file &lt;span style="color:#3333ff;"&gt;/usr/local/apache2/include/ap_release.h&lt;/span&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEVENDOR "Apache Software Foundation"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEVENDOR "Restricted server"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEPRODUCT "Apache"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEPRODUCT "Secure Web Server"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;19. Starting Apache from command line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/local/apache2/bin/apachectl start&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;20. To start Apache service at server start-up, edit using VI, the file &lt;span style="color:#3333ff;"&gt;/etc/rc.local&lt;/span&gt; and add the line bellow:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;&lt;em&gt;/usr/local/apache2/bin/apachectl start&lt;/em&gt;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;21. Uninstall the following RPM:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;rpm -e gcc-4.1.2-46.el5&lt;br /&gt;rpm -e libgomp-4.4.0-6.el5&lt;br /&gt;rpm -e gmp-4.1.4-10.el5&lt;br /&gt;rpm -e glibc-devel-2.5-42&lt;br /&gt;rpm -e glibc-headers-2.5-42&lt;br /&gt;rpm -e kernel-headers-2.6.18-164.el5 &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Previous guides: &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-apache-20-on.html"&gt;Hardening guide for Apache 2.0 on Solaris 10 platform&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eyalestrin.blogspot.com/2010/01/how-to-implement-ssl-on-apache-20.html"&gt;How to implement SSL on Apache 2.0&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-8743522254604661952?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/8743522254604661952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8743522254604661952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8743522254604661952'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-apache-2215-on.html' title='Hardening guide for Apache 2.2.15 on RedHat 5.4 (64bit edition)'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3511275919963309745</id><published>2010-05-13T11:58:00.005+03:00</published><updated>2010-05-13T22:52:29.476+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server core'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.5'/><title type='text'>Hardening guide for IIS 7.5 on Windows 2008 R2 server core platform</title><content type='html'>&lt;u&gt;OS installation phase&lt;/u&gt;&lt;br /&gt;1. Boot the server using Windows 2008 R2 bootable DVD.&lt;br /&gt;2. Specify the product ID -&gt; click Next.&lt;br /&gt;3. From the installation option, choose "&lt;span style="color:#cc0000;"&gt;Windows Server 2008 R2 (Server Core Installation)&lt;/span&gt;" -&gt; click Next.&lt;br /&gt;4. Accept the license agreement -&gt; click Next.&lt;br /&gt;5. Choose "&lt;span style="color:#cc0000;"&gt;Custom (Advanced)&lt;/span&gt;" installation type -&gt; specify the hard drive to install the operating system -&gt; click Next.&lt;br /&gt;6. Allow the installation phase to continue and restart the server automatically.&lt;br /&gt;7. To login to the server for the first time, press CTRL+ALT+DELETE&lt;br /&gt;8. Choose "Administrator" account -&gt; click OK to replace the account password -&gt; specify complex password and confirm it -&gt; press Enter -&gt; Press OK.&lt;br /&gt;9. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;sconfig.cmd &lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;10. Press "2" to replace the computer name -&gt; specify new computer name -&gt; click "Yes" to restart the server.&lt;br /&gt;11. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;12. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;sconfig.cmd&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;13. Press "5" to configure "Windows Update Settings" -&gt; select "A" for automatic -&gt; click OK.&lt;br /&gt;14. Press "6" to download and install Windows Updates -&gt; choose "A" to search for all updates -&gt; Choose "A" to download and install all updates -&gt; click "Yes" to restart the server.&lt;br /&gt;15. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;16. From the command prompt window, run the command bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;sconfig.cmd&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. In-case you need to use RDP to access and manage the server, press "7" to enable "Remote Desktop" -&gt; choose "E" to enable -&gt; choose either "1" or "2" according to your client settings -&gt; Press OK.&lt;br /&gt;18. Press "8" to configure "Network settings" -&gt; select the network adapter by its Index number -&gt; press "1" to configure the IP settings -&gt; choose "S" for static IP address -&gt; specify the IP address, subnet mask and default gateway -&gt; press "2" to configure the DNS servers -&gt; click OK -&gt; press "4" to return to the main menu.&lt;br /&gt;19. Press "9" to configure "Date and Time" -&gt; choose the correct "date/time" and "time zone" -&gt; click OK&lt;br /&gt;20. Press "11" to restart the server to make sure all settings take effect -&gt; click "Yes" to restart the server.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Web server installation phase&lt;/u&gt;&lt;br /&gt;1. To login to the server, press CTRL+ALT+DELETE -&gt; specify the "Administrator" account credentials.&lt;br /&gt;2. For minimal installation of IIS7.5 features, run the command bellow from command prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;3. For full installation of IIS7.5 (&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;not recommended on production environments&lt;/span&gt;&lt;/strong&gt;), run the command bellow from command prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;start /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;4. For full installation of IIS7.5, including .NET framework (&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;not recommended on production environments&lt;/span&gt;&lt;/strong&gt;), run the command bellow from command prompt:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;start /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell;NetFx2-ServerCore;NetFx2-ServerCore-WOW64&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Create a new folder for the WWW content, in a different partition then the operating system, for example:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;md D:\WWW&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. Copy the content of the web site to the newly created folder.&lt;br /&gt;7. Use the Cacls.exe command to configure the required NTFS permissions for the new WWW folder (according to the principle of least privilege).&lt;br /&gt;8. Run the command bellow to configure IIS metadata to use the new folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;%windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:D:\WWW&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;9. Create a new folder for the LogFiles content, in a different partition then the operating system, for example:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;md D:\LogFiles&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;10. Use the Cacls.exe command to configure the required NTFS permissions for the new LogFiles folder (according to the principle of least privilege).&lt;br /&gt;11. Run the commands bellow to configure IIS metadata to use the new folder:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"D:\LogFiles"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"D:\LogFiles"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"D:\LogFiles"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;12. Run the command bellow to configure the newly created WWW folder for service packs and other installers:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d D:\WWW&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3511275919963309745?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3511275919963309745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-iis-75-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3511275919963309745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3511275919963309745'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/05/hardening-guide-for-iis-75-on-windows.html' title='Hardening guide for IIS 7.5 on Windows 2008 R2 server core platform'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-3732420457906355551</id><published>2010-01-14T13:51:00.005+02:00</published><updated>2010-01-14T14:19:05.845+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>How to implement SSL on Apache 2.0</title><content type='html'>&lt;u&gt;Pre-installation notes&lt;br /&gt;&lt;/u&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-apache-20-on.html"&gt;Hardening guide for Apache 2.0 on Solaris 10 platform&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;SSL implementation phase&lt;/u&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Mount Solaris 10 DVD, and move to the packages folder:&lt;br /&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;cd /cdrom/sol_10_1008_x86/Solaris_10/Product&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;3. Run the command bellow to install OpenSSL packages:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;pkgadd -d . SUNWopensslr SUNWopenssl-commands SUNWopenssl-include SUNWopenssl-libraries&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;4. Create folder for the SSL certificate files:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /etc/apache2/ssl.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Create folder for the SSL private key:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /etc/apache2/ssl.key&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;6. Run the command bellow to generate a key pair:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/sfw/bin/openssl genrsa -des3 -out /etc/apache2/ssl.key/server.key 1024&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Specify a complex pass phrase for the private key (and document it)&lt;br /&gt;7. Change the permissions on the private key file:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chmod 600 /etc/apache2/ssl.key/server.key&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;8. Run the command bellow to generate the CSR:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/sfw/bin/openssl req -new -newkey rsa:1024 -nodes -keyout /etc/apache2/ssl.key/server.key -out /tmp/apache.csr&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;9. Send the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;&lt;strong&gt;/tmp/apache.csr&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt; to a Certificate Authority server.&lt;br /&gt;10. As soon as you receive the signed public key from the CA server via email, copy all lines starting with “Begin” and ending with “End” (include those two lines), into notepad, and save the file as "&lt;em&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;"&lt;br /&gt;11. Copy the file "&lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;" using SCP into &lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;/etc/apache2/ssl.crt/&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;12. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;” (Note: &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;The file must be PEM (base64) encoded&lt;/span&gt;&lt;/strong&gt;).&lt;br /&gt;13. Copy the file "&lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;" using SCP into &lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;/etc/apache2/ssl.crt/&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;14. Edit using VI the file &lt;strong&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;/etc/apache2/ssl.conf&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;SSLSessionCache dbm:/var/run/apache2/ssl_scache&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLSessionCache dbm:/var/ apache2/ssl_scache&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLMutex file:/var/run/apache2/ssl_mutex&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLMutex file:/var/apache2/ssl_mutex&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerName 127.0.0.1:443&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerName &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;:443&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/var/apache2/htdocs"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLCipherSuite ALL:!ADH:!EXPORT56:-AES256-SHA:-DHE-RSA-AES256-SHA:-DHE-DSS-AES256-SHA:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;SSLCipherSuite ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;15. Remove the section bellow:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory "/var/apache2/cgi-bin"&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/str&gt;&lt;br /&gt;16. Stopping Apache from command line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/apache2/bin/apachectl stop&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Starting Apache from command line:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/apache2/bin/apachectl startssl &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-3732420457906355551?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/3732420457906355551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/01/how-to-implement-ssl-on-apache-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3732420457906355551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/3732420457906355551'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/01/how-to-implement-ssl-on-apache-20.html' title='How to implement SSL on Apache 2.0'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-4949509410380525518</id><published>2010-01-05T16:28:00.005+02:00</published><updated>2010-01-05T16:47:20.374+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Drupal'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Drupal and Apache Web Site Security Checklist</title><content type='html'>This days more and more people are using &lt;a href="http://drupal.org/"&gt;Drupal&lt;/a&gt; to maintain their web sites.&lt;br /&gt;With the popularity comes the security risks (see: &lt;a href="http://drupal.org/security"&gt;http://drupal.org/security&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Here is a very good guide I found on the web, for securing Drupal on Apache web servers:&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Part 1: &lt;/u&gt;&lt;br /&gt;&lt;a href="http://nadeausoftware.com/articles/2009/05/drupal_and_apache_web_site_security_checklist_part_1"&gt;http://nadeausoftware.com/articles/2009/05/drupal_and_apache_web_site_security_checklist_part_1&lt;/a&gt;&lt;br /&gt;&lt;u&gt;Part 2: &lt;/u&gt;&lt;br /&gt;&lt;a href="http://nadeausoftware.com/articles/2009/06/drupal_and_apache_web_site_security_checklist_part_2"&gt;http://nadeausoftware.com/articles/2009/06/drupal_and_apache_web_site_security_checklist_part_2&lt;/a&gt;&lt;br /&gt;&lt;u&gt;Part 3:&lt;br /&gt;&lt;/u&gt;&lt;a href="http://nadeausoftware.com/articles/2009/07/drupal_and_apache_web_site_security_checklist_part_3"&gt;http://nadeausoftware.com/articles/2009/07/drupal_and_apache_web_site_security_checklist_part_3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks to Nadeau software consulting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-4949509410380525518?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/4949509410380525518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2010/01/drupal-and-apache-web-site-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4949509410380525518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4949509410380525518'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2010/01/drupal-and-apache-web-site-security.html' title='Drupal and Apache Web Site Security Checklist'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-7315801969032237617</id><published>2009-12-29T21:28:00.003+02:00</published><updated>2009-12-29T22:17:33.241+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Solaris'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Hardening guide for Apache 2.0 on Solaris 10 platform</title><content type='html'>1. Login to the server using Root account.&lt;br /&gt;2. Create a new account:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;groupadd apache&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;useradd -g apache -d /dev/null -s /bin/false apache &lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;passwd apache&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;passwd -l apache&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;3. Mount Solaris 10 DVD, and move to the packages folder:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cd /cdrom/sol_10_1008_x86/Solaris_10/Product&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;4. Run the command bellow to install Apache2 packages:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;pkgadd -d . SUNWapch2r SUNWapch2u&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;5. Remove Default Content&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm -r /var/apache2/htdocs/&lt;br /&gt;rm -r /var/apache2/cgi-bin/&lt;br /&gt;rm -r /var/apache2/icons/&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;6. Updating Ownership and Permissions on Apache2 folders:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown -R root:root /usr/apache2&lt;br /&gt;chmod -R 770 /usr/apache2/bin&lt;br /&gt;chown -R root:root /etc/apache2&lt;br /&gt;chmod -R go-r /etc/apache2&lt;br /&gt;chmod -R 770 /etc/apache2&lt;br /&gt;chown -R root:root /var/apache2/logs&lt;br /&gt;chmod -R 700 /var/apache2/logs&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;7. Create folder for the web content:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /www&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;8. Updating Ownership and Permissions on the web content folder:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chown -R root /www&lt;br /&gt;chmod -R 775 /www&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;9. Copy the configuration file in-order to edit it:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;10. Edit using VI the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/etc/apache2/httpd.conf&lt;/span&gt;&lt;/em&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LockFile /var/apache2/logs/accept.lock&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LockFile /var/apache2/logs/accept.lock&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;User webservd&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;User apache&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Group webservd&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Group apache&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;PidFile /var/run/apache2/httpd.pid&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;PidFile /var/apache2/logs/httpd.pid&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/var/apache2/htdocs"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DocumentRoot "/www"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerSignature On&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerSignature Off&lt;br /&gt;HostnameLookups Off&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# ServerTokens&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerTokens Prod&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerAdmin you@yourhost.com&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;ServerAdmin&lt;/em&gt; &lt;a href="mailto:webmaster@yourcompany.com"&gt;&lt;em&gt;webmaster@&lt;span style="color:#006600;"&gt;yourcompany&lt;/span&gt;.com&lt;/em&gt;&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ServerName 127.0.0.1&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;ServerName &lt;span style="color:#006600;"&gt;Server_FQDN&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Timeout 300&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Timeout 60&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LogLevel warn&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LogLevel notice&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;IndexOptions FancyIndexing VersionSort&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# IndexOptions FancyIndexing VersionSort&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ReadmeName README.html&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# ReadmeName README.html&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;HeaderName HEADER.html&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# HeaderName HEADER.html&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;AddIcon&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# AddIcon&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DefaultIcon /icons/unknown.gif&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# DefaultIcon /icons/unknown.gif&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Alias /icons/ "/var/apache2/icons/"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# Alias /icons/ "/var/apache2/icons/"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;AliasMatch&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# AliasMatch&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ScriptAlias&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# ScriptAlias&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;LoadModule proxy_ftp_module libexec/mod_proxy_ftp.so&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule proxy_ftp_module libexec/mod_proxy_ftp.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule imap_module libexec/mod_imap.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule imap_module libexec/mod_imap.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule cgi_module libexec/mod_cgi.so&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule cgi_module libexec/mod_cgi.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule suexec_module libexec/mod_suexec.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;# LoadModule suexec_module libexec/mod_suexec.so&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule autoindex_module libexec/mod_autoindex.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule autoindex_module libexec/mod_autoindex.so&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule info_module libexec/mod_info.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule info_module libexec/mod_info.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule status_module libexec/mod_status.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule status_module libexec/mod_status.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule status_module libexec/mod_status.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule status_module libexec/mod_status.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule userdir_module libexec/mod_userdir.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule userdir_module libexec/mod_userdir.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule cern_meta_module modules/mod_cern_meta.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule cern_meta_module modules/mod_cern_meta.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LoadModule dav_module modules/mod_dav.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;# LoadModule dav_module modules/mod_dav.so&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory /&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Options FollowSymLinks&lt;br /&gt;AllowOverride None&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Directory&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory /&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Options None&lt;br /&gt;AllowOverride None&lt;br /&gt;Order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Directory&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory "/var/apache2/htdocs"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory "/www"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;Limitexcept GET POST&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;deny from all&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/Limitexcept&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Options Indexes FollowSymLinks&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;Options -FollowSymLinks -Includes -Indexes -MultiViews&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;11. Add the following sections to the end of the &lt;em&gt;&lt;span style="color:#3333ff;"&gt;httpd.conf&lt;/span&gt;&lt;/em&gt; file:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;LimitRequestBody 10000&lt;br /&gt;LimitRequestFields 40&lt;br /&gt;LimitRequestFieldSize 100&lt;br /&gt;LimitRequestLine 500&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;12. Remove the sections bellow from the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;httpd.conf&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;str&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Directory "/usr/apache2/manual"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;Directory "/var/apache2/cgi-bin"&lt;str&gt;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;13. Edit using VI the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/usr/apache2/include/ap_release.h&lt;/span&gt;&lt;/em&gt; and change the following strings:&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEVENDOR "Apache Software Foundation"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEVENDOR "Restricted server"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEPRODUCT "Apache"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#define AP_SERVER_BASEPRODUCT "Secure Web Server"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;14. Starting Apache from command line:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;/usr/apache2/bin/apachectl start&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;15. Run the command bellow to start the Apache service at server start-up:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;svcadm enable apache2 &lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-7315801969032237617?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/7315801969032237617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-apache-20-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/7315801969032237617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/7315801969032237617'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-apache-20-on.html' title='Hardening guide for Apache 2.0 on Solaris 10 platform'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-826227969469963494</id><published>2009-12-25T00:19:00.006+02:00</published><updated>2010-01-07T18:10:22.785+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certificate Authority'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>How to implement SSL on Tomcat 5.5</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The guide bellow is based on the previous guide &lt;a href="http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-tomcat-55-on.html"&gt;Hardening guide for Tomcat 5.5 on Solaris 10 platform&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;SSL implementation phase&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Login to the server using Root account.&lt;br /&gt;2. Create folder for the SSL certificate files:&lt;br /&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;mkdir -p /var/apache/tomcat55/conf/ssl.crt&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;3. Create folder for the SSL private key:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;mkdir -p /var/apache/tomcat55/conf/ssl.key&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;4. Change ownership of all server files to the tomcat user:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;chown -R tomcat:tomcat /var/apache/tomcat55/conf/*&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;5. Run the command bellow to generate a key store:&lt;br /&gt;&lt;u&gt;For 32bit operating system:&lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/keytool -genkey -keyalg "RSA" -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt; -validity 730&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;u&gt;For x64 operating system&lt;/u&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/amd64/keytool -genkey -keyalg "RSA" -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt; -validity 730&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;7. Run the command bellow to generate a CSR (certificate request):&lt;br /&gt;&lt;u&gt;For 32bit operating system:&lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/keytool -certreq -keyalg "RSA" -file /tmp/tomcat.csr -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;u&gt;For x64 operating system:&lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/amd64/keytool -certreq -keyalg "RSA" -file /tmp/tomcat.csr -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;/span&gt;&lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;8. Send the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/tmp/tomcat.csr&lt;/span&gt;&lt;/em&gt; to a Certificate Authority server.&lt;br /&gt;9. As soon as you receive the signed public key from the Certificate Authority server (usually via email), copy all lines starting with “Begin” and ending with “End” (include those two lines), into notepad, and save the file as "&lt;em&gt;&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;&lt;/em&gt;"&lt;br /&gt;10. Copy the file "&lt;em&gt;&lt;span style="color:#3333ff;"&gt;server.crt&lt;/span&gt;&lt;/em&gt;" using SCP into &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/var/apache/tomcat55/conf/ssl.crt&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;11. Follow the link on the email from the CA server, to create the Root CA chain, and save it as “&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;” (Note: &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;The file must be PEM (base64) encoded&lt;/span&gt;&lt;/strong&gt;).&lt;br /&gt;12. Copy the file "&lt;em&gt;&lt;span style="color:#3333ff;"&gt;ca-bundle.crt&lt;/span&gt;&lt;/em&gt;" using SCP into &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/var/apache/tomcat55/conf/ssl.crt&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;13. Run the command bellow to import the trusted root CA public certificate:&lt;br /&gt;&lt;u&gt;For 32bit operating system: &lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/keytool -import -keystore /usr/jdk/jdk1.6.0_15/jre/lib/security/cacerts -storepass changeit -trustcacerts -file /var/apache/tomcat55/conf/ssl.crt/ca-bundle.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;For x64 operating system:&lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/amd64/keytool -import -keystore /usr/jdk/jdk1.6.0_15/jre/lib/security/cacerts -storepass changeit -trustcacerts -file /var/apache/tomcat55/conf/ssl.crt/ca-bundle.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;br /&gt;14. Run the command bellow to import the signed public key into the key store:&lt;br /&gt;&lt;u&gt;For 32bit operating system: &lt;/u&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/keytool -import -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt; -trustcacerts -file /var/apache/tomcat55/conf/ssl.crt/server.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;u&gt;For x64 operating system:&lt;br /&gt;&lt;/u&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;/usr/jdk/jdk1.6.0_15/bin/amd64/keytool -import -keystore /var/apache/tomcat55/conf/ssl.key/server.key -storepass &lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt; -trustcacerts -file /var/apache/tomcat55/conf/ssl.crt/server.crt&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;Note: The command above should be written as one line.&lt;br /&gt;&lt;br /&gt;15. Stop the Tomcat service:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/tomcat stop&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;16. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/var/apache/tomcat55/conf/server.xml&lt;/span&gt;&lt;/em&gt; and add the section bellow:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;Connector port="8443" maxHttpHeaderSize="8192"&lt;br /&gt;maxThreads="150" minSpareThreads="25" maxSpareThreads="75"&lt;br /&gt;enableLookups="false" disableUploadTimeout="true"&lt;br /&gt;acceptCount="100" scheme="https" secure="true"&lt;br /&gt;clientAuth="false" sslProtocol="SSLv3"&lt;br /&gt;keystoreFile="/var/apache/tomcat55/conf/ssl.key/server.key"&lt;br /&gt;keystorePass="&lt;span style="color:#006600;"&gt;ComplexPassword&lt;/span&gt;"&lt;br /&gt;truststoreFile="/usr/jdk/jdk1.6.0_15/jre/lib/security/cacerts"&lt;br /&gt;truststorePass="changeit"&lt;br /&gt;ciphers="ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP"&lt;br /&gt;tcpNoDelay="true" /&lt;str&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;17. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3333ff;"&gt;/var/apache/tomcat55/conf/web.xml&lt;/span&gt;&lt;/em&gt; and add the following section, inside the &lt;str&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;&lt;&lt;/str&gt;security-constraint&lt;str&gt;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/str&gt; tag:&lt;br /&gt;&lt;str&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;user-data-constraint&lt;str&gt;&gt;&lt;str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;description&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;Constrain the user data transport for the whole application&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/description&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;transport-guarantee&lt;str&gt;&gt;&lt;/str&gt;CONFIDENTIAL&lt;str&gt;&lt;&lt;str&gt;/transport-guarantee&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/user-data-constraint&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;18. Start the Tomcat service:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;/etc/init.d/tomcat start -security&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-826227969469963494?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/826227969469963494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/how-to-implement-ssl-on-tomcat-55.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/826227969469963494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/826227969469963494'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/how-to-implement-ssl-on-tomcat-55.html' title='How to implement SSL on Tomcat 5.5'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-9089913707593723719</id><published>2009-12-24T21:55:00.008+02:00</published><updated>2009-12-25T00:02:19.562+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='Solaris'/><title type='text'>Hardening guide for Tomcat 5.5 on Solaris 10 platform</title><content type='html'>&lt;strong&gt;&lt;u&gt;Pre-installation notes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;This guide instruct how to install SUN JDK 1.6 build 15 and Tomcat 5.5 on SUN Solaris 10.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Installation phase&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;1. Login to the server using Root account.&lt;br /&gt;2. Make sure the folder &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/jdk&lt;/span&gt;&lt;/em&gt; exists:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ls /ad /usr/jdk&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;3. If the folder &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/jdk&lt;/span&gt;&lt;/em&gt; doesn’t exists, manually create it:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;mkdir /usr/jdk&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;4. Copy JDK 1.6 scripts (32bit and x64) into /usr/jdk&lt;br /&gt;5. Move to &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/jdk&lt;/span&gt;&lt;/em&gt; folder&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cd /usr/jdk&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;6. Change the permissions on the JDK 1.6 (32bit) script:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod +x jdk-6u15-solaris-i586.sh&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;7. Run the command bellow to install JDK 1.6 (32bit):&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;./jdk-6u15-solaris-i586.sh&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;8. Change the permissions on the JDK 1.6 (x64) script:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod +x jdk-6u15-solaris-x64.sh&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;9. Run the command bellow to install JDK 1.6 (x64):&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;./jdk-6u15-solaris-x64.sh&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;10. Delete the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/jdk/jdk-6u15-solaris-i586.sh&lt;/span&gt;&lt;/em&gt; and samples:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm /usr/jdk/jdk-6u15-solaris-i586.sh&lt;br /&gt;rm /usr/jdk/jdk-6u15-solaris-x64.sh&lt;br /&gt;rm /usr/jdk/jdk1.6.0_15/src.zip&lt;br /&gt;rm -r /usr/jdk/jdk1.6.0_15/demo&lt;br /&gt;rm -r /usr/jdk/jdk1.6.0_15/sample&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;11. Remove the link for the Java&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm /usr/bin/java&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;12. Create new link for the Java (for x64 servers):&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ln -s /usr/jdk/jdk1.6.0_15/bin/amd64/java /usr/bin&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;13. Reload the links into memory:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rehash&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;14. Mount Solaris 10 DVD, and move to the packages folder:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;cd /cdrom/sol_10_1008_x86/Solaris_10/Product&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;15. Run the command bellow to install Tomcat packages:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;pkgadd -d . SUNWtcatr SUNWtcatu&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;16. Remove the following default folders:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm -r /usr/apache/tomcat55/webapps/tomcat-docs&lt;br /&gt;rm /var/apache/tomcat55/webapps/tomcat-docs&lt;br /&gt;rm /var/apache/tomcat55/webapps/ROOT/RELEASE-NOTES.txt&lt;br /&gt;rm -r /var/apache/tomcat55/webapps/jsp-examples&lt;br /&gt;rm -r /var/apache/tomcat55/webapps/servlets-examples&lt;br /&gt;rm -r /var/apache/tomcat55/webapps/webdav&lt;br /&gt;rm -r /var/apache/tomcat55/webapps/balancer&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;17. Copy the &lt;em&gt;&lt;span style="color:#3366ff;"&gt;server.xml&lt;/span&gt;&lt;/em&gt; configuration file:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;cp /var/apache/tomcat55/conf/server.xml-example /var/apache/tomcat55/conf/server.xml&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;Note: The above command should be written as one line.&lt;br /&gt;18. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/var/apache/tomcat55/conf/server.xml&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;• Uncomment the section bellow:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;org.apache.catalina.valves.AccessLogValve&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• Replace the non-SSL HTTP/1.1 Connector:&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;str&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;connector port="8080" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" connectiontimeout="20000" disableuploadtimeout="true" &lt;str&gt;/&lt;/str&gt;&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;str&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;connector port="8080" debug="off" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" connectiontimeout="20000" disableuploadtimeout="true" tcpnodelay="true" &lt;str&gt;/&lt;/str&gt;&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;19. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/var/apache/tomcat55/conf/web.xml&lt;/span&gt;&lt;/em&gt; and add the following sections, before the end of the “web-app” tag:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;str&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;!-- Define a Security Constraint on this Application --&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;security-constraint&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;web-resource-collection&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;web-resource-name&gt;HTMLManger and Manager command&lt;str&gt;&lt;&lt;/str&gt;/web-resource-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/jmxproxy/*&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/html/*&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/list&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/sessions&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/start&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/stop&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/install&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/remove&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/deploy&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/undeploy&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/reload&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/save&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/serverinfo&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/status/*&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/roles&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;url-pattern&gt;/resources&lt;str&gt;&lt;&lt;/str&gt;/url-pattern&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/web-resource-collection&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;auth-constraint&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;role-name&gt;manager&lt;str&gt;&lt;&lt;/str&gt;/ROLE-NAME&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/auth-constraint&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/security-constraint&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;login-config&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;auth-method&lt;str&gt;&gt;&lt;/str&gt;BASIC&lt;str&gt;&lt;&lt;/str&gt;/auth-method&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;realm-name&lt;str&gt;&gt;&lt;/str&gt;Tomcat Manager Application&lt;str&gt;&lt;&lt;/str&gt;/realm-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/login-config&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;security-role&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;description&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;The role that is required to log in to the Manager Application&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/description&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;role-name&lt;str&gt;&gt;&lt;/str&gt;manager&lt;str&gt;&lt;&lt;/str&gt;/role-name&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;/security-role&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style="color:#cc0000;"&gt;&lt;br /&gt;&lt;/span&gt;20. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/var/apache/tomcat55/conf/tomcat-users.xml&lt;/span&gt;&lt;/em&gt; and add the following lines:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;str&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;role rolename="admin"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;role rolename="manager"&lt;str&gt;&gt;&lt;/str&gt;&lt;br /&gt;&lt;str&gt;&lt;&lt;/str&gt;user roles="admin,manager" password="adminpass" username="admin"&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style="color:#cc0000;"&gt;&lt;br /&gt;&lt;/span&gt;Note: Specify complex password for the admin account (and document it).&lt;br /&gt;21. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/var/apache/tomcat55/conf/Catalina/localhost/admin.xml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;• Uncomment the section bellow:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;org.apache.catalina.valves.RemoteAddrValve&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;• Replace the data of the value bellow:&lt;br /&gt;From:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;allow="127.0.0.1"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;allow="172.16.*.*"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;Note: You may replace &lt;em&gt;&lt;span style="color:#3366ff;"&gt;“172.16.*.*”&lt;/span&gt;&lt;/em&gt; with internal network segment.&lt;br /&gt;Example: allow="128.117.140.62, 128.117.140.63, 128.117.140.99"&lt;br /&gt;22. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/var/apache/tomcat55/conf/Catalina/localhost/manager.xml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;• Inside the “Context” section, add the following line:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;str&gt;&lt;span style="color:#cc0000;"&gt;&lt;&lt;/str&gt;valve allow="172.16.*.*" classname="org.apache.catalina.valves.RemoteAddrValve"&lt;str&gt;&gt;&lt;/str&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style="color:#cc0000;"&gt;&lt;br /&gt;&lt;/span&gt;Note: You may replace &lt;em&gt;&lt;span style="color:#3366ff;"&gt;“172.16.*.*”&lt;/span&gt;&lt;/em&gt; with internal network segment.&lt;br /&gt;Example: allow="128.117.140.62, 128.117.140.63, 128.117.140.99"&lt;br /&gt;23. Move to the folder &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/apache/tomcat55/server/lib&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cd /usr/apache/tomcat55/server/lib&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;24. Extract the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;catalina.jar&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;jar xf catalina.jar org/apache/catalina/util/ServerInfo.properties&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;25. Edit using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/apache/tomcat55/server/lib/org/apache/catalina/util/ServerInfo.properties&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;• Replace the string bellow from:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;server.infoerver.info=Apache Tomcat/5.5.26&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;server.infoerver.info=Secure Web server&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;• Replace the string bellow from:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;server.number=5.5.26.0&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;To:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;server.number=1.0.0.0&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;26. Move to the folder &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/usr/apache/tomcat55/server/lib&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;cd /usr/apache/tomcat55/server/lib&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;27. Repackage the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;catalina.jar&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;jar uf catalina.jar org/apache/catalina/util/ServerInfo.properties&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;28. Remove the folder bellow:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rm -r /usr/apache/tomcat55/server/lib/org&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;29. Create a user account for the Tomcat service:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;mkdir /home/tomcat&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;groupadd tomcat&lt;br /&gt;useradd -s /bin/sh -d /home/tomcat -g tomcat tomcat&lt;br /&gt;chown tomcat:tomcat /home/tomcat/&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;passwd tomcat&lt;br /&gt;passwd -l tomcat&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;30. Create using VI, the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/etc/init.d/tomcat&lt;/span&gt;&lt;/em&gt; with the following content:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Startup script for Tomcat&lt;br /&gt;#&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;echo -n "Starting Tomcat"&lt;br /&gt;JAVA_HOME="/usr/jdk/jdk1.6.0_15" ; export JAVA_HOME &amp;amp;&amp;amp; su - tomcat -c /usr/apache/tomcat55/bin/startup.sh -security&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;echo -n "Stopping Tomcat"&lt;br /&gt;JAVA_HOME="/usr/jdk/jdk1.6.0_15" ; export JAVA_HOME &amp;amp;&amp;amp; su - tomcat -c /usr/apache/tomcat55/bin/shutdown.sh&lt;br /&gt;;;&lt;br /&gt;restart)&lt;br /&gt;$0 stop&lt;br /&gt;$0 start&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo "Usage: $0 {startstoprestart}"&lt;br /&gt;exit 1&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;31. Change the permissions on the file &lt;em&gt;&lt;span style="color:#3366ff;"&gt;/etc/init.d/tomcat&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;chmod u+x /etc/init.d/tomcat&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;32. Create soft link/symoblic links for system level startup&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;ln -s /etc/init.d/tomcat /etc/rc3.d/K01tomcat&lt;br /&gt;ln -s /etc/init.d/tomcat /etc/rc3.d/S99tomcat&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;33. Reload the links into memory:&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;rehash&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;34. Change ownership of all server files to the tomcat user:&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;strong&gt;chown -R tomcat:tomcat /var/apache/tomcat55/*&lt;br /&gt;chown -R tomcat:tomcat /usr/apache/tomcat55/*&lt;/strong&gt;&lt;/em&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-9089913707593723719?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/9089913707593723719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-tomcat-55-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/9089913707593723719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/9089913707593723719'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/hardening-guide-for-tomcat-55-on.html' title='Hardening guide for Tomcat 5.5 on Solaris 10 platform'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-4141233730738306076</id><published>2009-12-06T12:47:00.002+02:00</published><updated>2009-12-06T12:48:51.777+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='Physical security'/><title type='text'>Protecting your backup</title><content type='html'>One of the things many companies fail to put enough attention is proper protection to their backups.&lt;br /&gt;I recently read an article about large American bank that sent a notification to its customers of losing a backup-tape, with customer's personal information.&lt;br /&gt;I guess the only reason the bank reveal the information about the security breach is because he had to do so, under a federal law - just think about how many companies keep this sort of information to themselves in-order to avoid lawsuits.&lt;br /&gt;&lt;br /&gt;Almost every company perform backup of its data. It can be using commercial software, file copy to a remote site, backup to tape, and now it is becoming more and more common to perform backup to disk, into a large storage device.&lt;br /&gt;&lt;br /&gt;Usually, when performing backup to tape, most companies use to move the tapes into offsite storage, such as remote site.&lt;br /&gt;While moving the backup to remote site might be considered as a good security practice against site disaster, there are 2 important things to think about.&lt;br /&gt;The first thing is physical protection during the move, and while storing them on a safe at the remote site.&lt;br /&gt;In this case I strongly recommend document the process - document the labels and dates of the tapes, and maybe even have the person transporting the tapes sign a form, so you'll have more confidence that the tapes were actually being transported to their destination.&lt;br /&gt;&lt;br /&gt;Another thing you should consider is encryption to the data itself.&lt;br /&gt;You don't want to be in a situation where somebody steals a suitcase full of backup tapes, where all your data is in clear text.&lt;br /&gt;I guess most commercial products allow you to encrypt your backups, but it raises a question about maintaining the encryption.&lt;br /&gt;If you encrypt your backups using the same password or passphrase year after year, and some ex-employee knows the password, it can harm the whole idea behind encryption.&lt;br /&gt;On the other hand, if you change the password from time to time, you need to manage a list of old passwords against list of dates of backup-tape labels, which might become a headache since it is another thing to maintain.&lt;br /&gt;&lt;br /&gt;Today more and more companies are moving to backup-to-disk, because the cost of hard disks is very low, and it's a fast media.&lt;br /&gt;While performing backup to a remote site, you need to consider moving the data over secure or encrypted VPN lines in-order to avoid someone intercepting the data and stealing sensitive files.&lt;br /&gt;Another good practice is to store the data on an encrypted file system. This way you don't need to worry about some will be able to review your files, but you will have the overhead of maintaining the encryption key, and the copy to the encrypted file system might become a little bit slower on slow machines or slow storage devices.&lt;br /&gt;&lt;br /&gt;Remember, keeping your backup safe and secure, enables you to overcome site disaster while protecting from data breach and law suites.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-4141233730738306076?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/4141233730738306076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/protecting-your-backup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4141233730738306076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4141233730738306076'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/12/protecting-your-backup.html' title='Protecting your backup'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-4094255641690734123</id><published>2009-11-25T22:16:00.001+02:00</published><updated>2009-11-25T22:18:11.227+02:00</updated><title type='text'>Software installation</title><content type='html'>One of the most important rules of server hardening is limiting the exposure surface.&lt;br /&gt;&lt;br /&gt;I guess it's ok to install a product (from operating system to office applications) on a developer or users desktop using the default installation method (in many cases it means full product installation, since most of us don't bother to read what it means and just click next to continue).&lt;br /&gt;&lt;br /&gt;However, on a production environment, any additional component means additional exposure surface, additional disk space and additional CPU and memory usage, which are very critical on production environments.&lt;br /&gt;It is time to read the product documentation, and understand what does each and every component is doing on the system.&lt;br /&gt;Customize or minimal installation is the best practice on this case.&lt;br /&gt;We don't need any sample pages, product documentation or help files, or even demo scripts/web application/databases.&lt;br /&gt;&lt;br /&gt;Another best practice is to limit anonymous, guest or any other non-authenticated access to sensitive areas of our application, such as administrative sections in web applications.&lt;br /&gt;The best practice is to configure authentication for administrative sections, using built-in application capabilities such as strong passwords, dedicated accounts with privileges to certain parts of the application, certificate authentication or if nothing else is possible, using file system permissions according to the hosted operating system.&lt;br /&gt;&lt;br /&gt;Another crucial part, for applications that start their own service to listen to outside requests, is to use the least-privileges security model, which means, non-administrative/root account to load the service, with limitation for running the specific application and least amount of privileges to the operating system.&lt;br /&gt;The reason for that is if I am using an application that depends on JAVA for example, and there is a flaw in the JAVA runtime that allows it to break the JAVA security mechanism, your server might be vulnerable as well.&lt;br /&gt;&lt;br /&gt;Another point to think about is software upgrades. You may be doing a good job during application installation and configuration, but the next product upgrade or security hotfix, might bring back sample applications or change the file system privileges.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-4094255641690734123?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/4094255641690734123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/software-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4094255641690734123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/4094255641690734123'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/software-installation.html' title='Software installation'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-8983197136508448627</id><published>2009-11-24T22:25:00.003+02:00</published><updated>2009-11-24T22:30:32.817+02:00</updated><title type='text'>Information leakage</title><content type='html'>Information is all around us. We don't even realize how much information we share with everyone, and I have two examples to think about.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business cards&lt;/strong&gt;&lt;br /&gt;We use to give away our business cards to colleagues and potential customers without realizing how much people can learn about us.&lt;br /&gt;We put our mobile phone number, so now people can reach us 24/7.&lt;br /&gt;We put our phone number, something such as 917-999-6666 and now the potential attacker knows that most of our company phone extensions (and maybe our fax and modem lines) begins with 917-999xxxx and that our extension is probably 6666 (wonder whom will I reach trying 6665 or 6667...)&lt;br /&gt;We put our fax number, which can be used by spammers and advertisers we once met at a commercial fair.&lt;br /&gt;We put our email address, something such as johnd@somecompany.com (in most cases, our username to the internal company assets will be something such as Johnd)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Voicemail / out-of-the-office message&lt;/strong&gt;&lt;br /&gt;We tend to leave a message on our voice mail or on our company mailbox, information such as:&lt;br /&gt;"&lt;em&gt;Hi, you've reached John Doe, from the sales department. I will be out of the office between July 28th and August 2nd. In case of emergency, you may contact Linda Smith, at 5435742, ext. 2&lt;/em&gt;"&lt;br /&gt;If I was a potential hacker, I now know that John will be out of the office, I know his department name, I know the dates he will not be available, I know who replaces him while he is out of the office, and I know how to reach her.&lt;br /&gt;Instead of giving away all this information, why not use something polite and simple, such as:&lt;br /&gt;"Hi, I will be out of the office. You may send me emails and I will get back to you as soon as I will return to the office."&lt;br /&gt;&lt;br /&gt;Think about it, the next time you share information, and don't forget that everyone on the internet can see it, the next time you share photos from your wonderful vacation on facebook, or what a great day you had, on twitter, just after you told your boss, you are not coming to the office today since you are not feeling well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-8983197136508448627?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/8983197136508448627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/information-leakage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8983197136508448627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/8983197136508448627'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/information-leakage.html' title='Information leakage'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1568325478662481719.post-5242873164506640502</id><published>2009-11-24T21:23:00.000+02:00</published><updated>2009-11-24T21:30:45.318+02:00</updated><title type='text'>Introduction</title><content type='html'>Andy Grove, the former Intel CEO used to say "Only the paranoid survive".&lt;br /&gt;&lt;br /&gt;As an information security with more than 7 years in the field, I can tell you that even though I don't consider myself paranoid, people expect me to think out of the box and the only way I see it, to see the world from the eyes of the potential attacker, is to be paranoid.&lt;br /&gt;&lt;br /&gt;I have opened this blog, in-order to share with you, my point of view and my experience in the security and technology field, looking at the world in a holistic and non-vendor oriented point of view as much as possible.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1568325478662481719-5242873164506640502?l=eyalestrin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eyalestrin.blogspot.com/feeds/5242873164506640502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5242873164506640502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1568325478662481719/posts/default/5242873164506640502'/><link rel='alternate' type='text/html' href='http://eyalestrin.blogspot.com/2009/11/introduction.html' title='Introduction'/><author><name>Eyal Estrin</name><uri>http://www.blogger.com/profile/10788355589497373615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_gyv3RHvi9PM/SwwdL9NvgPI/AAAAAAAABng/xyi4flsq8sM/S220/untitled.bmp'/></author><thr:total>0</thr:total></entry></feed>
