30
© Ibuildings 2014/2015 - All rights reserved #DrupalDaysEU Drupal Security: How to survive Drupalgeddon and prepare for future

Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

Embed Size (px)

Citation preview

Page 1: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

© Ibuildings 2014/2015 - All rights reserved

#DrupalDaysEU

Drupal Security: How to survive Drupalgeddon and prepare for future

Page 2: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

#DrupalDaysEU

© Ibuildings 2014/2015 - All rights reserved

Gold Sponsors

Page 3: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

#DrupalDaysEU

© Ibuildings 2014/2015 - All rights reserved

Media Sponsors

Silver Sponsors

Page 4: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

DRUPAL SECURITYHOW TO SURVIVE DRUPAGEDDON AND

PREPARE FOR FUTURECreated by Kristian Polso / @kristian_polso

Page 5: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

ABOUT MEKristian Polso

CTO at Vaiste Productions

Been working with Drupal since version 5

Earlier PHP background

@kristian_polso

Page 6: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

ABOUT VAISTE PRODUCTIONS

Drupal solutions company

Based in Turku, Finland

Focus on more customized Drupalsolutions & integrations

http://vaiste.com / @vaisteprod

Page 7: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

PURPOSE OF THIS PRESENTATIONWhat was Drupageddon and what happened

How to prepare for similar vulnerabilities

Best practices

Page 8: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

WHAT WAS DRUPAGEDDON?A vulnerability found in Drupal 7's database abstraction API

Drupal Security Team was informed of it in September 2014

Update released on October 15 2014 (Drupal 7.32)

Biggest vulnerability in Drupal's history

Name given by twitter (#drupageddon)

Page 9: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

HOW DID DRUPAGEDDON WORK?// includes/database/database.inc

foreach (array_filter($args, 'is_array') as $key => $data)

foreach ($data as $i => $value)

$args are GET parameters from the user

$i are supposed to be keys, as in integers

SUPPOSED to be...

Page 10: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

<input type="text" name="email[email1]" value="[email protected]">

<input type="text" name="email[email2]" value="[email protected]">

$_POST = array(

'email' => array(

'email1' => '[email protected]',

'email2' => '[email protected]',

)

);

Page 11: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

<input type="text" name="email[email1]" value="[email protected]">

<input type="text" name="email[0;UPDATE node SET title='uh­oh'; ­­]" value="[email protected]">

Page 12: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)
Page 13: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

ANY ANONYMOUS USER CAN GET ACCESS TO YOUR SITE'SDATABASE

Page 14: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

GO UPDATE YOUR DRUPAL SITENOW

SERIOUSLY, NOW

Page 15: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)
Page 16: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

THE AFTERMATHBBC: "Up to 12 million websites may have been

compromised"

Some hosting partners were really quick to patch

Drupal Security Team was super useful

Page 17: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

CRAWLING THE TOP 15,000 DRUPALWEBSITES

goo.gl/NPr20o (polso.info)

Done in November 2014

Page 18: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

IF YOU GOT HACKEDRecover from backups

drupal.org/project/drupalgeddon

Page 19: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

HOW TO BE SAFE FROM SECURITYVULNERABILITIES

Keep Drupal core & modules updated

Use managed hosting platforms (Acquia, Platform.sh,Pantheon)

Writing secure code (drupal.org/writing-secure-code)

Page 20: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

BEST PRACTICES

Page 21: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

PERMISSIONSAre all roles necessary?

Auto-grants

Review manually

Page 22: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

XSSText formats

Adding nodes (titles, body)

Page 23: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

AUTHENTICATIONWeak passwords

Autologout (d.o/project/autologout)

SSL

Page 24: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

COMMON SECURITYMISCONFIGURATIONS

Admin password? "admin"

Never use PHP input

Avoid FTP, use SFTP/SCP

Page 25: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

VERSIONINGTry not to use dev versions in production

Thoroughly test

Page 26: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

CUSTOM CODE

Page 27: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

OPEN SOURCE IS AWESOMEModules can have hundreds users

Easy issue tracking

Page 28: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

COMMON PITFALLS IN CUSTOMCODE

Not properly checking permissions

You don't notice your own mistakes

Page 29: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

CONCLUSIONUpdate your modules

Try not to use dev versions in production

Review your custom code

Page 30: Drupal Security: How to survive Drupalgeddon and prepare for future (European Drupal Days 2015)

THANK YOUKristian Polso

@kristian_polso