SlideShare a Scribd company logo
Drupal and SecurityAdvice for Site Builders and Coders
Arunkumar Kuppuswamy
Software Engineer
Innoppl Technologies
arunkumar1.akk@gmail.com
Phone: +91 80986 41508
● Security Vulnerabilities
● General Tips
● Server Environment
● Site Configurations
● Personal Practices
● Drupal Configuration
● Writing Custom Codes
Agenda
● Drupal is an open-source CMS and or framework
● 2.2% of websites in Internet are running using
Drupal
● 3rd Popular CMS in world.
● Reliability
● Scalability
● A huge dedicated community
Why Drupal ?
https://w3techs.com/technologies/overview/content_management/all
Do you think Drupal is the Right choice ?
Source: CVE Details
Source: CVE Details
- System flaw or weakness in an application
● Cross Site Scripting (XSS)
● Broken Authentication
● Gain Information / Privileges
● SQL Injection
● Bypass something
● CSRF
Security vulnerabilities
● Cross Site Scripting
● Code in the browser
● Making requests
● Parsing responses
● Javascript, Flash, Java, etc.
What is XSS?
● Filter text
● On output to browser
● As late as reasonable
● Some API filters where reasonable
● t() and Drupal::translation()->formatPlural()
with @text and %text placeholders
Fixing XSS?
Drupal and security - Advice for Site Builders and Coders
- User to access the system without going through
the security clearance
● User can see or do something
● That permissions/access should prevent
What is Access Bypass?
● Creating Permissions
MODULE_NAME.permissions.yml
Fixing Access Bypass
● Menu Callbacks
MODULE_NAME.routing.yml
Fixing Access Bypass
● Node access
○ hook_node_access()
● User access
○ hook_user_access()
● Entity access
○ hook_entity_access()
● Field access
○ hook_field_access()
Fixing Access Bypass
Fixing Access Bypass?
● User has permission to Access
● Use behat
Fixing Access Bypass?
- Executing malicious SQL statements.
● Incorrectly filtered escape characters
● Incorrect type handling
● Blind Conditional SQL injection
SQL Injection
Drupal SQL Injection Sample Code
Drupal SQL Injection Sample Code
● Database abstraction layer
● Adding tags to your queries
Fixing SQL Injection
Unauthorized commands are transmitted from a user that
the website trusts.
● Path that does not confirm intent
● <img src="http://example.com/node/1/quickdelete" >
● Mostly in Form submissions
What is CSRF?
● Use Form API: confirmation forms
● Send and validate tokens : Drupal::csrfToken()
● Using a secret cookie
● Multi-Step Transactions
● HTTPS
Fixing CSRF?
● YAML route definition for a protected link
● Protected Ajax request
Fixing CSRF?
● Protected Ajax request
Fixing CSRF?
● Roles and permissions
● Keep your site settings secure
○ Text formats
○ PHP module
○ PHP in other modules
Secure site configuration
● File permissions: web server user forbidden to
change code
● PHP execution: restrict in .htaccess or Nginx
config
● Drupal handbook for securing your site
Secure site configuration
● Secure Login
● Paranoia
● Security Review
● Permissions Lock
● Hacked!
● Password policy / Password strength
● Two Factor Authentication
● Shield
● Security Kit
Modules Enhancing Security
● Stronger password hashing / salt
● Login flood control
○ prevents brute-force credential guessing
● Protected cron
○ prevents Denial of Service attacks
Drupal 8
Update Settings
● Automatically sanitizes strings on output
● No PHP in templates
● You can't run SQL queries
● Twig auto-escaping : htmlspecialchars()
Drupal 8: Twig
Drupal and security - Advice for Site Builders and Coders
● Filtered HTML format
● Limiting users to using only images local
Content Entry & Filtering Improved
Choosing Contrib Modules
● Use HTTPS, SSH, SFTP
● Strong password policy
● Server – LAMP stack
● Require SSH keys
● Take & verify your backups
○ Sanitize backups before sharing
General Tips
● Drupal Security Team
○ Keep Drupal code secure in core and contrib
○ Educate the community on security best
practices
1. Developers
2. Site builders
3. Site administrators and users
4. Decision makers
○ Security Advisory for every security release
○ @drupalsecurityandSecurity Group
Security Process
Security Issue
Code Maintainer
Team Security
New Release
● https://www.oakleys.org.uk/blog/2017/01/how_to_secure_a_drupal
_website
● https://pantheon.io/blog/9-tips-and-tricks-securing-your-drupal-site
-pantheon
● https://www.drupal.org/documentation/is-drupal-secure
● https://www.drupal.org/security/secure-configuration
● https://www.ostraining.com/blog/drupal/8-things-drupal-security/
● https://www.keycdn.com/blog/drupal-security/
References:
Any Queries ?
Thank you!

More Related Content

PPTX
Same-origin Policy (SOP)
PPT
Securing Drupal 7: Do not get Hacked or Spammed to death!
PDF
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
ODP
Drupal Security Hardening
PDF
Hack Proof Your Drupal Site
PDF
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
PDF
Screaming Fast Wpmu
PDF
Cache hcm-topdev
Same-origin Policy (SOP)
Securing Drupal 7: Do not get Hacked or Spammed to death!
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Drupal Security Hardening
Hack Proof Your Drupal Site
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
Screaming Fast Wpmu
Cache hcm-topdev

