Performance & Security Satish C Ayappan (Drupal Architect- Capgemini)

Slides:



Advertisements
Similar presentations
Web Security Never, ever, trust user inputs Supankar.
Advertisements

Closing the Gap: Analyzing the Limitations of Web Application Vulnerability Scanners David Shelly Randy Marchany Joseph Tront Virginia Polytechnic Institute.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Getting Set-up with Hosting and WordPress Gregory Young Alternative Hosting
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Turners SharePoint Web Site How we did it. 2 Page Anatomy Custom Search Web Part Custom Search Web Part Data Form Web Parts Content Query Web Part HTML.
Analysis and Performance Information Systems 337 Prof. Harry Plantinga.
Hypertext Transfer Protocol Information Systems 337 Prof. Harry Plantinga.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Securing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Justin Klein Keane Drupal Training Session 1 Introduction to Drupal.
Nikto LUCA ALEXANDRA ADELA. Nikto  Web server assessment tool  Written by Chris Solo and David Lodge  Released on December 27, 2001  Stable release:
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Linux Operations and Administration
Martin Kruliš by Martin Kruliš (v1.0)1.
22-Aug-15 | 1 |1 | Help! I need more servers! What do I do? Scaling a PHP application.
PHP Security.
Drupal Training Syllabus Chaitanya Lakshmi
Apache Server The Apache Server Apache is a WWW server that implements the HTTP protocol. Apache runs as a daemon. This means that it is a resident.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
HTTP and Server Security James Walden Northern Kentucky University.
CSC 2720 Building Web Applications Cookies, URL-Rewriting, Hidden Fields and Session Management.
INFM603 Project Presentation Jenny Wu Prachi Chhokar.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Making your website go faster! Front-end Developer, Deeson Online Alli Price.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
1-Vulnerabilities 2-Hackers 3-Categories of attacks 4-What a malicious hacker do? 5-Security mechanisms 6-HTTP Web Servers 7-Web applications attacks.
Web application architecture
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
AppSec USA 2014 Denver, Colorado CMS Hacking 101 Hacking and Securing Popular Open Source Content Management Systems.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
Crash Course in Web Hacking
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
Module 7: Advanced Application and Web Filtering.
Website Hosting at Vilnius University by Eligijus Račkauskas senior programmer at VU ITTC.
Security Issues with PHP  PHP installation  PHP programming Willa Zhu & Eugene Burger.
Web2.0 Secure Development Practice Bruce Xia
DrupalCon 2011: Feedback ENTICE meeting 8 April 2011 Silvia Tomanin DG-CO.
Accelerating PHP Applications Ilia Alshanetsky O’Reilly Open Source Convention August 3rd, 2005.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
Speeding Up Alfresco and Share using Nginx Reverse/Caching Frontend Proxy Ishara Fernando Senior Linux Systems Administrator.
10 Tips for Building a Secure PHP Application. Tip 1: Use Proper Error Reporting/Handling  The development process of the application can become very.
Aaron Corso COSC Spring What is LAMP?  A ‘solution stack’, or package of an OS and software consisting of:  Linux  Apache  MySQL  PHP.
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Building Secure ColdFusion Applications
Introduction to Dynamic Web Programming
World Wide Web policy.
Node.js Express Web Applications
Time is the enemy: Ten Core Lessons for Achieving Peak
12 Ways to Improve Magento 2 Security and Performance OF TOPIC
Information Systems 337 Prof. Harry Plantinga Assessment.
PHP Training at GoLogica in Bangalore
Configuring Internet-related services
PHP and Forms.

Designing IIS Security (IIS – Internet Information Service)
Presentation transcript:

Performance & Security Satish C Ayappan (Drupal Architect- Capgemini)

Performance  F ront end performance.  Drupal out of box optimization  Mysql Optimization  MySQL Query Optimization  Memcache for database caching  Scalable File System options  PHP and Apache Configuration  Use Reverse proxies like Varnish  A fail over server landscape

Security  SQL injection  Cross Site Scripting (XSS)  Cross Site Request Forgery (CSRF)  File Permissions  Harden Apache and PHP  Securing Linux Server.

Performance What we can do?

Front end performance – Limit HTTP Requests. – Use Drupal Aggregator or Advanced CSS/JS Aggregation – Use Pagespeed or Yslow – Enable gzip compression – Specify image dimensions – Single Points of Failure (SPOFs)

