SlideShare uma empresa Scribd logo
1 de 62
Baixar para ler offline
Help!
I inherited a Drupal Site!
Paul McKibben - Drupalcamp Atlanta 2016
About me...
● Working with Drupal since 2007.
● Run my own consultancy.
● Implemented sites of all sizes on
Drupal 5, 6, 7, and 8.
● Have inherited many Drupal sites. paul@turbojettech.com
Twitter: @paulmckibben
Don’t panic! You can figure this out.
We will cover:
● Drupal basics.
● Determining the state of your inherited
Drupal site.
● Learning how your site works.
● Pitfalls, bad behavior, and war stories.
First, some basics...
How Drupal Works (the aerial tour)
Terminology
● Module: code package that extends Drupal’s capabilities.
(Panels, Webform, Views …)
● Theme: code package that influences what Drupal’s output looks like.
● Install profile: a packaged distribution of Drupal core plus extra
modules and themes for a specific purpose.
(Commerce Kickstart, Panopoly, OpenPublic …)
Most common versions of Drupal
● Drupal 8 was released about a year ago. Latest release is 8.2.1.
● Drupal 7 was released in 2011. Latest release is 7.51. Community
support continues until Drupal 9 is released, years from now.
● Drupal 6 is end-of-life. Final release was 6.38, early this year. Some
companies still provide long-term support and provide security patches
on https://www.drupal.org/project/d6lts
Drupal 7 code structure (Drupal 6 is similar)
includes
misc
modules
profiles
scripts
themes
sites
authorize.php
cron.php
index.php
install.php
update.php
Drupal
core files
all
modules
contrib
custom
themes
default
files
settings.php
(may have multisite directories too)
Modules downloaded
from drupal.org
Custom-coded
modules
This is where you extend and
customize Drupal’s functionality
Contributed and
custom themes
Uploaded files (images,
documents, etc.)
Site configuration (database
connection settings, etc.)
Install profile code
goes here if
applicable
Drupal 8 code structure
core
profiles
vendor
sites
autoload.php
index.php
Drupal
core files
modules
contrib
custom
themes
default
files
settings.php
(may have multisite directories too)
Modules downloaded
from drupal.org
Custom-coded
modules
This is where you extend and
customize Drupal’s functionality
Contributed and
custom themes
Uploaded files (images,
documents, etc.)
Site configuration (database
connection settings, etc.)
services.yml
Service container settings
Install profile code
goes here if
applicable
Drush: the Drupal Shell
● Drush is a command line tool for managing your Drupal installation.
● Useful for accomplishing administrative tasks quickly.
● Essential for auditing and accessing a Drupal site you have inherited.
● Drush resources:
○ Drush homepage: http://www.drush.org/
○ FAQ: https://www.drupal.org/drush-faq
○ Drupalize.me drush series: https://drupalize.me/videos/what-drush?p=1156
Checking the State of Your Site
What lurks under the hood?
State of Your Site: First Look
● Can you log in?
● Drupal version
● Install profile?
● Installed modules
● Status report
Logging in - becoming User 1
● Only the Drupal user with uid=1 is
guaranteed full privileges.
● Get User 1 credentials from
previous developer, if you can.
● Try drush commands such as
drush user-login.
Logging in - becoming User 1
● If you have database access:
○ Change the user 1 email address
○ Go to /user/password and mail yourself a reset link.
UPDATE users SET mail="myaddress@example.com" WHERE uid=1;
● More ideas from Drupal.org documentation:
https://www.drupal.org/node/201871
What version of Drupal do I have?
Go to the status report
page,
admin/reports/status
This report will also tell you if you have an install profile.
Another way to see the Drupal core version
Look at the .info or .info.yml file for a
core module (I use “node”):
Drupal 6 or 7:
[root]/modules/node/node.info
Drupal 8:
[root]/core/modules/node/node.
info.yml
What else is in the status report?
● When was cron last run?
● Are updates available for core or contributed code?
● Are security updates required?
● Are any database updates outstanding?
● PHP version and link to “phpinfo” configuration information
● Database type and version
● Some Drupal modules also add messages to this screen.
Installed Modules
The modules page is at
admin/modules
Looking Deeper
Are there problems further below?
State of Your Site: Digging Deeper
● Setting up a local copy of your site
● Site audit tools
● Has any code been hacked?
● Are there security issues?
● Are updates available?
Setting up a local copy of your site
● Why? Because you can test changes and make mistakes without affecting the
live site.
● Need a local *AMP stack: Apache, MySQL, PHP. Options include:
○ Install Apache, MySQL, and PHP directly.
○ Tools such as MAMP, WAMP, Acquia Dev Desktop, etc.
○ Virtual machine: run a virtual Linux server on your PC or Mac. The
drupal-vm project is excellent for this.
● See https://www.drupal.org/docs/develop/local-server-setup for guidance.
Setting up a local copy of your site
Once you have your *AMP stack set up, you’ll need:
● The entire Drupal code tree, except (optional) sites/default/files
○ Transferring large file uploads to your local copy is time/bandwidth consuming.
○ Use the stage_file_proxy module to access your hosted files from your local site
● A database dump from your live site
○ The backup/migrate module may be helpful
○ phpMyAdmin, mysqldump, and drush sql-dump are also great
Site Audit Tools
Great tools to help you find problems on your site:
Project URL Type Drupal Versions
Hacked https://www.drupal.org/project/hacked Drupal module 6, 7, 8
Site Audit https://www.drupal.org/project/site_audit Drush tool 7, 8
Security Review https://www.drupal.org/project/security_review Drupal module 6, 7, 8
Drupalgeddon https://www.drupal.org/project/drupalgeddon Drush tool 7
Has any code been hacked?
● Hacked means: Drupal core
or contributed module code
has been modified from the
downloaded version.
● Strongly discouraged (think
of the kittens).
● The “Hacked” module allows
you to detect modified code.
(But it’s not perfect.)
Example report from Hacked module
Drush version of hacked
project report:
drush hacked-list-projects
FAQs about hacks
● If hacking is so bad, why does it happen?
○ Desperation
○ Inexperienced developer
● Why is hacked code a problem?
○ Makes updating Drupal code difficult.
○ Must either preserve the hack or build the
equivalent change correctly.
● What’s the right way instead of hacking?
○ Use a custom module or theme to override
functionality.
I will not hack Drupal...
I will not hack Drupal...
Drush options with site_audit
Security Review module report
The Drupageddon Exploit
● Drupal 7 exploit announced October 15, 2014,
corrected in Drupal version 7.32. See
https://www.drupal.org/SA-CORE-2014-005
● Many sites not promptly updated or patched
got exploited. See
https://www.drupal.org/PSA-2014-003
● Your inherited site may be a victim, even if it is
on 7.32 or higher.
What is Drupageddon?
● A security hole in Drupal 7 core (prior to 7.32) allowed SQL
injection. (Also Drupal 8 prior to 8.0.0 beta 2)
● Made it possible for a malicious user to modify the database
from (e.g.) the login page and gain complete access.
● Exploiters installed malicious backdoor code and then covered
their tracks.
Detecting Drupageddon
● Use the drupalgeddon (with an L) tool.
https://www.drupal.org/project/drupalgeddon
● If it shows issues, your site is (or was) infected.
● If it does not show issues, it doesn’t mean your site is not infected.
● Any site that was publicly-accessible October 15, 2014 and did not get promptly
patched was probably impacted.
If your site was exploited, recovery is not easy.
A good discussion of what you can do: https://www.drupal.org/node/2365547 -
“Your Drupal site got hacked. Now what?”
Check Available Updates: admin/reports/updates
Make sure the core
“Update Manager”
module is enabled.
Should I update?
Imperative: have the latest security release of core and contributed modules.
Recommended: have the latest stable release of core and contributed modules.
Drupal core
major version
6 7 8
Latest security release 6.38 7.44 8.1.10
Latest release 6.38 7.51 8.2.1
Information current as of October 19, 2016
Update vs. Upgrade
Definitions:
● Update: installing the latest software for your major version (e.g. 7.44 to 7.51)
● Upgrade: moving to a newer major version of Drupal (e.g. 7.44 to 8.2.1)
Updating Drupal core is usually straightforward:
● Replace old core files with new core files, but preserve site-specific changes to .htaccess,
robots.txt, settings.php, etc.
● Run the database update script (update.php or drush updb).
Upgrading Drupal core is usually not straightforward. In most cases, best approach is to
rebuild and migrate.
How to update Drupal core
Where to find instructions for updating:
● ALWAYS test your update in a non-production environment first.
● Drupal 6: https://www.drupal.org/node/390448 - also, see UPGRADE.txt
● Drupal 7: https://www.drupal.org/docs/7/update - also, see UPGRADE.txt
● Drupal 8: https://www.drupal.org/docs/8/update - also, see core/UPDATE.txt
How to update contributed modules
Updating contributed modules is similar to updating Drupal core:
● Replace the old module code with the new module code.
● Run the database update script (update.php or drush updb).
Learn How Your Site Works
Reverse Engineering Your Site
● Identifying common Drupal constructs
● How modules work (overview)
● How themes work (overview)
Get to know your browser’s developer tools
● Major browsers all have built-in
web inspection tools
● Chrome/Firefox/Safari:
right-click over the HTML element
and select the “Inspect” menu
item (Safari: may need to enable
developer tools first).
● Internet Explorer: hit F12
Common Construct: Node
● Most common way to represent content.
● A node is an instance of a content type:
○ Article
○ Page
○ Press Release
○ Video
○ Whatever else you may define
● A node can be represented as a page
● A node can appear in a listing, e.g. a view
Identifying a Node (Page)
Identifying a Node (in a list)
Common Construct: Block
● Blocks are boxes of content, e.g. a search form or a copyright statement.
● A block is displayed in a selected region on a page, e.g. a sidebar, header, or
footer.
● Modules can define blocks, e.g. the core search module defines a Search block
● A site administrator can also define custom blocks.
Identifying a Block
Common Construct: View
● A view is a list of entities, usually nodes.
● Requires the Views module, a contributed module in Drupal 7 and earlier.
● In Drupal 8, Views is part of core.
● A View might be used for:
○ A list of press releases or blog posts
○ A page that lists the executives of a company
○ A map with several location plotted on it (requires accompanying geocoding and map modules)
○ A slideshow (requires custom theming/javascript or the Views Slideshow module)
● Views documentation: https://www.drupal.org/documentation/modules/views
Identifying a View
Common Construct: Panels
● Panels is a contributed module (actually a set of modules).
● Makes it easy to layout content within a page.
● A Panel is divided into a set of Panes.
● Related to Panels:
○ Mini-panels
○ Panelizer
● Panels documentation: https://www.drupal.org/node/496278
Identifying Panels and Panes
Is a custom module doing this?
● Sometimes a Drupal page is not a node, a view, a panel, or something else
where an administrator configures the URL path.
● You can find out if a custom module (or any other module) is responsible for a
page by seeing if the module implements the URL path as a route:
○ Drupal 6 and 7: Look for implementations of hook_menu: a function named
[modulename_menu].
○ Drupal 8: Look at the [modulename].routing.yml file.
Example of hook_menu
This implements [site-url]/claim-organization
Themes: which themes are in use?
Go to the Appearance admin page (admin/appearance)
Theme structure
Drupal 6 and 7:
● [themename].info file
● template.php
● Template files: filename.tpl.php
(tipple-phip)
● CSS and Javascript
Documentation:
https://www.drupal.org/docs/7/theming
Drupal 8:
● [themename].info.yml file
● [themename].theme
● Template files: filename.html.twig
(no more php templates)
● CSS and Javascript
Documentation:
https://www.drupal.org/docs/8/theming
Pitfalls, Bad Behavior,
and War Stories
Pitfalls, Bad Behavior, and War Stories
● Improperly installed modules
● Questionable, impostor, and abandoned contrib
modules
● Business logic in theme template
● Your war stories?
Improperly installed modules
includes
misc
modules
profiles
scripts
themes
sites
authorize.php
cron.php
index.php
install.php
update.php
all
modules
themes
default
files
settings.php
(may have multisite directories too)
I’ve seen contrib and
custom modules mixed
here
I’ve seen contrib
and custom
modules installed
here
Questionable contrib modules
An Acquia module?
● Acquia is the company founded by Drupal creator
Dries Buytaert.
● But I had never heard of a module called Acquia.
● I couldn’t find a Drupal.org project that matched the
Acquia module or any of its submodules.
● Further research: this module came from an
independent developer in Italy and was sold on Envato.
Complex php logic in theme templates
● Theme templates are supposed to be for markup.
● However, since they are PHP files in Drupal 6 and 7, it’s possible to put any
PHP code in them.
● Too much PHP in the template files leads to maintainability problems. (What if
you want to change the theme?)
● Violates the separation of business logic from presentation logic.
What about your war stories?
Remember, Don’t Panic
We covered a lot, but you now have
resources to learn more.
If you need help:
● https://www.drupal.org/community
lists where you can ask questions, e.g
IRC and the drupal.org forums
● You can seek professional support
from a Drupal expert or an agency.
Questions?
Contact me:
Paul McKibben
Email: paul@turbojettech.com
Twitter: @paulmckibben
Slides:
http://
Thank you!

