All Projects → SpiderLabs → modsec-sdbm-util

SpiderLabs / modsec-sdbm-util

Licence: Apache-2.0 license
Utility to manipulate SDBM files used by ModSecurity. With that utility it is possible to _shrink_ SDBM databases. It is also possible to list the SDBM contents with filters such as: expired or invalid items only.

Programming Languages

c
50402 projects - #5 most used programming language
M4
1887 projects
shell
77523 projects
Makefile
30231 projects

modsec-sdbm-util

This utility was created in order to make easy the maintenance of the SDBM files which stores ModSecurity persistent collections.

List of options:

  • -k, shrink: Removes all the expired elements as long as others not well formated items from the database.
  • -n, new: Extract valid items of a database to a new one. Output will be: /tmp/new_db.[ip,pag]
  • -D, directory: Used with -n, expects to receive a directory path in which the the resulting new_db.[ip,pag] files are placed.
  • -s, status: Print information about the table, such us the amount of items, amount of expired items and also the amount of malformed items that may be using space;
  • -d, dump: Dump all database items to 'stdout';
  • -u, unpack: Interpret the content of the value as ModSecurity does, printing the results to the console. (This does not make sense without the -d option);
  • -x, expired: Print only the expired elements. (As unpack, this item does not make sense without the dump option)
  • -r, remove: Expects to receive a key as a paramter to be removed;
  • -v, verbose: Some extra information about what this utility is doing;
  • -h, help: this message.

Build Prerequisities

Fedora

# dnf install libtool automake gcc apr-devel apr-util-devel

RHEL

# yum install libtool automake gcc apr-devel apr-util-devel

Build instructions

# ./autogen.sh
# ./configure
# make
# ./modsec-sdbm-util
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].