drupal security - configuration and process

31
VPS.net 24. aug 14:45 Drupal Security Gábor Hojtsy & Ben Jeavons Tuesday, August 31, 2010

Upload: gabor-hojtsy

Post on 12-May-2015

1.390 views

Category:

Technology


2 download

DESCRIPTION

"Drupal security - Configuration and process" session slides from Drupalcon Copenhagen. Co-prepared and co-presented with Ben Jeavons from Growing Venture Solutions (http://growingventuresolutions.com/)

TRANSCRIPT

Page 1: Drupal security - Configuration and process

VPS.net24. aug 14:45

Drupal SecurityGábor Hojtsy & Ben Jeavons

Tuesday, August 31, 2010

Page 2: Drupal security - Configuration and process

Who we are

• Ben Jeavons

• Drupal Security Report

• Growing Venture Solutions

• Security Team Member

• Gábor Hojtsy

• Drupal 6 co-maintainer

• Acquia

• Security Team Member

Tuesday, August 31, 2010

Page 3: Drupal security - Configuration and process

Web security

• Protecting resources from abuse

• Protecting data

• Protecting available actions

• Attackers exploit a weakness to do harm

Tuesday, August 31, 2010

Page 4: Drupal security - Configuration and process

Demo

• Malicious Javascript is entered

• Admin unknowingly executes

• Javascript alters admin-only settings

• Changes admin password

• Puts site offline

Tuesday, August 31, 2010

Page 5: Drupal security - Configuration and process

66%likeliness a website has

Cross Site Scripting

http://whitehatsec.com/home/assets/presentations/09PPT/PPT_statsfall09_8th.pdf

Tuesday, August 31, 2010

Page 6: Drupal security - Configuration and process

Vulnerabilities by popularity

XSS Access Bypass CSRFAuthentication/Session Arbitrary Code Execution SQL InjectionOthers

48%

16%

10%

3%

4%

7%

12%

http://drupalsecurityreport.org

Tuesday, August 31, 2010

Page 7: Drupal security - Configuration and process

Lots of risks

• Prioritize your actions

• Secure configuration

• Careful processes

• Keep code up-to-date

• Audit custom code

Tuesday, August 31, 2010

Page 8: Drupal security - Configuration and process

Smart configuration

• Control user input

• Input formats

• Trust

• Roles and permissions

Tuesday, August 31, 2010

Page 9: Drupal security - Configuration and process

Input formats

• Input formats control what happens when user-supplied data is displayed

Tuesday, August 31, 2010

Page 10: Drupal security - Configuration and process

Input formats

• Filtered HTML for untrusted roles

• Full HTML for completely trusted roles

Tuesday, August 31, 2010

Page 11: Drupal security - Configuration and process

Filtered HTML

• HTML filter

• Limits the allowed tags

Tuesday, August 31, 2010

Page 12: Drupal security - Configuration and process

Unsafe HTML tags

• Script tags or any that allow JS events

• <script>

• Any that allow URL reference

• <img>

Tuesday, August 31, 2010

Page 13: Drupal security - Configuration and process

No image tags?!

• Image tags allow for CSRF attacks

• It’s a matter of trust

• Use CCK & imagefield

• Use control access to Full HTML

Tuesday, August 31, 2010

Page 14: Drupal security - Configuration and process

Trust

• Know your roles

• Which users have which roles

• How roles are granted

Tuesday, August 31, 2010

Page 15: Drupal security - Configuration and process

“Super-admin” permissions

• Administer permissions

• Administer users

• Administer filters

• Administer content types

• Administer site configuration

Tuesday, August 31, 2010

Page 16: Drupal security - Configuration and process

Trust

• Utilize principle of Least Privilege

• Grant only the necessary permissions to carry out the required work

Tuesday, August 31, 2010

Page 17: Drupal security - Configuration and process

Tuesday, August 31, 2010

Page 18: Drupal security - Configuration and process

Recovering from attack

• Restore from backup

• Upgrade to latest security releases

• Change your passwords

• Audit your configuration & custom code

Tuesday, August 31, 2010

Page 19: Drupal security - Configuration and process

Backups

• You do have backups, don’t you?

• phpMyAdmin > Export

• mysqldump on the command line

• Be sure to check they worked!

Tuesday, August 31, 2010

Page 20: Drupal security - Configuration and process

Open source is secure

• Source code is open for people to look at

• Popularity means eyes on code

• Collaboration increases code quality

Tuesday, August 31, 2010

Page 21: Drupal security - Configuration and process

Drupal is secure

• Drupal APIs are designed to be secure

• http://drupal.org/writing-secure-code

Tuesday, August 31, 2010

Page 22: Drupal security - Configuration and process

Drupal security team

• Team of volunteers

• Support core and all(!) of contrib

• Not actively reviewing all contrib projects

Tuesday, August 31, 2010

Page 23: Drupal security - Configuration and process

Security Advisories

• Only stable project releases

• SAs on Wednesdays

• New core release types

• Bug fix release / Security fix release

Tuesday, August 31, 2010

Page 24: Drupal security - Configuration and process

Stay up-to-date

• Know about security updates

• Security Advisories

• Update status module

• Mailing list, RSS, Twitter

• Apply them!

Tuesday, August 31, 2010

Page 25: Drupal security - Configuration and process

Security updates

• Most security updates are small

• But not always

• Apply updates to development instance

• Test, then apply to production

Tuesday, August 31, 2010

Page 26: Drupal security - Configuration and process

FTP

• Do not use it!

• Common vector for attack

• Really, we’ve moved past plain-text

Tuesday, August 31, 2010

Page 27: Drupal security - Configuration and process

SFTP

• “Secure” FTP

• Your host should provide it

• If not, consider a new one

Tuesday, August 31, 2010

Page 29: Drupal security - Configuration and process

Security Review

• http://drupal.org/project/security_review

• File system permissions

• Granted “super-admin” permissions

• Input formats

• Allowed upload extensions

• PHP & Javascript in content

Tuesday, August 31, 2010

Page 30: Drupal security - Configuration and process

• Security Advisories

• http://drupal.org/security

• Handbooks

• http://drupal.org/security/secure-configuration

• http://drupal.org/writing-secure-code

• Cracking Drupal Book

• http://crackingdrupal.com

• http://www.owasp.org/

Tuesday, August 31, 2010

Page 31: Drupal security - Configuration and process

http://cph2010.drupal.org/node/12628

Tuesday, August 31, 2010