Front end performance contd.. – Use CDN for Images and CSS – Use Image Sprites. – Optimize Images (Yahoo! Smush.it). – Client side caching ( Cache control and Expires, Don’t use Etag, In Apache you can disable the Etag with FileFlag)

Drupal out of box optimization – Page Caching Page caching will not work when there is a PHP session. It will work for anonymous user. – JS and CSS Aggregation – Use Boost – Use View Cache – Use Entity Cache along with Redis – Cache Warming / Priming (Drush Entity Cache Loader, Cache Warmer) – Use Fast 404 Module – Use Syslog Module – Disable PHP Filter Module

Mysql Optimization – Enable query cache – Variables Like innodb_buffer_pool_size, table_cache thread_cache etc. – Use innodb_file_per_table. -to-tune-in-mysql-server-after-installation/ -to-tune-in-mysql-server-after-installation/

Mysql Query Optimization – Use Indexes – Use Explain to understand the query plan – Avoid full table scan, file sort and temporary table creation by looking at query plan – Look here for query optimization optimization.html optimization.html

Memcache/Redis for database cache – Memcache /Redis can be used in front of Mysql to offload database server load, the data can be cached at memcache/Redis and serve the data from memcache/Redis without hitting the MySQL Server

Scalable File System options – NFS file system – If you are using NFS, increase the size for Real Path Cache – Glusterfs File system – Use can use lsyncd or rsync. – File Conveyor – Mounting SSFS – NAS – SAN

PHP and Apache Configuration – Use OPCache (PHP 5.5 has free version of Zend optimizer) – opcache.memory_consumption – opcache.max_accelerated_files – opcache_revalidate_freq = 240 – Disable the modules of Apache in production if you are not using. – Set keepalive setting to 1 or 2 seconds – Include.htaccess file using include directive and change the parameter AllowOverride to None.

Reverse proxies like Varnish – Don’t use Etags for static pages. – Don’t session id or cookies for static pages.

A fail over server landscape (No DR)

Security What we can do?

SQL Injection – Use always parameterized Queries uid = 1; $result = db_query('SELECT n.nid, n.title, n.created FROM {node} n WHERE n.uid = :uid', array(':uid' => $uid)); // Result is returned as a iterable object that returns a stdClass object on each iteration foreach ($result as $record) { // Perform operations on $record->title, etc. here. } uid = 1; $result = db_query('SELECT n.nid, n.title, n.created FROM {node} n WHERE n.uid = $uid'); // Result is returned as a iterable object that returns a stdClass object on each iteration foreach ($result as $record) { // Perform operations on $record->title, etc. here. }

Cross Site Scripting (XSS) – Apply filter for content Should not use Full HTML – Use Check URI check_url($url) for URLs before displaying the content – Use check plain check_plain($text) method to check the text before displaying the content. – Use t() and % and not !, this will apply check_plain automatically for translation – Use l() to create links

Cross Site Request Forgery (CSRF) – Use always form API

File Permissions – Files: 770 or 754 chmod -R 770 /var/www/html/sites/default/files – Themes: 755 chmod -R 755 /var/www/html/sites/all/themes – Default: 755 chmod 755 /var/www/html/sites/default – Settings.php: 444 chmod 444 /var/www/html/sites/default/settings.php

Hardening Apache – Set ServerSignature Off in apache configuration file – Set ServerTokens Prod in apache configuration file – Disable unnecessary modules – Disable unnecessary Options like Indexes, Options -Indexes – Disable ETAG – Run Apache with its owns user and group – Set cookie with HttpOnly and Secure flag – Configure for X-XSS Protection – Disable HTTP 1.0 Protocol – Disable Trace Requests – Limit HTTP Request Methods to GET POST HEAD – Use use mod_security – install the mod_evasive to avoid dos attacks

Hardening PHP – Set expose_php Off in php.ini – Set display_errors Off – Log errors using Syslog Module – Set maximum File Upload size – Turn off allow_url_fopen and allow_url_include – Set post_max_size – Use disable_functions to disable functions that are dangerous (exec, shell_exec etc) – Limit PHP Access To File System – Turn off enable_dl – Disable Unnecessary PHP modules

Securing Linux Server – Close unnecessary ports – Uninstall unnecessary applications like FTP server if not required – Prevent IP Spoofing – Harden Apache and PHP – Protect from DDOS – Install Intrusion Detection – PSAD – Use SELinux – Apparmor’ – Protect su by limiting access only to admin group – Install denyhosts, fail2ban

Satish C Ayappan (Drupal Architect- Capgemini)