Mais conteúdo relacionado

Mais procurados

Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and DrushPantheon
 
How a Content Delivery Network Can Help Speed Up Your Website
How a Content Delivery Network Can Help Speed Up Your WebsiteHow a Content Delivery Network Can Help Speed Up Your Website
How a Content Delivery Network Can Help Speed Up Your WebsiteMediacurrent
 
Drush und Multisite: drush_multi
Drush und Multisite: drush_multiDrush und Multisite: drush_multi
Drush und Multisite: drush_multiFlorian Latzel
 
drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010Florian Latzel
 
Evolution of Drupal and the Drupal community
Evolution of Drupal and the Drupal communityEvolution of Drupal and the Drupal community
Evolution of Drupal and the Drupal communityAngela Byron
 
Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal BasicsJuha Niemi
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsAngela Byron
 
One drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp CaceresOne drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp Cacereshernanibf
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Drupal 6.x, Drupal 7.x -- Scratching the surface
Drupal 6.x, Drupal 7.x -- Scratching the surfaceDrupal 6.x, Drupal 7.x -- Scratching the surface
Drupal 6.x, Drupal 7.x -- Scratching the surfaceFlorian Latzel
 
Top 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeTop 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeIztok Smolic
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2Confiz
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsDavid Watson
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Acquia
 
[drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance![drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance!DrupalDay
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Developmentjcarrig
 

Mais procurados (20)

Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
How a Content Delivery Network Can Help Speed Up Your Website
How a Content Delivery Network Can Help Speed Up Your WebsiteHow a Content Delivery Network Can Help Speed Up Your Website
How a Content Delivery Network Can Help Speed Up Your Website
 
Drush und Multisite: drush_multi
Drush und Multisite: drush_multiDrush und Multisite: drush_multi
Drush und Multisite: drush_multi
 
drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010
 
Evolution of Drupal and the Drupal community
Evolution of Drupal and the Drupal communityEvolution of Drupal and the Drupal community
Evolution of Drupal and the Drupal community
 
Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal Basics
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
 
One drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp CaceresOne drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp Caceres
 
Migrate to Drupal 8
Migrate to Drupal 8Migrate to Drupal 8
Migrate to Drupal 8
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
features+
features+features+
features+
 
Drupal 6.x, Drupal 7.x -- Scratching the surface
Drupal 6.x, Drupal 7.x -- Scratching the surfaceDrupal 6.x, Drupal 7.x -- Scratching the surface
Drupal 6.x, Drupal 7.x -- Scratching the surface
 
Top 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeTop 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies make
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Introduction to Drupal 7
Introduction to Drupal 7Introduction to Drupal 7
Introduction to Drupal 7
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development Environments
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
[drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance![drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance!
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
 

Semelhante a Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016

Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerabilityAnn Lam
 
Hong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8thHong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8thWong Hoi Sing Edison
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerabilityAnn Lam
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Drush workshop
Drush workshopDrush workshop
Drush workshopJuampy NR
 
How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?DrupalGeeks
 
Choosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management FrameworkChoosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management FrameworkMediacurrent
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal DevelopmentChris Tankersley
 
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleDrupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleIrina Zaks
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex Technologies
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
DrupalCampSFL OpenPublic Overview
DrupalCampSFL OpenPublic OverviewDrupalCampSFL OpenPublic Overview
DrupalCampSFL OpenPublic OverviewJohn Studdard
 
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Vladimir Roudakov
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...Chipway
 

Semelhante a Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016 (20)

Drupal in-depth
Drupal in-depthDrupal in-depth
Drupal in-depth
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
 
Hong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8thHong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8th
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
 
How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?
 
Choosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management FrameworkChoosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management Framework
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleDrupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
DrupalCampSFL OpenPublic Overview
DrupalCampSFL OpenPublic OverviewDrupalCampSFL OpenPublic Overview
DrupalCampSFL OpenPublic Overview
 
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
 
Beginning Drush
Beginning DrushBeginning Drush
Beginning Drush
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
 

Último

Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 

Último (20)

Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 

Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016

  • 1. Help! I inherited a Drupal Site! Paul McKibben - Drupalcamp Atlanta 2016
  • 2. About me... ● Working with Drupal since 2007. ● Run my own consultancy. ● Implemented sites of all sizes on Drupal 5, 6, 7, and 8. ● Have inherited many Drupal sites. paul@turbojettech.com Twitter: @paulmckibben
  • 3.
  • 4. Don’t panic! You can figure this out. We will cover: ● Drupal basics. ● Determining the state of your inherited Drupal site. ● Learning how your site works. ● Pitfalls, bad behavior, and war stories.
  • 6. How Drupal Works (the aerial tour)
  • 7. Terminology ● Module: code package that extends Drupal’s capabilities. (Panels, Webform, Views …) ● Theme: code package that influences what Drupal’s output looks like. ● Install profile: a packaged distribution of Drupal core plus extra modules and themes for a specific purpose. (Commerce Kickstart, Panopoly, OpenPublic …)
  • 8. Most common versions of Drupal ● Drupal 8 was released about a year ago. Latest release is 8.2.1. ● Drupal 7 was released in 2011. Latest release is 7.51. Community support continues until Drupal 9 is released, years from now. ● Drupal 6 is end-of-life. Final release was 6.38, early this year. Some companies still provide long-term support and provide security patches on https://www.drupal.org/project/d6lts
  • 9. Drupal 7 code structure (Drupal 6 is similar) includes misc modules profiles scripts themes sites authorize.php cron.php index.php install.php update.php Drupal core files all modules contrib custom themes default files settings.php (may have multisite directories too) Modules downloaded from drupal.org Custom-coded modules This is where you extend and customize Drupal’s functionality Contributed and custom themes Uploaded files (images, documents, etc.) Site configuration (database connection settings, etc.) Install profile code goes here if applicable
  • 10. Drupal 8 code structure core profiles vendor sites autoload.php index.php Drupal core files modules contrib custom themes default files settings.php (may have multisite directories too) Modules downloaded from drupal.org Custom-coded modules This is where you extend and customize Drupal’s functionality Contributed and custom themes Uploaded files (images, documents, etc.) Site configuration (database connection settings, etc.) services.yml Service container settings Install profile code goes here if applicable
  • 11. Drush: the Drupal Shell ● Drush is a command line tool for managing your Drupal installation. ● Useful for accomplishing administrative tasks quickly. ● Essential for auditing and accessing a Drupal site you have inherited. ● Drush resources: ○ Drush homepage: http://www.drush.org/ ○ FAQ: https://www.drupal.org/drush-faq ○ Drupalize.me drush series: https://drupalize.me/videos/what-drush?p=1156
  • 12. Checking the State of Your Site What lurks under the hood?
  • 13. State of Your Site: First Look ● Can you log in? ● Drupal version ● Install profile? ● Installed modules ● Status report
  • 14. Logging in - becoming User 1 ● Only the Drupal user with uid=1 is guaranteed full privileges. ● Get User 1 credentials from previous developer, if you can. ● Try drush commands such as drush user-login.
  • 15. Logging in - becoming User 1 ● If you have database access: ○ Change the user 1 email address ○ Go to /user/password and mail yourself a reset link. UPDATE users SET mail="myaddress@example.com" WHERE uid=1; ● More ideas from Drupal.org documentation: https://www.drupal.org/node/201871
  • 16. What version of Drupal do I have? Go to the status report page, admin/reports/status This report will also tell you if you have an install profile.
  • 17. Another way to see the Drupal core version Look at the .info or .info.yml file for a core module (I use “node”): Drupal 6 or 7: [root]/modules/node/node.info Drupal 8: [root]/core/modules/node/node. info.yml
  • 18. What else is in the status report? ● When was cron last run? ● Are updates available for core or contributed code? ● Are security updates required? ● Are any database updates outstanding? ● PHP version and link to “phpinfo” configuration information ● Database type and version ● Some Drupal modules also add messages to this screen.
  • 19. Installed Modules The modules page is at admin/modules
  • 20. Looking Deeper Are there problems further below?
  • 21. State of Your Site: Digging Deeper ● Setting up a local copy of your site ● Site audit tools ● Has any code been hacked? ● Are there security issues? ● Are updates available?
  • 22. Setting up a local copy of your site ● Why? Because you can test changes and make mistakes without affecting the live site. ● Need a local *AMP stack: Apache, MySQL, PHP. Options include: ○ Install Apache, MySQL, and PHP directly. ○ Tools such as MAMP, WAMP, Acquia Dev Desktop, etc. ○ Virtual machine: run a virtual Linux server on your PC or Mac. The drupal-vm project is excellent for this. ● See https://www.drupal.org/docs/develop/local-server-setup for guidance.
  • 23. Setting up a local copy of your site Once you have your *AMP stack set up, you’ll need: ● The entire Drupal code tree, except (optional) sites/default/files ○ Transferring large file uploads to your local copy is time/bandwidth consuming. ○ Use the stage_file_proxy module to access your hosted files from your local site ● A database dump from your live site ○ The backup/migrate module may be helpful ○ phpMyAdmin, mysqldump, and drush sql-dump are also great
  • 24. Site Audit Tools Great tools to help you find problems on your site: Project URL Type Drupal Versions Hacked https://www.drupal.org/project/hacked Drupal module 6, 7, 8 Site Audit https://www.drupal.org/project/site_audit Drush tool 7, 8 Security Review https://www.drupal.org/project/security_review Drupal module 6, 7, 8 Drupalgeddon https://www.drupal.org/project/drupalgeddon Drush tool 7
  • 25. Has any code been hacked? ● Hacked means: Drupal core or contributed module code has been modified from the downloaded version. ● Strongly discouraged (think of the kittens). ● The “Hacked” module allows you to detect modified code. (But it’s not perfect.)
  • 26. Example report from Hacked module Drush version of hacked project report: drush hacked-list-projects
  • 27. FAQs about hacks ● If hacking is so bad, why does it happen? ○ Desperation ○ Inexperienced developer ● Why is hacked code a problem? ○ Makes updating Drupal code difficult. ○ Must either preserve the hack or build the equivalent change correctly. ● What’s the right way instead of hacking? ○ Use a custom module or theme to override functionality. I will not hack Drupal... I will not hack Drupal...
  • 28. Drush options with site_audit
  • 30. The Drupageddon Exploit ● Drupal 7 exploit announced October 15, 2014, corrected in Drupal version 7.32. See https://www.drupal.org/SA-CORE-2014-005 ● Many sites not promptly updated or patched got exploited. See https://www.drupal.org/PSA-2014-003 ● Your inherited site may be a victim, even if it is on 7.32 or higher.
  • 31. What is Drupageddon? ● A security hole in Drupal 7 core (prior to 7.32) allowed SQL injection. (Also Drupal 8 prior to 8.0.0 beta 2) ● Made it possible for a malicious user to modify the database from (e.g.) the login page and gain complete access. ● Exploiters installed malicious backdoor code and then covered their tracks.
  • 32. Detecting Drupageddon ● Use the drupalgeddon (with an L) tool. https://www.drupal.org/project/drupalgeddon ● If it shows issues, your site is (or was) infected. ● If it does not show issues, it doesn’t mean your site is not infected. ● Any site that was publicly-accessible October 15, 2014 and did not get promptly patched was probably impacted. If your site was exploited, recovery is not easy. A good discussion of what you can do: https://www.drupal.org/node/2365547 - “Your Drupal site got hacked. Now what?”
  • 33. Check Available Updates: admin/reports/updates Make sure the core “Update Manager” module is enabled.
  • 34. Should I update? Imperative: have the latest security release of core and contributed modules. Recommended: have the latest stable release of core and contributed modules. Drupal core major version 6 7 8 Latest security release 6.38 7.44 8.1.10 Latest release 6.38 7.51 8.2.1 Information current as of October 19, 2016
  • 35. Update vs. Upgrade Definitions: ● Update: installing the latest software for your major version (e.g. 7.44 to 7.51) ● Upgrade: moving to a newer major version of Drupal (e.g. 7.44 to 8.2.1) Updating Drupal core is usually straightforward: ● Replace old core files with new core files, but preserve site-specific changes to .htaccess, robots.txt, settings.php, etc. ● Run the database update script (update.php or drush updb). Upgrading Drupal core is usually not straightforward. In most cases, best approach is to rebuild and migrate.
  • 36. How to update Drupal core Where to find instructions for updating: ● ALWAYS test your update in a non-production environment first. ● Drupal 6: https://www.drupal.org/node/390448 - also, see UPGRADE.txt ● Drupal 7: https://www.drupal.org/docs/7/update - also, see UPGRADE.txt ● Drupal 8: https://www.drupal.org/docs/8/update - also, see core/UPDATE.txt
  • 37. How to update contributed modules Updating contributed modules is similar to updating Drupal core: ● Replace the old module code with the new module code. ● Run the database update script (update.php or drush updb).
  • 38. Learn How Your Site Works
  • 39. Reverse Engineering Your Site ● Identifying common Drupal constructs ● How modules work (overview) ● How themes work (overview)
  • 40. Get to know your browser’s developer tools ● Major browsers all have built-in web inspection tools ● Chrome/Firefox/Safari: right-click over the HTML element and select the “Inspect” menu item (Safari: may need to enable developer tools first). ● Internet Explorer: hit F12
  • 41. Common Construct: Node ● Most common way to represent content. ● A node is an instance of a content type: ○ Article ○ Page ○ Press Release ○ Video ○ Whatever else you may define ● A node can be represented as a page ● A node can appear in a listing, e.g. a view
  • 43. Identifying a Node (in a list)
  • 44. Common Construct: Block ● Blocks are boxes of content, e.g. a search form or a copyright statement. ● A block is displayed in a selected region on a page, e.g. a sidebar, header, or footer. ● Modules can define blocks, e.g. the core search module defines a Search block ● A site administrator can also define custom blocks.
  • 46. Common Construct: View ● A view is a list of entities, usually nodes. ● Requires the Views module, a contributed module in Drupal 7 and earlier. ● In Drupal 8, Views is part of core. ● A View might be used for: ○ A list of press releases or blog posts ○ A page that lists the executives of a company ○ A map with several location plotted on it (requires accompanying geocoding and map modules) ○ A slideshow (requires custom theming/javascript or the Views Slideshow module) ● Views documentation: https://www.drupal.org/documentation/modules/views
  • 48. Common Construct: Panels ● Panels is a contributed module (actually a set of modules). ● Makes it easy to layout content within a page. ● A Panel is divided into a set of Panes. ● Related to Panels: ○ Mini-panels ○ Panelizer ● Panels documentation: https://www.drupal.org/node/496278
  • 50. Is a custom module doing this? ● Sometimes a Drupal page is not a node, a view, a panel, or something else where an administrator configures the URL path. ● You can find out if a custom module (or any other module) is responsible for a page by seeing if the module implements the URL path as a route: ○ Drupal 6 and 7: Look for implementations of hook_menu: a function named [modulename_menu]. ○ Drupal 8: Look at the [modulename].routing.yml file.
  • 51. Example of hook_menu This implements [site-url]/claim-organization
  • 52. Themes: which themes are in use? Go to the Appearance admin page (admin/appearance)
  • 53. Theme structure Drupal 6 and 7: ● [themename].info file ● template.php ● Template files: filename.tpl.php (tipple-phip) ● CSS and Javascript Documentation: https://www.drupal.org/docs/7/theming Drupal 8: ● [themename].info.yml file ● [themename].theme ● Template files: filename.html.twig (no more php templates) ● CSS and Javascript Documentation: https://www.drupal.org/docs/8/theming
  • 55. Pitfalls, Bad Behavior, and War Stories ● Improperly installed modules ● Questionable, impostor, and abandoned contrib modules ● Business logic in theme template ● Your war stories?
  • 56. Improperly installed modules includes misc modules profiles scripts themes sites authorize.php cron.php index.php install.php update.php all modules themes default files settings.php (may have multisite directories too) I’ve seen contrib and custom modules mixed here I’ve seen contrib and custom modules installed here
  • 57. Questionable contrib modules An Acquia module? ● Acquia is the company founded by Drupal creator Dries Buytaert. ● But I had never heard of a module called Acquia. ● I couldn’t find a Drupal.org project that matched the Acquia module or any of its submodules. ● Further research: this module came from an independent developer in Italy and was sold on Envato.
  • 58. Complex php logic in theme templates ● Theme templates are supposed to be for markup. ● However, since they are PHP files in Drupal 6 and 7, it’s possible to put any PHP code in them. ● Too much PHP in the template files leads to maintainability problems. (What if you want to change the theme?) ● Violates the separation of business logic from presentation logic.
  • 59. What about your war stories?
  • 60. Remember, Don’t Panic We covered a lot, but you now have resources to learn more. If you need help: ● https://www.drupal.org/community lists where you can ask questions, e.g IRC and the drupal.org forums ● You can seek professional support from a Drupal expert or an agency.
  • 62. Contact me: Paul McKibben Email: paul@turbojettech.com Twitter: @paulmckibben Slides: http:// Thank you!