drupal security securing your configuration justin c. klein keane university of pennsylvania school...

24
Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix Systems

Upload: eleanore-cox

Post on 26-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Drupal Security

Securing your Configuration

Justin C. Klein KeaneUniversity of Pennsylvania

School of Arts and SciencesInformation Security and Unix Systems

Page 2: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Security Responsibility

Drupal API protects sites from many threats Module code may have holes but it's tough to

find them on your own By definition you need to delegate privilege Enforcing safe configuration is just a mouse

click away

Page 3: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Why Bother?

“I'm running a small site, who would want to attack it?”

“I back up every night, if it goes down I can just restore?”

“I'm the only admin, so vulnerabilities don't actually affect users.”

Page 4: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Logical Fallacy

You don't know what the attacker is after! Bandwidth Blackhat SEO Spam Drive by download JavaScript port scanning Host RFI text file On, and on, and on...

Page 5: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Risk Analysis

Everyone should gauge their own risk Threat x Likelihood x Impact = Risk

How can you judge likelihood? What about unknown threats?

You may not think of security problems before they affect your site

Page 6: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Sample Attack Pattern

Enumerate user accounts Brute force (guess) passwords Log in as a low privilege user Escalate privilege Take over web server process Establish a shell account Escalate privilege to root

Page 7: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Real World Attack Pattern

Attacker identifies reflected XSS Attacker links to your reflected XSS Search engine crawls link, reflects to attacker

site Attacker site gains search rank based on your

site

Page 8: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Other Attack Patterns

Attacker discovers ability to post content Attacker posts stored XSS Attacker posts to site with link to malware,

trust exploitation Attacker spams your site

Attacker brute forces a site account Account has same credentials as shell

Possibilities are endless

Page 9: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Account = Privilege = Danger!

Accounts have specific privilege Some privileges are super dangerous:

Administer content types Administer filters Administer users Administer permissions Administer site configuration

Page 10: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

PHP through Web UI = THREAT

If attackers can write PHP it's game over Jealously protect PHP permissions Users with PHP can destroy the site by

accident Poorly coded PHP can introduce other vulns!

Page 11: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Permissions to Create Content

Created content could mean: Stored xss Stored xsrf Hijacked message Exploited trust Spam Drive by download And on and on...

Page 12: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Privilege Continued

Don't tree the Drupal permissions form!

Page 13: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Use Roles

Create roles to subdivide permissions to only those users who actually need them.

Page 14: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Limit Access to User Profiles

Consider using RealName module Limit access to authenticated users

Page 15: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Creating Profiles

Don't allow anonymous users to create new accounts (or they will)

Be careful what permissions these accounts could get

Page 16: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Don't Email Passwords!

Remove '!password' tokens! Login link works just fine

Page 17: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Limit PHP

If you aren't using the PHP input type get rid of it

Delete php in the /modules directory This will remove the PHP input format filter Make sure no role has any permission with

'PHP' in the description Monitor your permissions assignments

Page 18: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Refine Input Types

Restrict HTML Input

Page 19: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Modules

Modules are the #1 way vulnerabilities get to your site

Don't use pre release modules no matter what the help forums say!

They aren't suitable for production They're not supported by Drupal security They're buggy by definition!

Page 20: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

File Uploads

Be careful what files can be uploaded

Page 21: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Restrict Error Reporting

MySQL errors aren't helpful to users and can give away configuration details.

Page 22: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Mitigation

Defensive strategies help to defend your Drupal site

Page 23: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Defense in Depth

If you can't prevent – detect! Several core modules help

Page 24: Drupal Security Securing your Configuration Justin C. Klein Keane University of Pennsylvania School of Arts and Sciences Information Security and Unix

Defense in Depth

Review your logs to detect Or use an automated system like OSSEC (

http://www.ossec.net)