What's hot (19)

PPTX
Power shell v3 session1
PPTX
Security Testing - Zap It
PDF
Getting Started With WP REST API
PDF
Sơ lược kiến trúc hệ thống Zing Me
PDF
StripeCon EU 2018 - SilverStripe 4 application framework
PPTX
Learn to pen-test with OWASP ZAP
PPTX
NodeJS Presentation
PDF
Zingme practice for building scalable website with PHP
PDF
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
PDF
Discovering Chrome Extensions
PPTX
Adobe CQ5 for Developers - Introduction
PDF
How to Secure Your WordPress Site
PDF
AOEconf17: Application Security - Bastian Ike
PPTX
Xss preso
PDF
How to speed up your website
PDF
Secret Management Journey - Here Be Dragons aka Secret Dragons
PPTX
Introdcution to Adobe CQ
PPTX
ODP
2014 ZAP Workshop 2: Contexts and Fuzzing
Power shell v3 session1
Security Testing - Zap It
Getting Started With WP REST API
Sơ lược kiến trúc hệ thống Zing Me
StripeCon EU 2018 - SilverStripe 4 application framework
Learn to pen-test with OWASP ZAP
NodeJS Presentation
Zingme practice for building scalable website with PHP
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Discovering Chrome Extensions
Adobe CQ5 for Developers - Introduction
How to Secure Your WordPress Site
AOEconf17: Application Security - Bastian Ike
Xss preso
How to speed up your website
Secret Management Journey - Here Be Dragons aka Secret Dragons
Introdcution to Adobe CQ
2014 ZAP Workshop 2: Contexts and Fuzzing
Ad

Similar to Drupal and security - Advice for Site Builders and Coders (20)

PDF
Drupal and Security: What You Need to Know
PDF
Doing Drupal security right
PDF
Doing Drupal security right from Drupalcon London
PDF
Drupal Security from Drupalcamp Cologne 2009
PDF
Drupal Security Basics for the DrupalJax January Meetup
PDF
Drupal Security from Drupalcamp Bratislava
PDF
Looking for Vulnerable Code. Vlad Savitsky
PPT
Drupal security
PDF
Drupal campleuven: Secure Drupal Development
PDF
Drupal Security Seminar
ODP
Drupal Security Hardening
PDF
Drupal security
PPTX
OWASP Top 10 vs Drupal - OWASP Benelux 2012
PDF
Drupal Security
KEY
Drupal Security Intro
ODP
Scout xss csrf_security_presentation_chicago
PPT
Hack-Proof Your Drupal App
PDF
Attacking Drupal
PDF
Is Drupal Secure?
PDF
Is Drupal secure?
Drupal and Security: What You Need to Know
Doing Drupal security right
Doing Drupal security right from Drupalcon London
Drupal Security from Drupalcamp Cologne 2009
Drupal Security Basics for the DrupalJax January Meetup
Drupal Security from Drupalcamp Bratislava
Looking for Vulnerable Code. Vlad Savitsky
Drupal security
Drupal campleuven: Secure Drupal Development
Drupal Security Seminar
Drupal Security Hardening
Drupal security
OWASP Top 10 vs Drupal - OWASP Benelux 2012
Drupal Security
Drupal Security Intro
Scout xss csrf_security_presentation_chicago
Hack-Proof Your Drupal App
Attacking Drupal
Is Drupal Secure?
Is Drupal secure?
Ad

More from Arunkumar Kupppuswamy (7)

PDF
Drupal Development Tools.pdf
PPTX
Build website using Open Source Technology
PPTX
Drupal 8 Performance & SEO optimizaion
PPTX
D8 search api
PPTX
Object Oriented Programming - Basic Concepts
PPTX
Drupal 8 : Introduction to Big Pipe
PPTX
Drupal Coding Standards - do and don't
Drupal Development Tools.pdf
Build website using Open Source Technology
Drupal 8 Performance & SEO optimizaion
D8 search api
Object Oriented Programming - Basic Concepts
Drupal 8 : Introduction to Big Pipe
Drupal Coding Standards - do and don't

Recently uploaded (20)

PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
Digital Literacy And Online Safety on internet
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
Testing WebRTC applications at scale.pdf
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Introduction to Information and Communication Technology
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPT
tcp ip networks nd ip layering assotred slides
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Introduction to the IoT system, how the IoT system works
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
Digital Literacy And Online Safety on internet
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
introduction about ICD -10 & ICD-11 ppt.pptx
The Internet -By the Numbers, Sri Lanka Edition
Testing WebRTC applications at scale.pdf
Sims 4 Historia para lo sims 4 para jugar
SAP Ariba Sourcing PPT for learning material
WebRTC in SignalWire - troubleshooting media negotiation
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Introduction to Information and Communication Technology
Job_Card_System_Styled_lorem_ipsum_.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Introuction about WHO-FIC in ICD-10.pptx
tcp ip networks nd ip layering assotred slides
Unit-1 introduction to cyber security discuss about how to secure a system
Introduction to the IoT system, how the IoT system works
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...

Drupal and security - Advice for Site Builders and Coders