Skip to content

Additional collection backends for libmodsecurity (Redis, Memcached) #1139

Open

Description

@zimmerle

ModSecurity version 3 architecture allow the utilization of multiple backends, including redis. The support should be implemented. The interface is available here:

https://github.com/SpiderLabs/ModSecurity/blob/libmodsecurity/headers/modsecurity/collection/collection.h

Activity

  1. self-assigned this
    on May 5, 2016
  2. theadoria commented on Aug 18, 2016

    @theadoria

    Will this support connecting to redis over a unix socket? Would be very useful for multi tenant environments :)

  3. zimmerle commented on Aug 25, 2016

    @zimmerle
    ContributorAuthor

    Hi @tedwardia, the support for Redis [or Memcache] should be independent of transport. That way you will be able to use what fits better inside your environment. Notice that you will be also able to choose which backend you want to use.

  4. tomsommer commented on May 30, 2017

    @tomsommer
    Contributor

    Major +1

  5. HugoSoszynski commented on Feb 22, 2018

    @HugoSoszynski

    Hi,

    The VultureProject team (https://vultureproject.org/) is currently developing this feature for ModSecurity v3.
    We are working to make it available for everyone as soon as possible.

    Regards,

    Hugo SOSZYNSKI
    Vulture Team

  6. zimmerle commented on Feb 23, 2018

    @zimmerle
    ContributorAuthor

    @HugoSoszynski if you need to discuss any aspect of the implementation, I will be glad to help.

  7. zimmerle commented on Feb 28, 2018

    @zimmerle
    ContributorAuthor

    @HugoSoszynski any position so far?

  8. HugoSoszynski commented on Mar 1, 2018

    @HugoSoszynski

    Hi,

    @zimmerle You can check the work done so far here : https://github.com/VultureProject/ModSecurity/tree/remotes/trunk/src/collection/backend .

    A summary of the features and the design informations is available in my last commit (https://github.com/VultureProject/ModSecurity/commit/71ba1d041e10c508dc47a471f76185d2295d90da).

    I am currently testing the internal methods such as querying and fail-over in our infrastructures as it is pretty hard to create a REDIS cluster on a Travis VM.
    Once the internal methods are validated, I will implement the Collections methods and start Travis unit testing.

    If you have any question, suggestion and / or correction to submit, feel free to open an Issue on the VultureProject repository.

    Regards,

    Hugo SOSZYNSKI
    Vulture Team

  9. zimmerle commented on Mar 1, 2018

    @zimmerle
    ContributorAuthor

    good news! :) i will be looking in to it.

  10. HugoSoszynski commented on Mar 8, 2018

    @HugoSoszynski

    Hi,

    @zimmerle
    In my quest to replicate the actual behavior of Collections with REDIS I'm having some trouble:

    • Is there any documentation about the exact detailed behavior of the Collection methods ?
    • As REDIS does not authorize multiple identical keys, I found a workaround using LIST object. However, it is pretty hard to emulate the behavior of an std::unordered_multimap or LMDB; must the REDIS Collection have the exact same behavior ?

    I hope we find some solutions to these questions.
    Regards,

    Hugo SOSZYNSKI
    Vulture Team

  11. zimmerle commented on Mar 8, 2018

    @zimmerle
    ContributorAuthor

    Hi @HugoSoszynski,

    • There is no documentation about it :(
    • There is the need to have a middle ware, converting the ModSecurity data into Redis and vice-versa. A good way to test if it is working is by running the regression tests.
  12. modified the milestones: v3.0.1, on Apr 2, 2018
  13. modified the milestones: v3.0.3, v3.0.4 on Sep 5, 2018
  14. LeeShan87 commented on Jan 22, 2019

    @LeeShan87

    It seem VultureProject stopped implementing redis backend for modsecurity. :(

    https://github.com/VultureProject/ModSecurity/

  15. fzipi commented on Oct 12, 2026

    @fzipi
    Collaborator

    Revisiting this one. 3.x still ships two collection backends, in-memory per process and LMDB (src/collection/backend/). The Vulture fork that started a Redis backend was abandoned in 2019 and nothing came back upstream. The interface is still there for anyone who wants to pick it up.

    Proposal: keep this as the tracking issue for additional collection backends (Redis, Memcached, ...) and label it help wanted; close #1140 into it. Needs a maintainer decision.

  16. added
    3.xRelated to ModSecurity version 3.x
    on Oct 12, 2026
  17. changed the title [-]Implement Redis support as Collection backend on libmodsecurity[/-] [+]Additional collection backends for libmodsecurity (Redis, Memcached)[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions