Apache with SSL building from source Apache with ssl support should be the basic platform for providing web services... There are several different implementations.

Slides:



Advertisements
Similar presentations
Encrypting Wireless Data with VPN Techniques
Advertisements

Secure Socket Layer.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
VOYAGER: Yet Another Secure Web Browser to Demonstrate Secure Socket Layer Working and Implementation By : Shrinivas G. Deshpande Advisor: Dr. Chung E.
Module 5: TLS and SSL 1. Overview Transport Layer Security Overview Secure Socket Layer Overview SSL Termination SSL in the Hosted Environment Load Balanced.
BASIC CRYPTOGRAPHY CONCEPT. Secure Socket Layer (SSL)  SSL was first used by Netscape.  To ensure security of data sent through HTTP, LDAP or POP3.
Apache Web Server Quick and Dirty Steve Gibbard for SANOG 16 (Originally by Joel Jaeggli for AfNOG 2007) ‏
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
TLS/SSL Review. Transport Layer Security A 30-second history Secure Sockets Layer was developed by Netscape in 1994 as a protocol which permitted persistent.
SquirrelMail for Webmail AfNOG 2012 Scalable Internet Services (SS-E) Presented by Michuki Mwangi Serrekunda, Gambia (Original Materials by Joelja)
APACHE SERVER By Innovationframes.com »
Chapter 22 Web Hosting and Internet Servers Xuanxuan Su.
SquirrelMail for Webmail AfNOG 2013 Scalable Internet Services (SS-E) Presented by Michuki Mwangi Lusaka, Zambia (Original Materials by Joelja)
Apache Security with SSL Using FreeBSD SANOG VI IP Services Workshop July 18, 2005 Hervey Allen Network Startup Resource Center.
Linux Operations and Administration
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
Component 9 – Networking and Health Information Exchange Unit 1-1 ISO Open Systems Interconnection (OSI) This material was developed by Duke University,
1 Apache and Virtual Sites and SSL Dorcas Muthoni.
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
Security Protocols and E-commerce University of Palestine Eng. Wisam Zaqoot April 2010 ITSS 4201 Internet Insurance and Information Hiding.
Network Security: Lab#3 Transport-Level Security Tools J. H. Wang May 12, 2011.
Tunneling and Securing TCP Services Nathan Green.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
Apache Web Server Quick and Dirty for AfNOG 2015 (Originally by Joel Jaeggli for AfNOG 2007) ‏
Apache Web Server Quick and Dirty Evelyn NAMARA for AfNOG 2014 (Originally by Joel Jaeggli for AfNOG 2007) ‏
Apache Web Server Quick and Dirty Ayitey Bulley for AfNOG 2011 (Originally by Joel Jaeggli for AfNOG 2007) ‏
Apache Web Server Quick and Dirty Kevin G. Chege for AfNOG 2013 (Originally by Joel Jaeggli for AfNOG 2007) ‏
LinuxChix Apache. Serving Webpages The layer 7 protocol (HTTP) is what our browsers talk to get us the websites we can't seem to live without. HTTP is.
Apache with SSL and php Apache with ssl support should be the basic platform for providing web services... There are several different implementations.
Advanced Sendmail Part 1
APACHE Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for Unix servers, the Apache Web server.
SSL: Secure Socket Layer By: Mike Weissert. Overview Definition History & Background SSL Assurances SSL Session Problems Attacks & Defenses.
Network security Presentation AFZAAL AHMAD ABDUL RAZAQ AHMAD SHAKIR MUHAMMD ADNAN WEB SECURITY, THREADS & SSL.
Web and Proxy Server.
The Secure Sockets Layer (SSL) Protocol
TOPIC: HTTPS (Security protocol)
Setting and Upload Products
Web Applications Security Cryptography 1
Apache with SSL building from source
SFS-HTTP: Securing the Web with Self-Certifying URLs
How HTTP Works Made by Manish Kushwaha.
Apache web server Quick overview.
Working With TFTP.
Apache Security with SSL Using FreeBSD
Secure Sockets Layer (SSL)
UNIT.4 IP Security.
Unix System Administration
(Originally by Joel Jaeggli for AfNOG 2007)‏
Visit for more Learning Resources
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
Understanding the OSI Reference Model
How to Check if a site's connection is secure ?
Working at a Small-to-Medium Business or ISP – Chapter 7
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
Using SSL – Secure Socket Layer
Working at a Small-to-Medium Business or ISP – Chapter 7
Topic 5: Communication and the Internet
Working at a Small-to-Medium Business or ISP – Chapter 7
Public-key Infrastructure
SSL (Secure Socket Layer)
The Secure Sockets Layer (SSL) Protocol
A Programmer’s Guide to Secure Connections
Transport Layer Security (TLS)
Public-key Infrastructure
APACHE WEB SERVER.
Unit 8 Network Security.
Chapter 7 Network Applications
Cryptography and Network Security
Presentation transcript:

Apache with SSL building from source Apache with ssl support should be the basic platform for providing web services... There are several different implementations to choose from, some commercial (stronghold) and some open source (apache+ssl, apache+modssl). We've chosen to work with apache+modssl. You can use the FreeBSD ports copy of apache, or build your own. Much of how you install and configure Apache will depend on how the server will be used. Will the server host lots of user websites, or just a few web-sites? Is the machine to be a dedicated webserver ? Is the webserver an interface to other applications?

Apache install exercise # cd /usr/local # fetch ftp://noc.ws.afnog.org/pub/FreeBSD/ports/distfiles/httpd tar.gzftp://noc.ws.afnog.org/pub/FreeBSD/ports/distfiles/httpd tar.gz # tar xvzf httpd tar.gz # cd httpd #./configure --enable-ssl --with-ssl=/usr/src/crypto/openssl/ssl/ # make #make install

