Tips for improving Drupal security

 


I had a chance to check out the Talking Drupal: Drupal security podcast. These were my key takeaways.


Top 3 tips

Its stuff we already know about but don't do. Lets educate and remind ourselves and others.

  1. Do not write down passwords (especially on sticky notes). Use a Password Manager e.g. LastPass, Bitwarden, Passbolt
  2. Patch your modules. Security patches are released every 3rd Tuesday of the month by the Drupal Security team. Sign up to security announcements. You can use RSS feeds to bring updates to your slack, teams, etc. There is also a Discord site.
  3. Use tools that make your code better. e.g. CI to make it more readable (coding styles, comments). Code reviews. Write the least amount of code as possible. No code is best ie only using Core and Contrib modules. (IMO, as a developer this is impossible 😂) 

 
Contrib modules to help improve Drupal security

 
Have a Security plan

Plan for the worst. What will you do “WHEN” you get hacked? Also provide a way for users to report potential security issues to you.
 

Finding vulnerabilities

Drupal Security team is mostly reactive. They rely on the community or their own experiences to find vulnerabilities, then respond to them and patch as required.

They often patch a core issue and find contrib modules that have the same vulnerability. They identify the code pattern, then use regular expression to search across local repo’s (top contrib modules are available on a hard-drive) and/or Gitlab.
 

Report potential vulnerabilities

Do not post to public issue queue or forums. Post to the security issue queue which is private.
 

Dependabot does not work with PHP

My experience with Github Depenabot is that its good at finding vulnerable npm packages but not so much PHP. While listening I did some research on tools for scanning PHP apps using Github Actions. I came across a few which I will try when I get some time:

Patches

Things not covered but may be helpful to readers.
  • Check patches carefully before applying them. It may be a source of a potential vulnerability.
  • Record the issue ID in your composer so you can review the issue from time to time to use the approved patch or patched version.
  • Do not use a patch generated by a merge/pull request (PR) as it can change at any time (code poising attack). Download it to your repo and patch.

The Talk

Have a listen/watch to find more goodies



Comments

Popular posts from this blog

Insights for Software Development Workflows from the Pacific Islands

Government of Tonga’s first mobile app nears completion

Bot Busters: Defending Your Site Against Bots