Certificate management We shall now setup a certificate for our server in order to begin serving https requests. For this purpose we shall use the CA.sh or CA.pl scripts that come with openssl. First we need to create our own Certificate Authority This we do by running 1. cd /usr/src/crypto/openssl/apps 2. chmod 0755 CA.sh rm -rf demoCA 3../CA.sh -newca You will be prompted for a pass phrase which will be used to protect your new certificate for the authority. Once this is done,We will then generate a signing request which we will then sign with our new Certificate Authority../CA.sh -newreq to generate a new request for signing and CA.sh -sign in order to sign the request. please use afnog06 for a passphrase in all instances of this exercise. The next step is then to setup apache to use our new certificate.

Setting up apache to use your certificate This is done by editing /usr/local/apache2/conf/extra/httpd-ssl.conf and changing SSLCertificateFile SSLCertificateKeyFile to point to our new certificate and its key. In normal production environments, we would normally only generate a signing requestthat would then be signed by a recognised certificate authority. 1. mkdir /usr/local/apache2/conf/ssl.key 2. cp newcert.pem /usr/local/apache2/conf/ssl.key/server.pem 3. cp newreq.pem /usr/local/apache2/conf/ssl.key/key.pem 4. vi /usr/local/apache2/conf/extra/httpd-ssl.conf Change the lines mentioned above to: SSLCertificateFile /usr/local/apache2/conf/ssl.key/server.pem SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/key.pem Now we need to enable our SSL configuration: vi /usr/local/apache2/conf/httpd.conf Uncomment the line that looks like Include conf/extra/httpd-ssl.conf

Starting up and testing apache We now need to test whether our apache configuration is working: We start apache using: /usr/local/apache2/bin/apachectl start We then check that it is running by using: ps -auxw |grep httpd You should see output similar to root ?? Ss 11:15AM 0:01.40 /usr/local/apache2/bin/httpd -k start daemon ?? I 11:15AM 0:00.01 /usr/local/apache2/bin/httpd -k start daemon ?? I 11:15AM 0:00.01 /usr/local/apache2/bin/httpd -k start daemon ?? I 11:15AM 0:00.01 /usr/local/apache2/bin/httpd -k start

We can also check that there is actually a listening process on both port 80 for normal http and 443 for ssl by running netstat -an |grep LIST tcp4 0 0 *.110 *.* LISTEN tcp4 0 0 *.25 *.* LISTEN tcp4 0 0 *.21 *.* LISTEN tcp4 0 0 *.5999 *.* LISTEN tcp4 0 0 *.80 *.* LISTEN tcp4 0 0 *.443 *.* LISTEN tcp4 0 0 *.22 *.* LISTEN

Testing our webserver You can now check your apache webserver using both a web browser and the openssl s_client inst]$ openssl OpenSSL> s_client -host localhost -port 443 This will output what happens when you make an ssl connection and show us details of the certificates installed. We can also do this easier by starting up X windows and then connecting to our local webserver using

Removing the pass phrase from the certificate The RSA private key inside your server.key file is stored in encrypted format for security reasons. The pass-phrase is needed to be able to read and parse this file thus everytime you want to start the apache server you would need to enter your passphrase. This is not useful if you want to remotely reboot your server or if you're likely to get power issues so once you've secured your server, you can then remove the passphrase so you can automatically start apache at boot. 1. cd /usr/local/apache2/conf/ssl.key 2. cp key.pem key.pem.orig 3. openssl rsa -in key.pem.orig -out key.pem It is also advisable to change the permissions on the key to make it readable only by root since it is no longer encrypted. You should now be able to restart apache without having to enter a pass phrase.

Virtual Hosts The term virtual hosts refers to the practice of maintaining more than one web server on the same machine as differentiated by their apparent host name. For example as an ISP you may want to host 2 different web hosting clients and on the same apache server. Apache makes doing this very easy using name based virtual hosts.

Configuring virtual hosts To configure our apache server to use virtual hosts we must first of all edit our httpd.conf and uncomment the line that reads: Include conf/extra/httpd-vhosts.conf We then proceed to edit our virtual host configuration file in /usr/local/apache2/conf/extra/httpd-vhosts.conf

vhost configuration The Most important directives to consider when configuring your apache server for virtual hosting are the following: NameVirtualHost ServerName ServerAlias DocumentRoot VirtualHost

Name based virtual hosts with apache will not work with SSL. You need to use ip based virtual host because name based hosts are implemented at the application layer while TLS is at the transport layer. Documentation can be found at

How SSL works

Handshake Sequence Protocol The handshake sequence uses three protocols: * The SSL Handshake Protocol for performing the client and server SSL session establishment. * The SSL Change Cipher Spec Protocol for actually establishing agreement on the Cipher Suite for the session. * The SSL Alert Protocol for conveying SSL error messages between client and server. These protocols, as well as application protocol data, are encapsulated in the SSL Record Protocol. An encapsulated protocol is transferred as data by the lower layer protocol, which does not examine the data. The encapsulated protocol has no knowledge of the underlying protocol. The encapsulation of SSL control protocols by the record protocol means that if an active session is renegotiated the control protocols will be transmitted securely. If there were no session before, then the Null cipher suite is used, which means there is no encryption and messages have no integrity digests until the session has been established.

The SSL Record Protocol is used to transfer application and SSL Control data between the client and server, possibly fragmenting this data into smaller units, or combining multiple higher level protocol data messages into single units. It may compress, attach digest signatures, and encrypt these units before transmitting them using the underlying reliable transport protocol. One common use of SSL is to secure Web HTTP communication between a browser and a webserver. We also commonly use it to secure other applications like pop3 and imap.